G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
ReportAssertImpl.h
1#ifndef UNITTEST_REPORTASSERTIMPL_H
2#define UNITTEST_REPORTASSERTIMPL_H
3
4#include "Config.h"
5#include "HelperMacros.h"
6
7#ifdef UNITTEST_NO_EXCEPTIONS
8 #include <csetjmp>
9#endif
10
11namespace UnitTest {
12
13class TestResults;
14class TestDetails;
15
16namespace Detail {
17
18UNITTEST_LINKAGE void ExpectAssert(bool expected);
19
20UNITTEST_LINKAGE void ReportAssertEx(TestResults* testResults,
21 const TestDetails* testDetails,
22 char const* description,
23 char const* filename,
24 int lineNumber);
25
26UNITTEST_LINKAGE bool AssertExpected();
27
28#ifdef UNITTEST_NO_EXCEPTIONS
29 UNITTEST_LINKAGE UNITTEST_JMPBUF* GetAssertJmpBuf();
30
31 #ifdef UNITTEST_WIN32
32 #define UNITTEST_SET_ASSERT_JUMP_TARGET() \
33 __pragma(warning(push)) __pragma(warning(disable:4611)) \
34 UNITTEST_SETJMP(*UnitTest::Detail::GetAssertJmpBuf()) \
35 __pragma(warning(pop))
36 #else
37 #define UNITTEST_SET_ASSERT_JUMP_TARGET() UNITTEST_SETJMP(*UnitTest::Detail::GetAssertJmpBuf())
38 #endif
39
40 #define UNITTEST_JUMP_TO_ASSERT_JUMP_TARGET() UNITTEST_LONGJMP(*UnitTest::Detail::GetAssertJmpBuf(), 1)
41#endif
42
43}
44}
45
46#endif