[Box Backup-commit] COMMIT r1386 - box/chris/merge/test/bbackupd

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Sat, 10 Mar 2007 15:31:25 +0000


Author: chris
Date: 2007-03-10 15:31:25 +0000 (Sat, 10 Mar 2007)
New Revision: 1386

Modified:
   box/chris/merge/test/bbackupd/testbbackupd.cpp
Log:
Check for return code 3 (unreadable files) instead of return code 2
(refs #3, depends on [1378])


Modified: box/chris/merge/test/bbackupd/testbbackupd.cpp
===================================================================
--- box/chris/merge/test/bbackupd/testbbackupd.cpp	2007-03-10 15:20:22 UTC (rev 1385)
+++ box/chris/merge/test/bbackupd/testbbackupd.cpp	2007-03-10 15:31:25 UTC (rev 1386)
@@ -1131,14 +1131,23 @@
 				TEST_THAT(fd != -1);
 				::close(fd);
 			}
+
 			// Wait and test...
 			wait_for_backup_operation();
 			compareReturnValue = ::system("../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf -l testfiles/query3e.log \"compare -ac\" quit");
-			TEST_THAT(compareReturnValue == 2*256);	// should find differences
+
+			// Check that unreadable files were found
+			TEST_THAT(compareReturnValue == 3*256);	
+
+			// Check for memory leaks during compare
 			TestRemoteProcessMemLeaks("bbackupquery.memleaks");
+
 			// Check that it was reported correctly
 			TEST_THAT(TestFileExists("testfiles/notifyran.read-error.1"));
+
+			// Check that the error was only reorted once
 			TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.2"));
+
 			// Set permissions on file and dir to stop errors in the future
 			::chmod("testfiles/TestDir1/sub23/read-fail-test-dir", 0770);
 			::chmod("testfiles/TestDir1/read-fail-test-file", 0770);