Commit b73713d8 authored by Philip Withnall's avatar Philip Withnall

tests: Add a test for g_content_type_guess() with no arguments

It should produce a generic result, but not crash. It was previously
crashing on macOS.
Signed-off-by: Philip Withnall's avatarPhilip Withnall <>

Fixes: #1729
parent 4a0cb8f3
......@@ -118,6 +118,14 @@ test_guess (void)
g_assert_false (uncertain);
g_free (res);
g_free (expected);
/* The data below would be detected as a valid content type, but shouldn’t be read at all. */
res = g_content_type_guess (NULL, (guchar *)"%!PS-Adobe-2.0 EPSF-1.2", 0, &uncertain);
expected = g_content_type_from_mime_type ("application/x-zerosize");
g_assert_content_type_equals (expected, res);
g_assert_false (uncertain);
g_free (res);
g_free (expected);
static void
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment