Add testing function and macro

This commit is contained in:
2023-10-03 14:25:40 +02:00
parent 9bf313ef02
commit 0b8b5f88a6
2 changed files with 23 additions and 0 deletions

View File

@@ -35,6 +35,8 @@
#define DEBUG(msg)
#endif
#define ASSERT(expr) m_assert(expr, #expr, __FUNCTION__, __FILE__, __LINE__)
/** Code stolen from https://github.com/anderkve/FYS3150
* Header: https://github.com/anderkve/FYS3150/blob/master/code_examples/compilation_linking/example_1/include/utils.hpp
* Source: https://github.com/anderkve/FYS3150/blob/master/code_examples/compilation_linking/example_1/src/utils.cpp
@@ -62,4 +64,6 @@ std::string scientific_format(const std::vector<double>& v,
int width=20,
int prec=10);
void m_assert(bool expr, const char* expr_str, const char* func, const char* file, int line);
#endif