[glib/wjt/g-file-info-filesystem-readonly-fails: 3/5] tests/g-file-info-filesystem-readonly: remove output stream stuff



commit a2f32f6a11816cebccb6d9b1a361597dce0d6026
Author: Will Thompson <will willthompson co uk>
Date:   Mon Nov 12 14:52:54 2018 +0000

    tests/g-file-info-filesystem-readonly: remove output stream stuff
    
    This test is intended to verify the fix for
    https://bugzilla.gnome.org/show_bug.cgi?id=787731, which was that
    g_file_query_filesystem_info() would return stale information for the
    mount. After replacing a read-only mount with a read-write mount, this
    test used to only fail if G_FILE_ATTRIBUTE_FILESYSTEM_READONLY was TRUE
    and yet the file could be opened for writing. In particular, if (due to
    a test bug) the file really was still on a read-only filesystem, the
    test would pass.
    
    Now that we have fixed that bug in the test, we can make a stronger
    assertion.

 gio/tests/g-file-info-filesystem-readonly.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
---
diff --git a/gio/tests/g-file-info-filesystem-readonly.c b/gio/tests/g-file-info-filesystem-readonly.c
index a1a2ca546..a715ef8d0 100644
--- a/gio/tests/g-file-info-filesystem-readonly.c
+++ b/gio/tests/g-file-info-filesystem-readonly.c
@@ -151,19 +151,7 @@ test_filesystem_readonly (gconstpointer with_mount_monitor)
   g_assert_no_error (error);
   g_assert_nonnull (file_info);
 
-  if (g_file_info_get_attribute_boolean (file_info, G_FILE_ATTRIBUTE_FILESYSTEM_READONLY))
-    {
-      /* ¡¡ GIO still reports filesystem as being Readonly !!
-       * Let's check if that's true by trying to write to file */
-      GFileOutputStream *write_stream;
-      write_stream = g_file_append_to (mounted_file, G_FILE_CREATE_NONE, NULL, NULL);
-      if (write_stream != NULL)
-        {
-          /* The file has been opened for writing without error, so ¡¡ GIO IS WRONG !! */
-          g_object_unref (write_stream);
-          g_test_fail (); /* Marking test as FAILED */
-        }
-    }
+  g_assert_false (g_file_info_get_attribute_boolean (file_info, G_FILE_ATTRIBUTE_FILESYSTEM_READONLY));
 
   /* Clean up */
   g_clear_object (&mount_monitor);


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