X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=eglib%2Ftest%2Fstring.c;h=2fffcbc32084b86e4ca45db5de644b32b8cbc8cb;hb=ccbe77fd9cb16624aead0f2c54690e9eb466c3ae;hp=73fb86488eed65296dd0c19f6d921d044e9965b5;hpb=0443306d611d0830e27327e1f0a3ef3457dfa535;p=mono.git diff --git a/eglib/test/string.c b/eglib/test/string.c index 73fb86488ee..2fffcbc3208 100644 --- a/eglib/test/string.c +++ b/eglib/test/string.c @@ -201,14 +201,36 @@ test_appendlen () return NULL; } +RESULT +test_macros () +{ + char *s = g_strdup (G_STRLOC); + char *p = strchr (s, ':'); + 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, "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} };