diff options
Diffstat (limited to 'test/backupstore')
-rwxr-xr-x | test/backupstore/testbackupstore.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/test/backupstore/testbackupstore.cpp b/test/backupstore/testbackupstore.cpp index 3757bc60..1d297f16 100755 --- a/test/backupstore/testbackupstore.cpp +++ b/test/backupstore/testbackupstore.cpp @@ -584,9 +584,9 @@ typedef struct int objectsNotDel; int deleted; int old; -} recusive_count_objects_results; +} recursive_count_objects_results; -void recusive_count_objects_r(BackupProtocolClient &protocol, int64_t id, recusive_count_objects_results &results) +void recursive_count_objects_r(BackupProtocolClient &protocol, int64_t id, recursive_count_objects_results &results) { // Command std::auto_ptr<BackupProtocolClientSuccess> dirreply(protocol.QueryListDirectory( @@ -611,12 +611,12 @@ void recusive_count_objects_r(BackupProtocolClient &protocol, int64_t id, recusi if(en->GetFlags() & BackupStoreDirectory::Entry::Flags_Dir) { - recusive_count_objects_r(protocol, en->GetObjectID(), results); + recursive_count_objects_r(protocol, en->GetObjectID(), results); } } } -void recusive_count_objects(const char *hostname, int64_t id, recusive_count_objects_results &results) +void recursive_count_objects(const char *hostname, int64_t id, recursive_count_objects_results &results) { // Context TLSContext context; @@ -637,7 +637,7 @@ void recusive_count_objects(const char *hostname, int64_t id, recusive_count_obj } // Count objects - recusive_count_objects_r(protocolReadOnly, id, results); + recursive_count_objects_r(protocolReadOnly, id, results); // Close it protocolReadOnly.QueryFinished(); @@ -1706,9 +1706,9 @@ int test3(int argc, const char *argv[]) // Test the deletion of objects by the housekeeping system // First, things as they are now. - recusive_count_objects_results before = {0,0,0}; + recursive_count_objects_results before = {0,0,0}; - recusive_count_objects("localhost", BackupProtocolClientListDirectory::RootDirectory, before); + recursive_count_objects("localhost", BackupProtocolClientListDirectory::RootDirectory, before); TEST_THAT(before.objectsNotDel != 0); TEST_THAT(before.deleted != 0); @@ -1732,7 +1732,7 @@ int test3(int argc, const char *argv[]) // wait for housekeeping to happen printf("waiting for housekeeping:\n"); - for(int l = 0; l < 12; ++l) + for(int l = 0; l < 30; ++l) { ::sleep(1); printf("."); @@ -1741,9 +1741,11 @@ int test3(int argc, const char *argv[]) printf("\n"); // Count the objects again - recusive_count_objects_results after = {0,0,0}; - recusive_count_objects("localhost", BackupProtocolClientListDirectory::RootDirectory, after); - + recursive_count_objects_results after = {0,0,0}; + recursive_count_objects("localhost", BackupProtocolClientListDirectory::RootDirectory, after); +printf("after.objectsNotDel=%i, deleted=%i, old=%i\n",after.objectsNotDel, after.deleted, after.old); + + // If these tests fail then try increasing the timeout above TEST_THAT(after.objectsNotDel == before.objectsNotDel); TEST_THAT(after.deleted == 0); TEST_THAT(after.old == 0); |