summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/backupstore/StoreTestUtils.h4
-rw-r--r--lib/common/Test.h5
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/backupstore/StoreTestUtils.h b/lib/backupstore/StoreTestUtils.h
index 0740b3ec..37c6bd29 100644
--- a/lib/backupstore/StoreTestUtils.h
+++ b/lib/backupstore/StoreTestUtils.h
@@ -114,8 +114,8 @@ bool delete_account();
}
#define TEST_COMMAND_RETURNS_ERROR_OR(protocol, command, error, or_statements) \
- TEST_CHECK_THROWS_OR((protocol) . command, ConnectionException, \
- Protocol_UnexpectedReply, or_statements); \
+ TEST_CHECK_THROWS_AND_OR((protocol) . command, ConnectionException, \
+ Protocol_UnexpectedReply, /* and_command */, or_statements); \
TEST_PROTOCOL_ERROR_OR(protocol, error, or_statements)
#define TEST_COMMAND_RETURNS_ERROR(protocol, command, error) \
diff --git a/lib/common/Test.h b/lib/common/Test.h
index be481ddd..c529332b 100644
--- a/lib/common/Test.h
+++ b/lib/common/Test.h
@@ -62,7 +62,7 @@ extern std::list<std::string> run_only_named_tests;
AssertFailed, "Condition [" #condition "] failed"));
// NOTE: The 0- bit is to allow this to work with stuff which has negative constants for flags (eg ConnectionException)
-#define TEST_CHECK_THROWS_OR(statement, excepttype, subtype, or_command) \
+#define TEST_CHECK_THROWS_AND_OR(statement, excepttype, subtype, and_command, or_command) \
{ \
bool didthrow = false; \
HideExceptionMessageGuard hide; \
@@ -80,6 +80,7 @@ extern std::list<std::string> run_only_named_tests;
throw; \
} \
didthrow = true; \
+ and_command; \
} \
catch(...) \
{ \
@@ -92,7 +93,7 @@ extern std::list<std::string> run_only_named_tests;
} \
}
#define TEST_CHECK_THROWS(statement, excepttype, subtype) \
- TEST_CHECK_THROWS_OR(statement, excepttype, subtype,)
+ TEST_CHECK_THROWS_AND_OR(statement, excepttype, subtype,,)
// utility macro for comparing two strings in a line
#define TEST_EQUAL_OR(_expected, _found, or_command) \