tests: Update tests for ostree_repo_get_min_free_space_bytes()
authorUmang Jain <umang@endlessm.com>
Fri, 14 Sep 2018 14:52:37 +0000 (20:22 +0530)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 21 Sep 2018 15:09:12 +0000 (15:09 +0000)
https://github.com/ostreedev/ostree/issues/1720

Closes: #1722
Approved by: pwithnall

tests/test-repo.c

index c56f60c5eee08c3aa985bcf8fe14f6a906e78bb5..9857228e1f4d47010b6ce58388609943fdcc8b71 100644 (file)
@@ -157,6 +157,7 @@ test_repo_get_min_free_space (Fixture *fixture,
 {
   g_autoptr (GKeyFile) config = NULL;
   g_autoptr(GError) error = NULL;
+  guint64 bytes = 0;
   typedef struct
     {
       const char *val;
@@ -188,17 +189,11 @@ test_repo_get_min_free_space (Fixture *fixture,
       ostree_repo_reload_config (repo, NULL, &error);
       g_assert_no_error (error);
 
-      ostree_repo_prepare_transaction (repo, FALSE, NULL, &error);
+      ostree_repo_get_min_free_space_bytes (repo, &bytes, &error);
       if (values_to_test[i].should_succeed)
         g_assert_no_error (error);
       else
         continue;
-
-      ostree_repo_get_min_free_space_bytes (repo);
-      g_assert_no_error (error);
-
-      ostree_repo_commit_transaction (repo, NULL, NULL, &error);
-      g_assert_no_error (error);
     }
 }