Fixed #2360 (testrunner fails to build in Mac OS X Leopard (10.5) - assert macro vs assert method)
Renamed assert to assert_. Tested with gcc v4.0.1 on Snow Leopard.
This commit is contained in:
parent
d4e3e7e201
commit
58ddb3b0ab
|
@ -112,7 +112,7 @@ static std::string writestr(const std::string &str)
|
|||
return ostr.str();
|
||||
}
|
||||
|
||||
void TestFixture::assert(const char *filename, int linenr, bool condition)
|
||||
void TestFixture::assert_(const char *filename, int linenr, bool condition)
|
||||
{
|
||||
if (!condition)
|
||||
{
|
||||
|
|
|
@ -46,7 +46,7 @@ protected:
|
|||
|
||||
bool runTest(const char testname[]);
|
||||
|
||||
void assert(const char *filename, int linenr, bool condition);
|
||||
void assert_(const char *filename, int linenr, bool condition);
|
||||
|
||||
void assertEquals(const char *filename, int linenr, const std::string &expected, const std::string &actual, const std::string &msg = "");
|
||||
|
||||
|
@ -72,7 +72,7 @@ public:
|
|||
};
|
||||
|
||||
#define TEST_CASE( NAME ) if ( runTest(#NAME) ) { if (quiet_tests) { REDIRECT; NAME(); } else { NAME ();} }
|
||||
#define ASSERT( CONDITION ) assert(__FILE__, __LINE__, CONDITION)
|
||||
#define ASSERT( CONDITION ) assert_(__FILE__, __LINE__, CONDITION)
|
||||
#define ASSERT_EQUALS( EXPECTED , ACTUAL ) assertEquals(__FILE__, __LINE__, EXPECTED, ACTUAL)
|
||||
#define ASSERT_EQUALS_MSG( EXPECTED , ACTUAL, MSG ) assertEquals(__FILE__, __LINE__, EXPECTED, ACTUAL, MSG)
|
||||
#define ASSERT_THROW( CMD, EXCEPTION ) try { CMD ; assertThrowFail(__FILE__, __LINE__); } catch (EXCEPTION &) { } catch (...) { assertThrowFail(__FILE__, __LINE__); }
|
||||
|
|
Loading…
Reference in New Issue