diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/backupstore/testbackupstore.cpp | 5 | ||||
-rw-r--r-- | test/bbackupd/testbbackupd.cpp | 23 |
2 files changed, 14 insertions, 14 deletions
diff --git a/test/backupstore/testbackupstore.cpp b/test/backupstore/testbackupstore.cpp index 04472a5d..f38d634d 100644 --- a/test/backupstore/testbackupstore.cpp +++ b/test/backupstore/testbackupstore.cpp @@ -1104,6 +1104,11 @@ bool test_server_housekeeping() ConnectionException, Conn_Protocol_UnexpectedReply); } + // Try retrieving an object that doesn't exist. That used to return + // BackupProtocolSuccess(NoObject) for no apparent reason. + TEST_COMMAND_RETURNS_ERROR(protocol, QueryGetObject(store1objid + 1), + Err_DoesNotExist); + // Close the protocol, so we can housekeep the account protocol.QueryFinished(); TEST_THAT(run_housekeeping_and_check_account()); diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp index 28651233..827e3ea0 100644 --- a/test/bbackupd/testbbackupd.cpp +++ b/test/bbackupd/testbbackupd.cpp @@ -324,7 +324,7 @@ int test_basics() BackupClientFileAttributes t3; { - Logging::Guard guard(Log::ERROR); + Logger::LevelGuard(Logging::GetConsole(), Log::ERROR); TEST_CHECK_THROWS(t3.ReadAttributes("doesn't exist"), CommonException, OSFileError); } @@ -345,7 +345,7 @@ int test_basics() #ifndef WIN32 { - Logging::Guard guard(Log::ERROR); + Logger::LevelGuard(Logging::GetConsole(), Log::ERROR); TEST_CHECK_THROWS(t1.WriteAttributes("testfiles/test1_nXX"), CommonException, OSFileError); TEST_CHECK_THROWS(t3.WriteAttributes("doesn't exist"), @@ -879,7 +879,7 @@ int test_bbackupd() context, 0 /* read-write */); { - Logging::Guard guard(Log::ERROR); + Logger::LevelGuard(Logging::GetConsole(), Log::ERROR); TEST_CHECK_THROWS(ReadDirectory(*client, 0x12345678), ConnectionException, Conn_Protocol_UnexpectedReply); @@ -1713,11 +1713,6 @@ int test_bbackupd() // in fork child TEST_THAT(setsid() != -1); - if (!Logging::IsEnabled(Log::TRACE)) - { - Logging::SetGlobalLevel(Log::NOTHING); - } - // BackupStoreDaemon must be destroyed before exit(), // to avoid memory leaks being reported. { @@ -1742,15 +1737,14 @@ int test_bbackupd() ::signal(SIGPIPE, SIG_IGN); { - Log::Level newLevel = Logging::GetGlobalLevel(); + Console& console(Logging::GetConsole()); + Logger::LevelGuard guard(console); - if (!Logging::IsEnabled(Log::TRACE)) + if (console.GetLevel() < Log::TRACE) { - newLevel = Log::NOTHING; + console.Filter(Log::NOTHING); } - Logging::Guard guard(newLevel); - BackupDaemon bbackupd; bbackupd.Configure("testfiles/bbackupd.conf"); bbackupd.InitCrypto(); @@ -3424,7 +3418,8 @@ int test_bbackupd() fflush(stdout); { - Logging::Guard guard(Log::FATAL); + Logger::LevelGuard(Logging::GetConsole(), + Log::FATAL); TEST_THAT(BackupClientRestore(*client, restoredirid, "Test1", "testfiles/no-such-path/subdir", |