[tracker: 1/2] file-utils-test: application/x-zerosize is a valid mime for an empty file



commit 939771b5f6c3b3cf3168a913f0f275e9e58ccc04
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Thu Aug 22 03:01:06 2019 +0200

    file-utils-test: application/x-zerosize is a valid mime for an empty file
    
    As per GLib commit 1c177ce0, empty files might have `application/x-zerosize` mime-type.
    
    So, accept both this one and "text/plain" as valid.

 tests/libtracker-common/tracker-file-utils-test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/tests/libtracker-common/tracker-file-utils-test.c 
b/tests/libtracker-common/tracker-file-utils-test.c
index 66f9739fa..a41bead43 100644
--- a/tests/libtracker-common/tracker-file-utils-test.c
+++ b/tests/libtracker-common/tracker-file-utils-test.c
@@ -235,7 +235,8 @@ test_file_get_mime_type (void)
 
         f = g_file_new_for_path (TEST_FILENAME);
         result = tracker_file_get_mime_type (f);
-        g_assert_cmpstr (result, ==, "text/plain");
+        g_assert_true (g_strcmp0 (result, "text/plain") == 0 ||
+                       g_strcmp0 (result, "application/x-zerosize") == 0);
 
         g_object_unref (f);
         g_free (result);


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