diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-09-04 01:36:19 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-09-04 01:36:19 +0000 |
commit | e00bd81ce959d02d3fa62e7e75956162f8e70c7e (patch) | |
tree | df37302243b921f7adc26908ee1c9c5ea00afa60 /test | |
parent | 944745c21c7df19ada39e1d347ca732c1f424070 (diff) |
Changed many uses of BackupProtocolClient to BackupProtocolCallable.
Makes way for more use of local protocol objects and protocol subclasses.
Merged back changes from the test refactor branch to reduce diffs.
Diffstat (limited to 'test')
-rw-r--r-- | test/bbackupd/testbbackupd.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp index a6d0da75..12b22856 100644 --- a/test/bbackupd/testbbackupd.cpp +++ b/test/bbackupd/testbbackupd.cpp @@ -1096,7 +1096,7 @@ int test_bbackupd() printf("\n==== Testing that ReadDirectory on nonexistent directory " "does not crash\n"); { - std::auto_ptr<BackupProtocolClient> client = ConnectAndLogin( + std::auto_ptr<BackupProtocolCallable> client = connect_and_login( context, 0 /* read-write */); { @@ -1113,8 +1113,8 @@ int test_bbackupd() printf("\n==== Testing that GetObject on nonexistent file outputs the " "correct error message\n"); { - std::auto_ptr<BackupProtocolClient> connection = ConnectAndLogin( - context, 0 /* read-write */); + std::auto_ptr<BackupProtocolCallable> connection = + connect_and_login(context, 0 /* read-write */); std::string errs; std::auto_ptr<Configuration> config( Configuration::LoadAndVerify @@ -1520,8 +1520,8 @@ int test_bbackupd() int expected_blocks_old = 6; #endif - std::auto_ptr<BackupProtocolClient> client = - ConnectAndLogin(context, 0 /* read-write */); + std::auto_ptr<BackupProtocolCallable> client = + connect_and_login(context, 0 /* read-write */); TEST_THAT(check_num_files(5, expected_num_old, 0, 9)); TEST_THAT(check_num_blocks(*client, 10, expected_blocks_old, 0, 18, 28 + expected_blocks_old)); @@ -2188,9 +2188,9 @@ int test_bbackupd() TEST_THAT(!TestFileExists("testfiles/notifyran.backup-finish.2")); // Did it actually get created? Should not have been! - std::auto_ptr<BackupProtocolClient> client = - ConnectAndLogin(context, - BackupProtocolLogin::Flags_ReadOnly); + std::auto_ptr<BackupProtocolCallable> client = + connect_and_login(context, + BackupProtocolLogin::Flags_ReadOnly); std::auto_ptr<BackupStoreDirectory> dir = ReadDirectory(*client); @@ -2218,9 +2218,9 @@ int test_bbackupd() // BLOCK { - std::auto_ptr<BackupProtocolClient> client = - ConnectAndLogin(context, - BackupProtocolLogin::Flags_ReadOnly); + std::auto_ptr<BackupProtocolCallable> client = + connect_and_login(context, + BackupProtocolLogin::Flags_ReadOnly); std::auto_ptr<BackupStoreDirectory> dir = ReadDirectory(*client, @@ -2260,10 +2260,10 @@ int test_bbackupd() // not yet! should still be there { - std::auto_ptr<BackupProtocolClient> client = - ConnectAndLogin(context, - BackupProtocolLogin::Flags_ReadOnly); - + std::auto_ptr<BackupProtocolCallable> client = + connect_and_login(context, + BackupProtocolLogin::Flags_ReadOnly); + std::auto_ptr<BackupStoreDirectory> dir = ReadDirectory(*client); int64_t testDirId = SearchDir(*dir, "Test2"); @@ -2277,10 +2277,10 @@ int test_bbackupd() // NOW it should be gone { - std::auto_ptr<BackupProtocolClient> client = - ConnectAndLogin(context, - BackupProtocolLogin::Flags_ReadOnly); - + std::auto_ptr<BackupProtocolCallable> client = + connect_and_login(context, + BackupProtocolLogin::Flags_ReadOnly); + std::auto_ptr<BackupStoreDirectory> root_dir = ReadDirectory(*client); @@ -3738,9 +3738,9 @@ int test_bbackupd() printf("\n==== Resume restore\n"); - std::auto_ptr<BackupProtocolClient> client = - ConnectAndLogin(context, - BackupProtocolLogin::Flags_ReadOnly); + std::auto_ptr<BackupProtocolCallable> client = + connect_and_login(context, + BackupProtocolLogin::Flags_ReadOnly); // Check that the restore fn returns resume possible, // rather than doing anything |