[glib/glib-2-58] Revert "test_internal_enhanced_stdio: don't use g_assert()"



commit 6df107874e6e01bc7199bde1142b62b810c0a859
Author: Philip Withnall <withnall endlessm com>
Date:   Tue Dec 18 14:23:52 2018 +0000

    Revert "test_internal_enhanced_stdio: don't use g_assert()"
    
    This reverts commit 6e75d3cf17140956d78b41dff2e3dac81634239e.
    
    It depends on new API added in commit a2375b8929, which should not have
    been merged to the stable branch. This commit will remain in place on
    master (which will become GLib 2.60).

 gio/tests/g-file-info.c | 76 ++++++++++++++++++++++++-------------------------
 1 file changed, 38 insertions(+), 38 deletions(-)
---
diff --git a/gio/tests/g-file-info.c b/gio/tests/g-file-info.c
index 28a2426a8..96732e39f 100644
--- a/gio/tests/g-file-info.c
+++ b/gio/tests/g-file-info.c
@@ -265,36 +265,36 @@ test_internal_enhanced_stdio (void)
                                                 G_FILE_QUERY_INFO_NONE,
                                                 NULL, NULL);
 
-      g_assert_true (g_file_info_has_attribute (fi_programdata, G_FILE_ATTRIBUTE_ID_FILE));
-      g_assert_true (g_file_info_has_attribute (fi_programdata, G_FILE_ATTRIBUTE_STANDARD_TYPE));
-
-      g_assert_true (g_file_info_has_attribute (fi_allusers_target, G_FILE_ATTRIBUTE_ID_FILE));
-      g_assert_true (g_file_info_has_attribute (fi_allusers_target, G_FILE_ATTRIBUTE_STANDARD_TYPE));
-      g_assert_true (g_file_info_has_attribute (fi_commondata_target, G_FILE_ATTRIBUTE_ID_FILE));
-      g_assert_true (g_file_info_has_attribute (fi_commondata_target, G_FILE_ATTRIBUTE_STANDARD_TYPE));
-
-      g_assert_true (g_file_info_has_attribute (fi_allusers, G_FILE_ATTRIBUTE_ID_FILE));
-      g_assert_true (g_file_info_has_attribute (fi_allusers, G_FILE_ATTRIBUTE_STANDARD_TYPE));
-      g_assert_true (g_file_info_has_attribute (fi_allusers, G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK));
-      g_assert_true (g_file_info_has_attribute (fi_allusers, G_FILE_ATTRIBUTE_DOS_REPARSE_POINT_TAG));
-      g_assert_true (g_file_info_has_attribute (fi_allusers, G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET));
-
-      g_assert_true (g_file_info_has_attribute (fi_commondata, G_FILE_ATTRIBUTE_ID_FILE));
-      g_assert_true (g_file_info_has_attribute (fi_commondata, G_FILE_ATTRIBUTE_STANDARD_TYPE));
-      g_assert_true (g_file_info_has_attribute (fi_commondata, G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK));
-      g_assert_true (g_file_info_has_attribute (fi_commondata, G_FILE_ATTRIBUTE_DOS_IS_MOUNTPOINT));
-      g_assert_true (g_file_info_has_attribute (fi_commondata, G_FILE_ATTRIBUTE_DOS_REPARSE_POINT_TAG));
-      g_assert_true (g_file_info_has_attribute (fi_commondata, G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET));
+      g_assert (g_file_info_has_attribute (fi_programdata, G_FILE_ATTRIBUTE_ID_FILE));
+      g_assert (g_file_info_has_attribute (fi_programdata, G_FILE_ATTRIBUTE_STANDARD_TYPE));
+
+      g_assert (g_file_info_has_attribute (fi_allusers_target, G_FILE_ATTRIBUTE_ID_FILE));
+      g_assert (g_file_info_has_attribute (fi_allusers_target, G_FILE_ATTRIBUTE_STANDARD_TYPE));
+      g_assert (g_file_info_has_attribute (fi_commondata_target, G_FILE_ATTRIBUTE_ID_FILE));
+      g_assert (g_file_info_has_attribute (fi_commondata_target, G_FILE_ATTRIBUTE_STANDARD_TYPE));
+
+      g_assert (g_file_info_has_attribute (fi_allusers, G_FILE_ATTRIBUTE_ID_FILE));
+      g_assert (g_file_info_has_attribute (fi_allusers, G_FILE_ATTRIBUTE_STANDARD_TYPE));
+      g_assert (g_file_info_has_attribute (fi_allusers, G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK));
+      g_assert (g_file_info_has_attribute (fi_allusers, G_FILE_ATTRIBUTE_DOS_REPARSE_POINT_TAG));
+      g_assert (g_file_info_has_attribute (fi_allusers, G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET));
+
+      g_assert (g_file_info_has_attribute (fi_commondata, G_FILE_ATTRIBUTE_ID_FILE));
+      g_assert (g_file_info_has_attribute (fi_commondata, G_FILE_ATTRIBUTE_STANDARD_TYPE));
+      g_assert (g_file_info_has_attribute (fi_commondata, G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK));
+      g_assert (g_file_info_has_attribute (fi_commondata, G_FILE_ATTRIBUTE_DOS_IS_MOUNTPOINT));
+      g_assert (g_file_info_has_attribute (fi_commondata, G_FILE_ATTRIBUTE_DOS_REPARSE_POINT_TAG));
+      g_assert (g_file_info_has_attribute (fi_commondata, G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET));
 
       ft_allusers = g_file_info_get_file_type (fi_allusers);
       ft_allusers_target = g_file_info_get_file_type (fi_allusers_target);
       ft_programdata = g_file_info_get_file_type (fi_programdata);
       ft_commondata = g_file_info_get_file_type (fi_commondata);
 
-      g_assert_cmpint (ft_allusers, ==, G_FILE_TYPE_SYMBOLIC_LINK);
-      g_assert_cmpint (ft_allusers_target, ==, G_FILE_TYPE_DIRECTORY);
-      g_assert_cmpint (ft_programdata, ==, G_FILE_TYPE_DIRECTORY);
-      g_assert_cmpint (ft_commondata, ==, G_FILE_TYPE_SYMBOLIC_LINK);
+      g_assert (ft_allusers == G_FILE_TYPE_SYMBOLIC_LINK);
+      g_assert (ft_allusers_target == G_FILE_TYPE_DIRECTORY);
+      g_assert (ft_programdata == G_FILE_TYPE_DIRECTORY);
+      g_assert (ft_commondata == G_FILE_TYPE_SYMBOLIC_LINK);
 
       allusers_is_symlink = g_file_info_get_attribute_boolean (fi_allusers, 
G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK);
       allusers_reparse_tag = g_file_info_get_attribute_uint32 (fi_allusers, 
G_FILE_ATTRIBUTE_DOS_REPARSE_POINT_TAG);
@@ -386,7 +386,7 @@ test_internal_enhanced_stdio (void)
       g_assert_nonnull (f);
 
       h = (HANDLE) _get_osfhandle (fileno (f));
