mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-27 00:28:49 +03:00
Included the project files as well as the automatically generated makefiles. The library compiles without issues. Borland requires the UnitTest namespace to be defined at the beginning of tests. Added an default to have no support for C++11. Added a Borland to the list of compilers that don't recognize "long long" but use __int64 instead.
47 lines
1 KiB
C++
47 lines
1 KiB
C++
#define UNITTEST_DISABLE_SHORT_MACROS
|
|
|
|
#include "UnitTest++/UnitTestPP.h"
|
|
|
|
using namespace UnitTest;
|
|
|
|
// This file is not intended to test every little thing, just a few basics to hopefully ensure
|
|
// the macros are working and the short macros are not defined.
|
|
UNITTEST_SUITE(LongMacros)
|
|
{
|
|
UNITTEST_TEST(LongCheckMacroWorks)
|
|
{
|
|
UNITTEST_CHECK(true);
|
|
}
|
|
|
|
class Fixture
|
|
{
|
|
public:
|
|
Fixture() : sanity_(true) {}
|
|
protected:
|
|
bool sanity_;
|
|
};
|
|
|
|
UNITTEST_TEST_FIXTURE(Fixture, LongFixtureMacroWorks)
|
|
{
|
|
UNITTEST_REQUIRE UNITTEST_CHECK(sanity_);
|
|
}
|
|
|
|
UNITTEST_TEST(ShortMacrosAreNotDefined)
|
|
{
|
|
#if defined(CHECK) || \
|
|
defined(CHECK_EQUAL) || \
|
|
defined(CHECK_CLOSE) || \
|
|
defined(CHECK_ARRAY_EQUAL) || \
|
|
defined(CHECK_ARRAY_CLOSE) || \
|
|
defined(CHECK_ARRAY2D_CLOSE) || \
|
|
defined(CHECK_THROW) || \
|
|
defined(CHECK_ASSERT) || \
|
|
defined(SUITE) || \
|
|
defined(TEST) || \
|
|
defined(TEST_FIXTURE) || \
|
|
defined(REQUIRE)
|
|
|
|
UNITTEST_CHECK(false);
|
|
#endif
|
|
}
|
|
}
|