?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  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.  
  11. namespace UnitTest {
  12.  
  13.    class TestResults;
  14.    class TestDetails;
  15.  
  16.    namespace Detail {
  17.  
  18.       UNITTEST_LINKAGE void ExpectAssert(bool expected);
  19.  
  20.       UNITTEST_LINKAGE void ReportAssertEx(TestResults* testResults,
  21.                                            const TestDetails* testDetails,
  22.                                            char const* description,
  23.                                            char const* filename,
  24.                                            int lineNumber);
  25.  
  26.       UNITTEST_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
  47.