summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2021-03-04 15:47:26 +0100
committerBastien Nocera <hadess@hadess.net>2021-03-04 17:37:49 +0100
commit988ab5073a692e70f4d80f69f6e150d42fa44aa1 (patch)
tree106ab205ccba339e2e8ab3bb1e207eec4fbfeff9
parent0f99bf8bc71b33c283c0559e22d8a198d5691089 (diff)
downloadtotem-pl-parser-988ab5073a692e70f4d80f69f6e150d42fa44aa1.tar.gz
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.
-rw-r--r--plparse/tests/parser.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/plparse/tests/parser.c b/plparse/tests/parser.c
index dabe7f2..05b6928 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_cmpint (simple_parser_test (uri), !=, TOTEM_PL_PARSER_RESULT_SUCCESS);
+#endif
g_free (uri);
}