forked from activeloopai/deeplake
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassert.hpp
More file actions
31 lines (19 loc) · 852 Bytes
/
Copy pathassert.hpp
File metadata and controls
31 lines (19 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
/**
* @file assert.hpp
* @brief Macro for indra specific ASSERT.
*/
#ifdef AL_ASSERTIONS
#include "backtrace.hpp"
#include <string>
namespace base {
[[noreturn]] void abort(const std::string& message);
}
#define ASSERT_MESSAGE(expression, message) \
if (!(expression)) \
base::abort(std::string("Assertion Failed: ") + #expression + "\nMessage: " + message + "\nFile: " + __FILE__ + \
":" + std::to_string(__LINE__) + "\nBacktrace:\n" + base::backtrace())
#else // AL_ASSERTIONS
#define ASSERT_MESSAGE(expression, message) ((void)0)
#endif // AL_ASSERTIONS
#define ASSERT(expression) ASSERT_MESSAGE((expression), #expression)