summaryrefslogtreecommitdiff
path: root/lib/common/Test.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common/Test.h')
-rw-r--r--lib/common/Test.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/common/Test.h b/lib/common/Test.h
index 362b43af..08ba4542 100644
--- a/lib/common/Test.h
+++ b/lib/common/Test.h
@@ -18,14 +18,14 @@
#define BBSTORED "..\\..\\bin\\bbstored\\bbstored.exe"
#define BBACKUPQUERY "..\\..\\bin\\bbackupquery\\bbackupquery.exe"
#define BBSTOREACCOUNTS "..\\..\\bin\\bbstoreaccounts\\bbstoreaccounts.exe"
-#define TEST_RETURN(actual, expected) TEST_THAT(actual == expected);
+#define TEST_RETURN(actual, expected) TEST_EQUAL(expected, actual);
#else
#define BBACKUPCTL "../../bin/bbackupctl/bbackupctl"
#define BBACKUPD "../../bin/bbackupd/bbackupd"
#define BBSTORED "../../bin/bbstored/bbstored"
#define BBACKUPQUERY "../../bin/bbackupquery/bbackupquery"
#define BBSTOREACCOUNTS "../../bin/bbstoreaccounts/bbstoreaccounts"
-#define TEST_RETURN(actual, expected) TEST_THAT(actual == expected*256);
+#define TEST_RETURN(actual, expected) TEST_EQUAL((expected << 8), actual);
#endif
extern int failures;
@@ -54,6 +54,7 @@ extern std::string bbackupd_args, bbstored_args, bbackupquery_args, test_args;
#define TEST_CHECK_THROWS(statement, excepttype, subtype) \
{ \
bool didthrow = false; \
+ HideExceptionMessageGuard hide; \
try \
{ \
statement; \
@@ -90,8 +91,8 @@ extern std::string bbackupd_args, bbstored_args, bbackupquery_args, test_args;
\
if(_exp_str != _found_str) \
{ \
- printf("Expected <%s> but found <%s>\n", \
- _exp_str.c_str(), _found_str.c_str()); \
+ BOX_WARNING("Expected <" << _exp_str << "> but found <" << \
+ _found_str << ">"); \
\
std::ostringstream _oss3; \
_oss3 << #_found << " != " << #_expected; \
@@ -113,7 +114,9 @@ extern std::string bbackupd_args, bbstored_args, bbackupquery_args, test_args;
\
if(_exp_str != _found_str) \
{ \
- std::string _line_str = _line; \
+ std::ostringstream _ossl; \
+ _ossl << _line; \
+ std::string _line_str = _ossl.str(); \
printf("Expected <%s> but found <%s> in <%s>\n", \
_exp_str.c_str(), _found_str.c_str(), _line_str.c_str()); \
\
@@ -158,7 +161,7 @@ void sync_and_wait();
void terminate_bbackupd(int pid);
// Wait a given number of seconds for something to complete
-void wait_for_operation(int seconds, char* message);
+void wait_for_operation(int seconds, const char* message);
void safe_sleep(int seconds);
#endif // TEST__H