[nautilus] test: dir-has-files: Clean up files
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] test: dir-has-files: Clean up files
- Date: Fri, 20 Jul 2018 11:03:18 +0000 (UTC)
commit 1be08bd3a051182ceb5288f808794601b542e94a
Author: Alexandru Fazakas <alex fazakas97 gmail com>
Date: Fri Jul 20 12:57:25 2018 +0300
test: dir-has-files: Clean up files
We should clean up files/directories after using them for testing.
This patch deletes all create files after using them for the dir-has-files
test.
test/automated/displayless/test-file-operations-dir-has-files.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/test/automated/displayless/test-file-operations-dir-has-files.c
b/test/automated/displayless/test-file-operations-dir-has-files.c
index 10bbaa663..f5a7f1dcc 100644
--- a/test/automated/displayless/test-file-operations-dir-has-files.c
+++ b/test/automated/displayless/test-file-operations-dir-has-files.c
@@ -19,6 +19,7 @@ test_simple_file (void)
file = g_file_get_child (root, "simple_file");
g_file_create (file, G_FILE_CREATE_NONE, NULL, NULL);
g_assert_false (dir_has_files (file));
+ g_assert_true (g_file_delete (file, NULL, NULL));
}
/* Tests the function for an empty directory */
@@ -36,6 +37,7 @@ test_empty_directory (void)
g_file_make_directory (child, NULL, NULL);
g_assert_false (dir_has_files (child));
+ g_assert_true (g_file_delete (child, NULL, NULL));
}
/* Tests the function for a directory containing one directory */
@@ -56,6 +58,8 @@ test_directory_one_file (void)
g_file_make_directory (child_file, NULL, NULL);
g_assert_true (dir_has_files (parent_dir));
+ g_assert_true (g_file_delete (child_file, NULL, NULL));
+ g_assert_true (g_file_delete (parent_dir, NULL, NULL));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]