summaryrefslogtreecommitdiff
path: root/lib/backupstore/StoreTestUtils.h
Commit message (Collapse)AuthorAge
* Improve error message when TEST_PROTOCOL_ERROR_OR() fails.Chris Wilson2015-08-06
| | | | | | The protocol command didn't succeed, it just returned a result with an unexpected type, so make the failure message reflect that and give details of the response actually received, to help with debugging.
* Remove duplicate declaration of test functions.Chris Wilson2015-07-25
|
* Add ability to run commands in context with TEST_CHECK_THROWS_AND_OR.Chris Wilson2015-04-15
| | | | | Allows the exception message to be captured before it goes out of scope.
* Refactor StartClient and StopClient out of testbbackupd.Chris Wilson2014-10-31
| | | | Use them in testbackupstorefix to reduce code duplication.
* Whitespace fixesChris Wilson2014-09-18
|
* Define setup and teardown functions and macros, and use them.Chris Wilson2014-09-04
| | | | Merged back changes from the test refactor branch to reduce diffs.
* Define some functions to reduce duplication in testbbackupd.Chris Wilson2014-09-04
| | | | | | | | | Merged back changes from the test refactor branch to reduce diffs. Fix wrong setting of log level in compare() function. We want to only show errors if we expect mismatches, and show warnings if we didn't expect mismatches. I had it the other way around before.
* Compile fix for backwards compatibility code.Chris Wilson2014-08-15
|
* Add a TEST_PROTOCOL_ERROR_OR assertion.Chris Wilson2014-08-15
| | | | | | | | Similar to TEST_COMMAND_RETURNS_ERROR_OR, but allows any command or sequence to cause the error, without direct access to the command message. Refactor so that TEST_COMMAND_RETURNS_ERROR_OR calls TEST_PROTOCOL_ERROR_OR to make the assertion on the last error seen by the protocol.
* Add some test helper _OR macros to execute commands when conditions fail.Chris Wilson2014-04-09
| | | | | | | | This is useful to return from a test if an assertion/check fails, instead of throwing an exception. Also add logging of the actual error code received (with name) to TEST_COMMAND_RETURNS_ERROR(_OR).
* Add a utility to check account for errors, expecting that there are some.Chris Wilson2014-04-09
| | | | Returns the number of errors found and fixed.
* Add convenience macro for testing commands that return errors.Chris Wilson2014-03-02
|
* Make Protocol take control of the socket object passed in.Chris Wilson2014-03-01
| | | | | | | | | | | | | We pass a std::auto_ptr<SocketStream> to every Protocol subclass when we construct it, and it takes control of this object. This reduces the risk of: * accidentally reusing the same SocketStream for multiple Protocols (it happened to me in testbackupstore); * holding onto a reference to the SocketStream; * allowing a locally-scoped SocketStream to go out of scope and be released while still being referenced by a live Protocol.
* Use the new test utilities to remove some duplicate code.Chris Wilson2014-02-27
| | | | Fix previous changes by waiting for forked bbstored process during termination.
* Move test utilities into a separate file, to share with testbbackupd.Chris Wilson2014-02-27