Changeset 2220
- Timestamp:
- 06/08/2008 19:25:48 (5 months ago)
- Files:
-
- 1 modified
-
box/trunk/test/bbackupd/testbbackupd.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/test/bbackupd/testbbackupd.cpp
r2216 r2220 82 82 83 83 // utility macro for comparing two strings in a line 84 #define TEST_EQUAL( expected, found,line) \84 #define TEST_EQUAL(_expected, _found, _line) \ 85 85 { \ 86 86 std::ostringstream _oss1; \ 87 _oss1 << expected; \88 std::string exp_str = _oss1.str(); \87 _oss1 << _expected; \ 88 std::string _exp_str = _oss1.str(); \ 89 89 \ 90 90 std::ostringstream _oss2; \ 91 _oss2 << found; \92 std::string found_str = _oss2.str(); \91 _oss2 << _found; \ 92 std::string _found_str = _oss2.str(); \ 93 93 \ 94 if( exp_str !=found_str) \94 if(_exp_str != _found_str) \ 95 95 { \ 96 std::string _line =line; \96 std::string _line_str = _line; \ 97 97 printf("Expected <%s> but found <%s> in <%s>\n", \ 98 exp_str.c_str(), found_str.c_str(), _line.c_str()); \ 99 TEST_FAIL_WITH_MESSAGE(#found " != " #expected " in " line); \ 98 _exp_str.c_str(), _found_str.c_str(), _line_str.c_str()); \ 99 \ 100 std::ostringstream _oss3; \ 101 _oss3 << #_found << " != " << #_expected << " in " << _line; \ 102 \ 103 TEST_FAIL_WITH_MESSAGE(_oss3.str().c_str()); \ 100 104 } \ 101 105 } 102 106 103 107 // utility macro for testing a line 104 #define TEST_LINE( condition,line) \105 TEST_THAT( condition); \106 if (!( condition)) \108 #define TEST_LINE(_condition, _line) \ 109 TEST_THAT(_condition); \ 110 if (!(_condition)) \ 107 111 { \ 108 printf("Test failed on <%s>\n", line.c_str()); \112 printf("Test failed on <%s>\n", _line.c_str()); \ 109 113 } 110 114
