#pragma once

#include <cassert>
#include <cstdlib>

#ifdef NDEBUG
#error "You must run tests in debug mode !"
#endif

namespace blitz {
namespace utils {

#define BLITZ_TEST_SUCCESSFUL 0
#define BLITZ_TEST_FAILED 1

#ifdef _WIN32
#define blitz_test_assert(...) assert((__VA_ARGS__))
#else
#define blitz_test_assert(...)                                                                                                        \
	if (!static_cast<bool>(__VA_ARGS__)) {                                                                                            \
		blitz::utils::LOGAssert(#__VA_ARGS__, __FILE__, __LINE__, __ASSERT_FUNCTION);                                                 \
		std::exit(BLITZ_TEST_FAILED);                                                                                                 \
	}
#endif

void LOGAssert(const char* expression, const char* file, int line, const char* function);

}  // namespace utils
}  // namespace blitz
