Skip to content

Commit 58ddb3b

Browse files
author
Pete Johns
committed
Fixed danmar#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.
1 parent d4e3e7e commit 58ddb3b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

test/testsuite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static std::string writestr(const std::string &str)
112112
return ostr.str();
113113
}
114114

115-
void TestFixture::assert(const char *filename, int linenr, bool condition)
115+
void TestFixture::assert_(const char *filename, int linenr, bool condition)
116116
{
117117
if (!condition)
118118
{

test/testsuite.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class TestFixture : public ErrorLogger
4646

4747
bool runTest(const char testname[]);
4848

49-
void assert(const char *filename, int linenr, bool condition);
49+
void assert_(const char *filename, int linenr, bool condition);
5050

5151
void assertEquals(const char *filename, int linenr, const std::string &expected, const std::string &actual, const std::string &msg = "");
5252

@@ -72,7 +72,7 @@ class TestFixture : public ErrorLogger
7272
};
7373

7474
#define TEST_CASE( NAME ) if ( runTest(#NAME) ) { if (quiet_tests) { REDIRECT; NAME(); } else { NAME ();} }
75-
#define ASSERT( CONDITION ) assert(__FILE__, __LINE__, CONDITION)
75+
#define ASSERT( CONDITION ) assert_(__FILE__, __LINE__, CONDITION)
7676
#define ASSERT_EQUALS( EXPECTED , ACTUAL ) assertEquals(__FILE__, __LINE__, EXPECTED, ACTUAL)
7777
#define ASSERT_EQUALS_MSG( EXPECTED , ACTUAL, MSG ) assertEquals(__FILE__, __LINE__, EXPECTED, ACTUAL, MSG)
7878
#define ASSERT_THROW( CMD, EXCEPTION ) try { CMD ; assertThrowFail(__FILE__, __LINE__); } catch (EXCEPTION &) { } catch (...) { assertThrowFail(__FILE__, __LINE__); }

0 commit comments

Comments
 (0)