Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-bluetooth-glib: Commit

external/bluetooth/glib


Commit MetaInfo

Révisionddd7f7475a3ddffa04bdbac1e34569660bb9a0f8 (tree)
l'heure2012-07-15 05:50:35
AuteurMatthias Clasen <mclasen@redh...>
CommiterMatthias Clasen

Message de Log

Fix contenttype tests

Change Summary

Modification

--- a/gio/tests/contenttype.c
+++ b/gio/tests/contenttype.c
@@ -1,4 +1,5 @@
11 #include <gio/gio.h>
2+#include <string.h>
23
34 static void
45 test_guess (void)
@@ -6,7 +7,7 @@ test_guess (void)
67 gchar *res;
78 gchar *expected;
89 gboolean uncertain;
9- guchar *data = (guchar*)
10+ guchar data[] =
1011 "[Desktop Entry]\n"
1112 "Type=Application\n"
1213 "Name=appinfo-test\n"
@@ -26,28 +27,28 @@ test_guess (void)
2627 g_free (res);
2728 g_free (expected);
2829
29- res = g_content_type_guess ("foo.desktop", data, -1, &uncertain);
30+ res = g_content_type_guess ("foo.desktop", data, sizeof (data) - 1, &uncertain);
3031 expected = g_content_type_from_mime_type ("application/x-desktop");
3132 g_assert (g_content_type_equals (expected, res));
3233 g_assert (!uncertain);
3334 g_free (res);
3435 g_free (expected);
3536
36- res = g_content_type_guess ("foo.txt", data, -1, &uncertain);
37+ res = g_content_type_guess ("foo.txt", data, sizeof (data) - 1, &uncertain);
3738 expected = g_content_type_from_mime_type ("text/plain");
3839 g_assert (g_content_type_equals (expected, res));
3940 g_assert (!uncertain);
4041 g_free (res);
4142 g_free (expected);
4243
43- res = g_content_type_guess ("foo", data, -1, &uncertain);
44+ res = g_content_type_guess ("foo", data, sizeof (data) - 1, &uncertain);
4445 expected = g_content_type_from_mime_type ("text/plain");
4546 g_assert (g_content_type_equals (expected, res));
4647 g_assert (!uncertain);
4748 g_free (res);
4849 g_free (expected);
4950
50- res = g_content_type_guess (NULL, data, -1, &uncertain);
51+ res = g_content_type_guess (NULL, data, sizeof (data) - 1, &uncertain);
5152 expected = g_content_type_from_mime_type ("application/x-desktop");
5253 g_assert (g_content_type_equals (expected, res));
5354 g_assert (!uncertain);
Afficher sur ancien navigateur de dépôt.