?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. #define UNITTEST_DISABLE_SHORT_MACROS
  2.  
  3. #include "UnitTest++/UnitTestPP.h"
  4.  
  5. // This file is not intended to test every little thing, just a few basics to hopefully ensure
  6. // the macros are working and the short macros are not defined.
  7. UNITTEST_SUITE(LongMacros)
  8. {
  9.    UNITTEST_TEST(LongCheckMacroWorks)
  10.    {
  11.       UNITTEST_CHECK(true);
  12.    }
  13.  
  14.    class Fixture
  15.    {
  16.    public:
  17.       Fixture() : sanity_(true) {}
  18.    protected:
  19.       bool sanity_;
  20.    };
  21.  
  22.    UNITTEST_TEST_FIXTURE(Fixture, LongFixtureMacroWorks)
  23.    {
  24.       UNITTEST_REQUIRE UNITTEST_CHECK(sanity_);
  25.    }
  26.  
  27.    UNITTEST_TEST(ShortMacrosAreNotDefined)
  28.    {
  29. #if defined(CHECK) || \
  30.     defined(CHECK_EQUAL) || \
  31.     defined(CHECK_CLOSE) || \
  32.     defined(CHECK_ARRAY_EQUAL) || \
  33.     defined(CHECK_ARRAY_CLOSE) || \
  34.     defined(CHECK_ARRAY2D_CLOSE) || \
  35.     defined(CHECK_THROW) || \
  36.     defined(CHECK_ASSERT) || \
  37.     defined(SUITE) || \
  38.     defined(TEST) || \
  39.     defined(TEST_FIXTURE) || \
  40.     defined(REQUIRE)
  41.  
  42.       UNITTEST_CHECK(false);
  43. #endif
  44.    }
  45. }
  46.