diff options
-rw-r--r-- | lib/backupstore/StoreTestUtils.h | 5 | ||||
-rwxr-xr-x | lib/server/makeprotocol.pl.in | 1 |
2 files changed, 6 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 diff --git a/lib/server/makeprotocol.pl.in b/lib/server/makeprotocol.pl.in index f90b5474..e02ac74c 100755 --- a/lib/server/makeprotocol.pl.in +++ b/lib/server/makeprotocol.pl.in @@ -532,6 +532,7 @@ public: virtual ~$client_server_base_class(); virtual std::auto_ptr<IOStream> ReceiveStream() = 0; bool GetLastError(int &rTypeOut, int &rSubTypeOut); + int GetLastErrorType() { return mLastErrorSubType; } protected: void SetLastError(int Type, int SubType) |