-      g_assert_cmpuint ((guintptr) h, !=, (guintptr) INVALID_HANDLE_VALUE);
+      g_assert (h != INVALID_HANDLE_VALUE);
 
       ssb.SetSparse = TRUE;
       g_assert_true (DeviceIoControl (h,
@@ -425,8 +425,8 @@ test_internal_enhanced_stdio (void)
 
       g_remove (ps);
 
-      g_assert_true (g_file_info_has_attribute (fi_ps, G_FILE_ATTRIBUTE_STANDARD_SIZE));
-      g_assert_true (g_file_info_has_attribute (fi_ps, G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE));
+      g_assert (g_file_info_has_attribute (fi_ps, G_FILE_ATTRIBUTE_STANDARD_SIZE));
+      g_assert (g_file_info_has_attribute (fi_ps, G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE));
 
       size_ps = g_file_info_get_attribute_uint64 (fi_ps, G_FILE_ATTRIBUTE_STANDARD_SIZE);
       alsize_ps = g_file_info_get_attribute_uint64 (fi_ps, G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE);
@@ -465,7 +465,7 @@ test_internal_enhanced_stdio (void)
   g_assert_nonnull (f);
 
   h = (HANDLE) _get_osfhandle (fileno (f));
-  g_assert_cmpuint ((guintptr) h, !=, (guintptr) INVALID_HANDLE_VALUE);
+  g_assert (h != INVALID_HANDLE_VALUE);
 
   fprintf (f, "1");
   fflush (f);
@@ -504,15 +504,15 @@ test_internal_enhanced_stdio (void)
                              G_FILE_QUERY_INFO_NONE,
                              NULL, NULL);
 
-  g_assert_true (g_file_info_has_attribute (fi_p0, G_FILE_ATTRIBUTE_STANDARD_SIZE));
-  g_assert_true (g_file_info_has_attribute (fi_p0, G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE));
-  g_assert_true (g_file_info_has_attribute (fi_p0, G_FILE_ATTRIBUTE_ID_FILE));
-  g_assert_true (g_file_info_has_attribute (fi_p0, G_FILE_ATTRIBUTE_TIME_MODIFIED));
+  g_assert (g_file_info_has_attribute (fi_p0, G_FILE_ATTRIBUTE_STANDARD_SIZE));
+  g_assert (g_file_info_has_attribute (fi_p0, G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE));
+  g_assert (g_file_info_has_attribute (fi_p0, G_FILE_ATTRIBUTE_ID_FILE));
+  g_assert (g_file_info_has_attribute (fi_p0, G_FILE_ATTRIBUTE_TIME_MODIFIED));
 
-  g_assert_true (g_file_info_has_attribute (fi_p1, G_FILE_ATTRIBUTE_STANDARD_SIZE));
-  g_assert_true (g_file_info_has_attribute (fi_p1, G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE));
-  g_assert_true (g_file_info_has_attribute (fi_p1, G_FILE_ATTRIBUTE_ID_FILE));
-  g_assert_true (g_file_info_has_attribute (fi_p1, G_FILE_ATTRIBUTE_TIME_MODIFIED));
+  g_assert (g_file_info_has_attribute (fi_p1, G_FILE_ATTRIBUTE_STANDARD_SIZE));
+  g_assert (g_file_info_has_attribute (fi_p1, G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE));
+  g_assert (g_file_info_has_attribute (fi_p1, G_FILE_ATTRIBUTE_ID_FILE));
+  g_assert (g_file_info_has_attribute (fi_p1, G_FILE_ATTRIBUTE_TIME_MODIFIED));
 
   size_p0 = g_file_info_get_attribute_uint64 (fi_p0, G_FILE_ATTRIBUTE_STANDARD_SIZE);
   alsize_p0 = g_file_info_get_attribute_uint64 (fi_p0, G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE);
@@ -530,7 +530,7 @@ test_internal_enhanced_stdio (void)
   /* st_ino from W32 stat() is useless for file identification.
    * It will be either 0, or it will be the same for both files.
    */
-  g_assert_cmpint (statbuf_p0.st_ino, ==, statbuf_p1.st_ino);
+  g_assert (statbuf_p0.st_ino == statbuf_p1.st_ino);
   g_assert_cmpstr (id_p0, !=, id_p1);
 
   time_p0 = g_file_info_get_attribute_uint64 (fi_p0, G_FILE_ATTRIBUTE_TIME_MODIFIED);
@@ -542,7 +542,7 @@ test_internal_enhanced_stdio (void)
    *  and 64-bit on 64-bit Windows, usually),
    * so it *can* pass this test in some cases.
    */
-  g_assert_cmpuint (time_p0, >, G_GUINT64_CONSTANT (0xFFFFFFFF));
+  g_assert (time_p0 > G_GUINT64_CONSTANT (0xFFFFFFFF));
 
   g_object_unref (fi_p0);
   g_object_unref (fi_p1);


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