mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-25 09:00:03 +01:00
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 <withnall@endlessm.com> Fixes: #1729
This commit is contained in:
parent
4a0cb8f3a1
commit
b73713d893
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user