Re-checkin.

This commit is contained in:
Darin Adler 2001-08-03 19:27:35 +00:00
parent 669974f6d7
commit 44e7362702

View File

@ -24,7 +24,6 @@
* GLib at ftp://ftp.gtk.org/pub/gtk/. * GLib at ftp://ftp.gtk.org/pub/gtk/.
*/ */
#undef G_DISABLE_ASSERT
#undef G_LOG_DOMAIN #undef G_LOG_DOMAIN
#include <stdio.h> #include <stdio.h>
@ -48,12 +47,6 @@ else \
} G_STMT_END } G_STMT_END
#define GLIB_TEST_STRING "el dorado " #define GLIB_TEST_STRING "el dorado "
#define GLIB_TEST_STRING_5 "el do"
typedef struct {
guint age;
gchar name[40];
} GlibTestInfo;
static gboolean static gboolean
strv_check (gchar **strv, ...) strv_check (gchar **strv, ...)
@ -107,21 +100,21 @@ main (int argc,
TEST (NULL, g_ascii_strcasecmp ("B", "a") > 0); TEST (NULL, g_ascii_strcasecmp ("B", "a") > 0);
TEST (NULL, g_ascii_strcasecmp ("B", "A") > 0); TEST (NULL, g_ascii_strcasecmp ("B", "A") > 0);
g_assert(g_strdup(NULL) == NULL); TEST (NULL, g_strdup (NULL) == NULL);
string = g_strdup(GLIB_TEST_STRING); string = g_strdup (GLIB_TEST_STRING);
g_assert(string != NULL); TEST (NULL, string != NULL);
g_assert(strcmp(string, GLIB_TEST_STRING) == 0); TEST (NULL, strcmp (string, GLIB_TEST_STRING) == 0);
g_free(string); g_free(string);
string = g_strconcat(GLIB_TEST_STRING, NULL); string = g_strconcat (GLIB_TEST_STRING, NULL);
g_assert(string != NULL); TEST (NULL, string != NULL);
g_assert(strcmp(string, GLIB_TEST_STRING) == 0); TEST (NULL, strcmp (string, GLIB_TEST_STRING) == 0);
g_free(string); g_free(string);
string = g_strconcat(GLIB_TEST_STRING, GLIB_TEST_STRING, string = g_strconcat (GLIB_TEST_STRING, GLIB_TEST_STRING,
GLIB_TEST_STRING, NULL); GLIB_TEST_STRING, NULL);
g_assert(string != NULL); TEST (NULL, string != NULL);
g_assert(strcmp(string, GLIB_TEST_STRING GLIB_TEST_STRING TEST (NULL, strcmp (string, GLIB_TEST_STRING GLIB_TEST_STRING
GLIB_TEST_STRING) == 0); GLIB_TEST_STRING) == 0);
g_free(string); g_free(string);
@ -131,10 +124,9 @@ main (int argc,
g_free (string); g_free (string);
TEST (NULL, strcmp TEST (NULL, strcmp
(g_strcompress("abc\\\\\\\"\\b\\f\\n\\r\\t\\003\\177\\234\\313\\12345z"), (g_strcompress ("abc\\\\\\\"\\b\\f\\n\\r\\t\\003\\177\\234\\313\\12345z"),
"abc\\\"\b\f\n\r\t\003\177\234\313\12345z") == 0); "abc\\\"\b\f\n\r\t\003\177\234\313\12345z") == 0);
TEST (NULL, strcmp(g_strescape("abc\\\"\b\f\n\r\t\003\177\234\313", TEST (NULL, strcmp (g_strescape("abc\\\"\b\f\n\r\t\003\177\234\313", NULL),
NULL),
"abc\\\\\\\"\\b\\f\\n\\r\\t\\003\\177\\234\\313") == 0); "abc\\\\\\\"\\b\\f\\n\\r\\t\\003\\177\\234\\313") == 0);
TEST (NULL, strcmp(g_strescape("abc\\\"\b\f\n\r\t\003\177\234\313", TEST (NULL, strcmp(g_strescape("abc\\\"\b\f\n\r\t\003\177\234\313",
"\b\f\001\002\003\004"), "\b\f\001\002\003\004"),