|
|
@@ -82,9 +82,9 @@ test_sized ()
|
|
|
GString *s = g_string_sized_new (20);
|
|
|
|
|
|
if (s->str [0] != 0)
|
|
|
- return result ("Expected an empty string");
|
|
|
+ return FAILED ("Expected an empty string");
|
|
|
if (s->len != 0)
|
|
|
- return result ("Expected an empty len");
|
|
|
+ return FAILED ("Expected an empty len");
|
|
|
|
|
|
g_string_free (s, TRUE);
|
|
|
|
|
|
@@ -98,19 +98,19 @@ test_truncate ()
|
|
|
g_string_truncate (s, 3);
|
|
|
|
|
|
if (strlen (s->str) != 3)
|
|
|
- return result ("size of string should have been 3, instead it is [%s]\n", s->str);
|
|
|
+ return FAILED ("size of string should have been 3, instead it is [%s]\n", s->str);
|
|
|
g_string_free (s, TRUE);
|
|
|
|
|
|
s = g_string_new ("a");
|
|
|
s = g_string_truncate (s, 10);
|
|
|
if (strlen (s->str) != 1)
|
|
|
- return result ("The size is not 1");
|
|
|
+ return FAILED ("The size is not 1");
|
|
|
g_string_truncate (s, -1);
|
|
|
if (strlen (s->str) != 1)
|
|
|
- return result ("The size is not 1");
|
|
|
+ return FAILED ("The size is not 1");
|
|
|
g_string_truncate (s, 0);
|
|
|
if (strlen (s->str) != 0)
|
|
|
- return result ("The size is not 0");
|
|
|
+ return FAILED ("The size is not 0");
|
|
|
|
|
|
g_string_free (s, TRUE);
|
|
|
|
|
|
@@ -124,7 +124,7 @@ test_prepend ()
|
|
|
g_string_prepend (s, "one");
|
|
|
|
|
|
if (strcmp (s->str, "onedingus") != 0)
|
|
|
- return result ("Failed, expected onedingus, got [%s]", s->str);
|
|
|
+ return FAILED ("Failed, expected onedingus, got [%s]", s->str);
|
|
|
|
|
|
g_string_free (s, TRUE);
|
|
|
|
|
|
@@ -132,18 +132,18 @@ test_prepend ()
|
|
|
s = g_string_sized_new (1);
|
|
|
g_string_prepend (s, "one");
|
|
|
if (strcmp (s->str, "one") != 0)
|
|
|
- return result ("Got erroneous result, expected [one] got [%s]", s->str);
|
|
|
+ return FAILED ("Got erroneous result, expected [one] got [%s]", s->str);
|
|
|
g_string_free (s, TRUE);
|
|
|
|
|
|
/* This is to force the path where things fit */
|
|
|
s = g_string_new ("123123123123123123123123");
|
|
|
g_string_truncate (s, 1);
|
|
|
if (strcmp (s->str, "1") != 0)
|
|
|
- return result ("Expected [1] string, got [%s]", s->str);
|
|
|
+ return FAILED ("Expected [1] string, got [%s]", s->str);
|
|
|
|
|
|
g_string_prepend (s, "pre");
|
|
|
if (strcmp (s->str, "pre1") != 0)
|
|
|
- return result ("Expected [pre1], got [%s]", s->str);
|
|
|
+ return FAILED ("Expected [pre1], got [%s]", s->str);
|
|
|
g_string_free (s, TRUE);
|
|
|
|
|
|
return NULL;
|
|
|
@@ -156,13 +156,13 @@ test_appendlen ()
|
|
|
|
|
|
g_string_append_len (s, "boo\000x", 0);
|
|
|
if (s->len != 0)
|
|
|
- return result ("The length is not zero %d", s->len);
|
|
|
+ return FAILED ("The length is not zero %d", s->len);
|
|
|
g_string_append_len (s, "boo\000x", 5);
|
|
|
if (s->len != 5)
|
|
|
- return result ("The length is not five %d", s->len);
|
|
|
+ return FAILED ("The length is not five %d", s->len);
|
|
|
g_string_append_len (s, "ha", -1);
|
|
|
if (s->len != 7)
|
|
|
- return result ("The length is not seven %d", s->len);
|
|
|
+ return FAILED ("The length is not seven %d", s->len);
|
|
|
|
|
|
g_string_free (s, FALSE);
|
|
|
|