[gimp] app: port all URI comparisons in test-save-and-export.c to g_file_equal()



commit 3617e4fde963878782e20ae15764db7360c43e0c
Author: Michael Natterer <mitch gimp org>
Date:   Wed Oct 9 21:35:23 2013 +0200

    app: port all URI comparisons in test-save-and-export.c to g_file_equal()
    
    so they keep succeeding when code gets ported to GFile/GIO which
    canonicalizes URIs.

 app/tests/test-save-and-export.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/app/tests/test-save-and-export.c b/app/tests/test-save-and-export.c
index 8533da5..60bbf14 100644
--- a/app/tests/test-save-and-export.c
+++ b/app/tests/test-save-and-export.c
@@ -124,7 +124,8 @@ opened_xcf_file_uris (gconstpointer data)
                            NULL /*mime_type*/,
                            NULL /*error*/);
 
-  g_assert_cmpstr (gimp_image_get_uri (image), ==, uri);
+  g_assert (g_file_equal (g_file_new_for_uri (gimp_image_get_uri (image)),
+                          g_file_new_for_uri (uri)));
   g_assert (gimp_image_get_imported_uri (image) == NULL);
   g_assert (gimp_image_get_exported_uri (image) == NULL);
 
@@ -165,7 +166,8 @@ imported_file_uris (gconstpointer data)
                            NULL /*error*/);
 
   g_assert (gimp_image_get_uri (image) == NULL);
-  g_assert_cmpstr (gimp_image_get_imported_uri (image), ==, uri);
+  g_assert (g_file_equal (g_file_new_for_uri (gimp_image_get_imported_uri (image)),
+                          g_file_new_for_uri (uri)));
   g_assert (gimp_image_get_exported_uri (image) == NULL);
 }
 
@@ -224,7 +226,8 @@ saved_imported_file_uris (gconstpointer data)
              NULL /*error*/);
 
   /* Assert */
-  g_assert_cmpstr (gimp_image_get_uri (image), ==, save_uri);
+  g_assert (g_file_equal (g_file_new_for_uri (gimp_image_get_uri (image)),
+                          g_file_new_for_uri (save_uri)));
   g_assert (gimp_image_get_imported_uri (image) == NULL);
   g_assert (gimp_image_get_exported_uri (image) == NULL);
 
@@ -266,7 +269,8 @@ exported_file_uris (gconstpointer data)
 
   g_assert (gimp_image_get_uri (image) == NULL);
   g_assert (gimp_image_get_imported_uri (image) == NULL);
-  g_assert_cmpstr (gimp_image_get_exported_uri (image), ==, save_uri);
+  g_assert (g_file_equal (g_file_new_for_uri (gimp_image_get_exported_uri (image)),
+                          g_file_new_for_uri (save_uri)));
 
   g_unlink (save_filename);
 }
@@ -309,7 +313,8 @@ clear_import_uri_after_export (gconstpointer data)
                            NULL /*error*/);
 
   g_assert (gimp_image_get_uri (image) == NULL);
-  g_assert_cmpstr (gimp_image_get_imported_uri (image), ==, uri);
+  g_assert (g_file_equal (g_file_new_for_uri (gimp_image_get_imported_uri (image)),
+                          g_file_new_for_uri (uri)));
   g_assert (gimp_image_get_exported_uri (image) == NULL);
 
   save_filename = g_build_filename (g_get_tmp_dir (), "gimp-test.png", NULL);
@@ -331,7 +336,8 @@ clear_import_uri_after_export (gconstpointer data)
 
   g_assert (gimp_image_get_uri (image) == NULL);
   g_assert (gimp_image_get_imported_uri (image) == NULL);
-  g_assert_cmpstr (gimp_image_get_exported_uri (image), ==, save_uri);
+  g_assert (g_file_equal (g_file_new_for_uri (gimp_image_get_exported_uri (image)),
+                          g_file_new_for_uri (save_uri)));
 
   g_unlink (save_filename);
 }


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