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:
Pete Johns 2010-12-28 07:19:48 +11:00
parent d4e3e7e201
commit 58ddb3b0ab
2 changed files with 3 additions and 3 deletions

View File

@ -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)
{

View File

@ -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__); }