diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-03-02 08:59:03 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-03-02 08:59:03 +0000 |
commit | 19a144f9f4be209b1e6d7480480b81c6e4a1dccc (patch) | |
tree | 331c6a00e29c6ff4a623d01587b2619dfbb072c5 /lib/backupstore | |
parent | 1fa34cd0b80e90e9cfb493fd2f085310279ad4f9 (diff) |
Add convenience macro for testing commands that return errors.
Diffstat (limited to 'lib/backupstore')
-rw-r--r-- | lib/backupstore/StoreTestUtils.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/backupstore/StoreTestUtils.h b/lib/backupstore/StoreTestUtils.h index 3365a7f4..d8655e63 100644 --- a/lib/backupstore/StoreTestUtils.h +++ b/lib/backupstore/StoreTestUtils.h @@ -75,5 +75,10 @@ bool create_account(int soft, int hard); //! Deletes the standard test account, for testing behaviour with no account. bool delete_account(); +#define TEST_COMMAND_RETURNS_ERROR(command, error) \ + TEST_CHECK_THROWS(command, ConnectionException, \ + Conn_Protocol_UnexpectedReply); \ + TEST_EQUAL(BackupProtocolError::error, protocol.GetLastErrorType()); + #endif // STORETESTUTILS__H |