+ g_assert (!uncertain);
+ g_free (res);
+ g_free (expected);
+
+ res = g_content_type_guess ("foo.desktop", data, sizeof (data) - 1, &uncertain);
+ expected = g_content_type_from_mime_type ("application/x-desktop");
+ g_assert (g_content_type_equals (expected, res));
+ g_assert (!uncertain);
+ g_free (res);
+ g_free (expected);
+
+ res = g_content_type_guess ("foo.txt", data, sizeof (data) - 1, &uncertain);
+ expected = g_content_type_from_mime_type ("text/plain");
+ g_assert (g_content_type_equals (expected, res));
+ g_assert (!uncertain);
+ g_free (res);
+ g_free (expected);
+
+ res = g_content_type_guess ("foo", data, sizeof (data) - 1, &uncertain);
+ expected = g_content_type_from_mime_type ("text/plain");
+ g_assert (g_content_type_equals (expected, res));
+ g_assert (!uncertain);
+ g_free (res);
+ g_free (expected);
+
+ res = g_content_type_guess (NULL, data, sizeof (data) - 1, &uncertain);
+ expected = g_content_type_from_mime_type ("application/x-desktop");
+ g_assert (g_content_type_equals (expected, res));
+ g_assert (!uncertain);
+ g_free (res);
+ g_free (expected);
+
+ res = g_content_type_guess ("test.pot", (guchar *)"ABC abc", -1, &uncertain);
+ expected = g_content_type_from_mime_type ("application/vnd.ms-powerpoint");
+ g_assert (g_content_type_equals (expected, res));
+ g_assert (uncertain);
+ g_free (res);
+ g_free (expected);
+
+ res = g_content_type_guess ("test.otf", (guchar *)"OTTO", -1, &uncertain);
+ expected = g_content_type_from_mime_type ("application/x-font-otf");
+ g_assert (g_content_type_equals (expected, res));
+ g_assert (!uncertain);