[glib] Test resource filesystem attributes



commit 3498f29b81b522cf4697ff7384b7538f645a63d4
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Aug 21 00:08:57 2015 -0400

    Test resource filesystem attributes

 gio/tests/resources.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gio/tests/resources.c b/gio/tests/resources.c
index daa0e9d..4d2649d 100644
--- a/gio/tests/resources.c
+++ b/gio/tests/resources.c
@@ -449,6 +449,8 @@ test_uri_query_info (void)
   GFile *file;
   GFileInfo *info;
   const char *content_type, *mime_type;
+  const char *fs_type;
+  gboolean readonly;
 
   loaded_file = g_file_get_contents (g_test_get_filename (G_TEST_BUILT, "test.gresource", NULL),
                                      &content, &content_size, NULL);
@@ -475,6 +477,16 @@ test_uri_query_info (void)
 
   g_object_unref (info);
 
+  info = g_file_query_filesystem_info (file, "*", NULL, &error);
+  g_assert_no_error (error);
+
+  fs_type = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE);
+  g_assert_cmpstr (fs_type, ==, "resource");
+  readonly = g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_READONLY);
+  g_assert_true (readonly);
+
+  g_object_unref (info);
+
   g_assert_cmpuint  (g_file_hash (file), !=, 0);
 
   g_object_unref (file);


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