[tracker/wip/rishi/non-native: 5/8] tests: Add a test for caching non-native files



commit 8e743bf67cc2f0ddfad6e0b41755e6577972d603
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Jan 9 12:27:56 2018 +0100

    tests: Add a test for caching non-native files
    
    https://bugzilla.gnome.org/show_bug.cgi?id=792337

 tests/libtracker-miner/tracker-file-system-test.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/tests/libtracker-miner/tracker-file-system-test.c 
b/tests/libtracker-miner/tracker-file-system-test.c
index c7919a7..e00d075 100644
--- a/tests/libtracker-miner/tracker-file-system-test.c
+++ b/tests/libtracker-miner/tracker-file-system-test.c
@@ -231,6 +231,25 @@ test_file_system_properties (TestCommonContext *fixture,
        g_assert (ret_value == NULL);
 }
 
+static void
+test_file_system_non_native (TestCommonContext *fixture,
+                             gconstpointer      data)
+{
+       GFile *file, *parent, *child, *other;
+
+       file = g_file_new_for_uri ("foo:///aaa/");
+       parent = tracker_file_system_get_file (fixture->file_system, file,
+                                              G_FILE_TYPE_DIRECTORY, NULL);
+       g_object_unref (file);
+       g_assert (parent != NULL);
+
+       file = g_file_new_for_uri ("foo:///aaa/bbb");
+       child = tracker_file_system_get_file (fixture->file_system, file,
+                                             G_FILE_TYPE_DIRECTORY, parent);
+       g_object_unref (file);
+       g_assert (child != NULL);
+}
+
 gint
 main (gint    argc,
       gchar **argv)
@@ -249,6 +268,8 @@ main (gint    argc,
                  test_file_system_reparenting);
        test_add ("/libtracker-miner/file-system/file-properties",
                  test_file_system_properties);
+       test_add ("/libtracker-miner/file-system/non-native",
+                 test_file_system_non_native);
 
        return g_test_run ();
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]