Bump ikdasm.
[mono.git] / eglib / test / string.c
index 73fb86488eed65296dd0c19f6d921d044e9965b5..02ad0ad3ea3691108c9be515c4d80c84ba89e81d 100644 (file)
@@ -95,8 +95,8 @@ test_gstring ()
        ret = g_string_free (s, FALSE);
        g_free (ret);
 
-       s = g_string_new_len ("H\000H", 3);
-       g_string_append_len (s, "1\0002", 3);
+       s = g_string_new_len ("H" "\000" "H", 3);
+       g_string_append_len (s, "1" "\000" "2", 3);
        sfail ('H', 0);
        sfail ( 0, 1);
        sfail ('H', 2);
@@ -137,7 +137,7 @@ test_truncate ()
        s = g_string_truncate (s, 10);
        if (strlen (s->str) != 1)
                return FAILED ("The size is not 1");
-       g_string_truncate (s, -1);
+       g_string_truncate (s, (gsize)-1);
        if (strlen (s->str) != 1)
                return FAILED ("The size is not 1");
        g_string_truncate (s, 0);
@@ -201,14 +201,36 @@ test_appendlen ()
        return NULL;
 }
 
+RESULT
+test_macros ()
+{
+       char *s = g_strdup (G_STRLOC);
+       char *p = strchr (s + 2, ':');
+       int n;
+       
+       if (p == NULL)
+               return FAILED ("Did not find a separator");
+       n = atoi (p+1);
+       if (n <= 0)
+               return FAILED ("did not find a valid line number");
+
+       *p = 0;
+       if (strcmp (s + strlen(s) - 8 , "string.c") != 0)
+               return FAILED ("This did not store the filename on G_STRLOC");
+       
+       g_free (s);
+       return NULL;
+}
+
 static Test string_tests [] = {
        {"append-speed", test_append_speed},
-    {"append_c-speed", test_append_c_speed},
+       {"append_c-speed", test_append_c_speed},
        {"ctor+append", test_gstring },
        {"ctor+sized", test_sized },
        {"truncate", test_truncate },
        {"prepend", test_prepend },
        {"append_len", test_appendlen },
+       {"macros", test_macros },
        {NULL, NULL}
 };