2006-08-18 Aaron Bockover <abockover@novell.com>
[mono.git] / eglib / test / string.c
index 6ab873c7a687df6526d8e498856d0cfe7549fefd..802400d236c8ccc0f65f2e2f8ca6fed2791035c9 100644 (file)
@@ -3,9 +3,9 @@
 #include <stdio.h>
 #include "test.h"
 
-#define sfail(k,p) if (s->str [p] != k) { g_string_free (s,TRUE); return result ("Got %s, Failed at %d, expected '%c'", s->str, p, k);}
+#define sfail(k,p) if (s->str [p] != k) { g_string_free (s,TRUE); return FAILED("Got %s, Failed at %d, expected '%c'", s->str, p, k);}
 
-char *
+RESULT
 test_gstring ()
 {
        GString *s = g_string_new_len ("My stuff", 2);
@@ -27,7 +27,7 @@ test_gstring ()
        if (s->str [2] != 0)
                return "Null as not copied";
        if (strncmp (s->str+4, "Relala", 6) != 0){
-               return result("Did not copy correctly, got: %s", s->str+4);
+               return FAILED("Did not copy correctly, got: %s", s->str+4);
        }
 
        g_string_free (s, TRUE);
@@ -36,7 +36,7 @@ test_gstring ()
                g_string_append (s, "x");
        }
        if (strlen (s->str) != 1024){
-               return result("Incorrect string size, got: %s %d", s->str, strlen (s->str));
+               return FAILED("Incorrect string size, got: %s %d", s->str, strlen (s->str));
        }
        g_string_free (s, TRUE);
 
@@ -45,14 +45,14 @@ test_gstring ()
                g_string_append_c (s, 'x');
        }
        if (strlen (s->str) != 1024){
-               return result("Incorrect string size, got: %s %d\n", s->str, strlen (s->str));
+               return FAILED("Incorrect string size, got: %s %d\n", s->str, strlen (s->str));
        }
        g_string_free (s, TRUE);
 
        s = g_string_new ("hola");
        g_string_sprintfa (s, "%s%d", ", bola", 5);
        if (strcmp (s->str, "hola, bola5") != 0){
-               return result("Incorrect data, got: %s\n", s->str);
+               return FAILED("Incorrect data, got: %s\n", s->str);
        }
        g_string_free (s, TRUE);
 
@@ -73,7 +73,7 @@ test_gstring ()
        sfail ('2', 5);
        g_string_free (s, TRUE);
        
-       return NULL;
+       return OK;
 }
 
 static Test string_tests [] = {