[totem-pl-parser/wip/hadess/more-encoding: 6/6] tests: Fix invalid UTF-8 RSS test




commit 31628f42baa54272517d1fe76b93da01eb5bf563
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Mar 4 15:47:26 2021 +0100

    tests: Fix invalid UTF-8 RSS test
    
    The test expected us to pass invalid UTF-8 through, and just feed it to
    the calling application.
    
    GLib APIs actually guarantee that data passed is UTF-8 unless stated
    otherwise, so make sure that no data is parsed if the data isn't UTF-8
    and we can't detect what encoding it's in.

 plparse/tests/parser.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/plparse/tests/parser.c b/plparse/tests/parser.c
index dabe7f2..47e21b0 100644
--- a/plparse/tests/parser.c
+++ b/plparse/tests/parser.c
@@ -1011,7 +1011,11 @@ test_invalid_utf8_characters (void)
 
        /* Test all entries have been parsed by checking entry count */
        uri = get_relative_uri (TEST_SRCDIR "invalid-utf8-characters.rss");
+#ifdef HAVE_UCHARDET
        g_assert_cmpuint (parser_test_get_num_entries (uri), ==, 4);
+#else
+       g_assert_cmpuint (parser_test_get_num_entries (uri), ==, 0);
+#endif
        g_free (uri);
 }
 


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