From 6e47268c14ef1285fb8c9f4d2d3748c2bd84335f Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 29 Jun 2000 20:09:36 +0000 Subject: [PATCH] updated Thu Jun 29 15:57:28 2000 Owen Taylor * NEWS: updated * Makefile.am: added snapcheck target to go along with snapshot * gstring.c glib.h (g_string_hash): Add g_string_hash to go along with g_string_equal. Tue Jun 27 12:40:23 EDT 2000 David A. Wheeler * glib.h: Added g_string_equal for comparing GStrings; changed g_str_equal so it returns gboolean (instead of gint). * gstring.c: Modified GString implementation to support embedded ASCII NUL ('\0') characters, and implemented g_string_equal. * testglib.c tests/string-test.c: Added tests for g_string_equal and tests for proper handling of embedded ASCII NUL characters. --- ChangeLog | 21 +++++++++++++++++- ChangeLog.pre-2-0 | 21 +++++++++++++++++- ChangeLog.pre-2-10 | 21 +++++++++++++++++- ChangeLog.pre-2-12 | 21 +++++++++++++++++- ChangeLog.pre-2-2 | 21 +++++++++++++++++- ChangeLog.pre-2-4 | 21 +++++++++++++++++- ChangeLog.pre-2-6 | 21 +++++++++++++++++- ChangeLog.pre-2-8 | 21 +++++++++++++++++- Makefile.am | 5 ++++- NEWS | 8 ++++++- glib.h | 15 ++++++++----- glib/Makefile.am | 5 ++++- glib/glib.h | 15 ++++++++----- glib/gstring.c | 54 +++++++++++++++++++++++++++++++++++++++++---- gstring.c | 54 +++++++++++++++++++++++++++++++++++++++++---- testglib.c | 31 +++++++++++++++++++++++++- tests/string-test.c | 29 ++++++++++++++++++++++++ tests/testglib.c | 31 +++++++++++++++++++++++++- 18 files changed, 382 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index b7b9033e5..63496073f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +Thu Jun 29 15:57:28 2000 Owen Taylor + + * NEWS: updated + + * Makefile.am: added snapcheck target to go along with snapshot + + * gstring.c glib.h (g_string_hash): Add g_string_hash to + go along with g_string_equal. + +Tue Jun 27 12:40:23 EDT 2000 David A. Wheeler + + * glib.h: Added g_string_equal for comparing GStrings; + changed g_str_equal so it returns gboolean (instead of gint). + + * gstring.c: Modified GString implementation to support embedded + ASCII NUL ('\0') characters, and implemented g_string_equal. + + * testglib.c tests/string-test.c: Added tests for g_string_equal + and tests for proper handling of embedded ASCII NUL characters. + Wed Jun 28 22:52:00 2000 Owen Taylor * Makefile.am (libglib_la_SOURCES): Fix @@ -52,7 +72,6 @@ Mon May 29 14:10:35 2000 Owen Taylor Fri May 19 11:39:29 2000 Tim Janik - * gutils.c (g_snprintf): (g_vsnprintf): added argument assertments. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index b7b9033e5..63496073f 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,23 @@ +Thu Jun 29 15:57:28 2000 Owen Taylor + + * NEWS: updated + + * Makefile.am: added snapcheck target to go along with snapshot + + * gstring.c glib.h (g_string_hash): Add g_string_hash to + go along with g_string_equal. + +Tue Jun 27 12:40:23 EDT 2000 David A. Wheeler + + * glib.h: Added g_string_equal for comparing GStrings; + changed g_str_equal so it returns gboolean (instead of gint). + + * gstring.c: Modified GString implementation to support embedded + ASCII NUL ('\0') characters, and implemented g_string_equal. + + * testglib.c tests/string-test.c: Added tests for g_string_equal + and tests for proper handling of embedded ASCII NUL characters. + Wed Jun 28 22:52:00 2000 Owen Taylor * Makefile.am (libglib_la_SOURCES): Fix @@ -52,7 +72,6 @@ Mon May 29 14:10:35 2000 Owen Taylor Fri May 19 11:39:29 2000 Tim Janik - * gutils.c (g_snprintf): (g_vsnprintf): added argument assertments. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b7b9033e5..63496073f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,23 @@ +Thu Jun 29 15:57:28 2000 Owen Taylor + + * NEWS: updated + + * Makefile.am: added snapcheck target to go along with snapshot + + * gstring.c glib.h (g_string_hash): Add g_string_hash to + go along with g_string_equal. + +Tue Jun 27 12:40:23 EDT 2000 David A. Wheeler + + * glib.h: Added g_string_equal for comparing GStrings; + changed g_str_equal so it returns gboolean (instead of gint). + + * gstring.c: Modified GString implementation to support embedded + ASCII NUL ('\0') characters, and implemented g_string_equal. + + * testglib.c tests/string-test.c: Added tests for g_string_equal + and tests for proper handling of embedded ASCII NUL characters. + Wed Jun 28 22:52:00 2000 Owen Taylor * Makefile.am (libglib_la_SOURCES): Fix @@ -52,7 +72,6 @@ Mon May 29 14:10:35 2000 Owen Taylor Fri May 19 11:39:29 2000 Tim Janik - * gutils.c (g_snprintf): (g_vsnprintf): added argument assertments. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index b7b9033e5..63496073f 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,23 @@ +Thu Jun 29 15:57:28 2000 Owen Taylor + + * NEWS: updated + + * Makefile.am: added snapcheck target to go along with snapshot + + * gstring.c glib.h (g_string_hash): Add g_string_hash to + go along with g_string_equal. + +Tue Jun 27 12:40:23 EDT 2000 David A. Wheeler + + * glib.h: Added g_string_equal for comparing GStrings; + changed g_str_equal so it returns gboolean (instead of gint). + + * gstring.c: Modified GString implementation to support embedded + ASCII NUL ('\0') characters, and implemented g_string_equal. + + * testglib.c tests/string-test.c: Added tests for g_string_equal + and tests for proper handling of embedded ASCII NUL characters. + Wed Jun 28 22:52:00 2000 Owen Taylor * Makefile.am (libglib_la_SOURCES): Fix @@ -52,7 +72,6 @@ Mon May 29 14:10:35 2000 Owen Taylor Fri May 19 11:39:29 2000 Tim Janik - * gutils.c (g_snprintf): (g_vsnprintf): added argument assertments. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index b7b9033e5..63496073f 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,23 @@ +Thu Jun 29 15:57:28 2000 Owen Taylor + + * NEWS: updated + + * Makefile.am: added snapcheck target to go along with snapshot + + * gstring.c glib.h (g_string_hash): Add g_string_hash to + go along with g_string_equal. + +Tue Jun 27 12:40:23 EDT 2000 David A. Wheeler + + * glib.h: Added g_string_equal for comparing GStrings; + changed g_str_equal so it returns gboolean (instead of gint). + + * gstring.c: Modified GString implementation to support embedded + ASCII NUL ('\0') characters, and implemented g_string_equal. + + * testglib.c tests/string-test.c: Added tests for g_string_equal + and tests for proper handling of embedded ASCII NUL characters. + Wed Jun 28 22:52:00 2000 Owen Taylor * Makefile.am (libglib_la_SOURCES): Fix @@ -52,7 +72,6 @@ Mon May 29 14:10:35 2000 Owen Taylor Fri May 19 11:39:29 2000 Tim Janik - * gutils.c (g_snprintf): (g_vsnprintf): added argument assertments. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b7b9033e5..63496073f 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,23 @@ +Thu Jun 29 15:57:28 2000 Owen Taylor + + * NEWS: updated + + * Makefile.am: added snapcheck target to go along with snapshot + + * gstring.c glib.h (g_string_hash): Add g_string_hash to + go along with g_string_equal. + +Tue Jun 27 12:40:23 EDT 2000 David A. Wheeler + + * glib.h: Added g_string_equal for comparing GStrings; + changed g_str_equal so it returns gboolean (instead of gint). + + * gstring.c: Modified GString implementation to support embedded + ASCII NUL ('\0') characters, and implemented g_string_equal. + + * testglib.c tests/string-test.c: Added tests for g_string_equal + and tests for proper handling of embedded ASCII NUL characters. + Wed Jun 28 22:52:00 2000 Owen Taylor * Makefile.am (libglib_la_SOURCES): Fix @@ -52,7 +72,6 @@ Mon May 29 14:10:35 2000 Owen Taylor Fri May 19 11:39:29 2000 Tim Janik - * gutils.c (g_snprintf): (g_vsnprintf): added argument assertments. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b7b9033e5..63496073f 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,23 @@ +Thu Jun 29 15:57:28 2000 Owen Taylor + + * NEWS: updated + + * Makefile.am: added snapcheck target to go along with snapshot + + * gstring.c glib.h (g_string_hash): Add g_string_hash to + go along with g_string_equal. + +Tue Jun 27 12:40:23 EDT 2000 David A. Wheeler + + * glib.h: Added g_string_equal for comparing GStrings; + changed g_str_equal so it returns gboolean (instead of gint). + + * gstring.c: Modified GString implementation to support embedded + ASCII NUL ('\0') characters, and implemented g_string_equal. + + * testglib.c tests/string-test.c: Added tests for g_string_equal + and tests for proper handling of embedded ASCII NUL characters. + Wed Jun 28 22:52:00 2000 Owen Taylor * Makefile.am (libglib_la_SOURCES): Fix @@ -52,7 +72,6 @@ Mon May 29 14:10:35 2000 Owen Taylor Fri May 19 11:39:29 2000 Tim Janik - * gutils.c (g_snprintf): (g_vsnprintf): added argument assertments. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b7b9033e5..63496073f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,23 @@ +Thu Jun 29 15:57:28 2000 Owen Taylor + + * NEWS: updated + + * Makefile.am: added snapcheck target to go along with snapshot + + * gstring.c glib.h (g_string_hash): Add g_string_hash to + go along with g_string_equal. + +Tue Jun 27 12:40:23 EDT 2000 David A. Wheeler + + * glib.h: Added g_string_equal for comparing GStrings; + changed g_str_equal so it returns gboolean (instead of gint). + + * gstring.c: Modified GString implementation to support embedded + ASCII NUL ('\0') characters, and implemented g_string_equal. + + * testglib.c tests/string-test.c: Added tests for g_string_equal + and tests for proper handling of embedded ASCII NUL characters. + Wed Jun 28 22:52:00 2000 Owen Taylor * Makefile.am (libglib_la_SOURCES): Fix @@ -52,7 +72,6 @@ Mon May 29 14:10:35 2000 Owen Taylor Fri May 19 11:39:29 2000 Tim Janik - * gutils.c (g_snprintf): (g_vsnprintf): added argument assertments. diff --git a/Makefile.am b/Makefile.am index e79918a47..2a7b67def 100644 --- a/Makefile.am +++ b/Makefile.am @@ -134,7 +134,10 @@ sanity: ./sanity_check $(VERSION) snapshot: - $(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"` + $(MAKE) dist distdir=$(PACKAGE)-snap`date +"%Y%m%d"` + +snapcheck: + $(MAKE) distcheck distdir=$(PACKAGE)-snap`date +"%Y%m%d"` dist-hook: cp glib.spec $(distdir) diff --git a/NEWS b/NEWS index 022acd563..b411a2ed2 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,11 @@ What's new in GLib 1.3.1: - +* New GObject library added including object system based on + the GTK+ object system. +* Functions for getting the properties of Unicode characters, + computing the canonical decomposition and ordering combining + characters aand manipulating UTF-8 string manipulation based + on libunicode. +* GString now properly handles embedded nuls. * Multiple fixes from the 1.2.x branch. * Upgrade to libtool 1.3.3 * Full thread support (thread creation and destruction). diff --git a/glib.h b/glib.h index 7baeb485f..c894690f7 100644 --- a/glib.h +++ b/glib.h @@ -1865,6 +1865,9 @@ GString* g_string_new (const gchar *init); GString* g_string_sized_new (guint dfl_size); void g_string_free (GString *string, gboolean free_segment); +gboolean g_string_equal (const GString *v, + const GString *v2); +guint g_string_hash (const GString *str); GString* g_string_assign (GString *string, const gchar *rval); GString* g_string_truncate (GString *string, @@ -1989,13 +1992,13 @@ GByteArray* g_byte_array_remove_index_fast (GByteArray *array, /* Hash Functions */ -gint g_str_equal (gconstpointer v, - gconstpointer v2); -guint g_str_hash (gconstpointer v); +gboolean g_str_equal (gconstpointer v, + gconstpointer v2); +guint g_str_hash (gconstpointer v); -gint g_int_equal (gconstpointer v, - gconstpointer v2); -guint g_int_hash (gconstpointer v); +gint g_int_equal (gconstpointer v, + gconstpointer v2); +guint g_int_hash (gconstpointer v); /* This "hash" function will just return the key's adress as an * unsigned integer. Useful for hashing on plain adresses or diff --git a/glib/Makefile.am b/glib/Makefile.am index e79918a47..2a7b67def 100644 --- a/glib/Makefile.am +++ b/glib/Makefile.am @@ -134,7 +134,10 @@ sanity: ./sanity_check $(VERSION) snapshot: - $(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"` + $(MAKE) dist distdir=$(PACKAGE)-snap`date +"%Y%m%d"` + +snapcheck: + $(MAKE) distcheck distdir=$(PACKAGE)-snap`date +"%Y%m%d"` dist-hook: cp glib.spec $(distdir) diff --git a/glib/glib.h b/glib/glib.h index 7baeb485f..c894690f7 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -1865,6 +1865,9 @@ GString* g_string_new (const gchar *init); GString* g_string_sized_new (guint dfl_size); void g_string_free (GString *string, gboolean free_segment); +gboolean g_string_equal (const GString *v, + const GString *v2); +guint g_string_hash (const GString *str); GString* g_string_assign (GString *string, const gchar *rval); GString* g_string_truncate (GString *string, @@ -1989,13 +1992,13 @@ GByteArray* g_byte_array_remove_index_fast (GByteArray *array, /* Hash Functions */ -gint g_str_equal (gconstpointer v, - gconstpointer v2); -guint g_str_hash (gconstpointer v); +gboolean g_str_equal (gconstpointer v, + gconstpointer v2); +guint g_str_hash (gconstpointer v); -gint g_int_equal (gconstpointer v, - gconstpointer v2); -guint g_int_hash (gconstpointer v); +gint g_int_equal (gconstpointer v, + gconstpointer v2); +guint g_int_hash (gconstpointer v); /* This "hash" function will just return the key's adress as an * unsigned integer. Useful for hashing on plain adresses or diff --git a/glib/gstring.c b/glib/gstring.c index 299b24233..fc3deffd5 100644 --- a/glib/gstring.c +++ b/glib/gstring.c @@ -67,7 +67,7 @@ static GMemChunk *string_mem_chunk = NULL; /* Hash Functions. */ -gint +gboolean g_str_equal (gconstpointer v1, gconstpointer v2) { @@ -265,6 +265,48 @@ g_string_free (GString *string, G_UNLOCK (string_mem_chunk); } +gboolean +g_string_equal (const GString *v, + const GString *v2) +{ + gchar *p, *q; + GRealString *string1 = (GRealString *) v; + GRealString *string2 = (GRealString *) v2; + gint i = string1->len; + + if (i != string2->len) + return FALSE; + + p = string1->str; + q = string2->str; + while (i) + { + if (*p != *q) + return FALSE; + p++; + q++; + i--; + } + return TRUE; +} + +/* 31 bit hash function */ +guint +g_string_hash (const GString *str) +{ + const gchar *p = str->str; + gint n = str->len; + guint h = 0; + + while (n--) + { + h = (h << 5) - h + *p; + p++; + } + + return h; +} + GString* g_string_assign (GString *string, const gchar *rval) @@ -320,7 +362,7 @@ g_string_insert_len (GString *fstring, g_memmove (string->str + pos + len, string->str + pos, string->len - pos); /* insert the new string */ - strncpy (string->str + pos, val, len); + g_memmove (string->str + pos, val, len); string->len += len; @@ -457,15 +499,17 @@ g_string_down (GString *fstring) { GRealString *string = (GRealString *) fstring; guchar *s; + gint n = string->len; g_return_val_if_fail (string != NULL, NULL); s = string->str; - while (*s) + while (n) { *s = tolower (*s); s++; + n--; } return fstring; @@ -476,15 +520,17 @@ g_string_up (GString *fstring) { GRealString *string = (GRealString *) fstring; guchar *s; + gint n = string->len; g_return_val_if_fail (string != NULL, NULL); s = string->str; - while (*s) + while (n) { *s = toupper (*s); s++; + n--; } return fstring; diff --git a/gstring.c b/gstring.c index 299b24233..fc3deffd5 100644 --- a/gstring.c +++ b/gstring.c @@ -67,7 +67,7 @@ static GMemChunk *string_mem_chunk = NULL; /* Hash Functions. */ -gint +gboolean g_str_equal (gconstpointer v1, gconstpointer v2) { @@ -265,6 +265,48 @@ g_string_free (GString *string, G_UNLOCK (string_mem_chunk); } +gboolean +g_string_equal (const GString *v, + const GString *v2) +{ + gchar *p, *q; + GRealString *string1 = (GRealString *) v; + GRealString *string2 = (GRealString *) v2; + gint i = string1->len; + + if (i != string2->len) + return FALSE; + + p = string1->str; + q = string2->str; + while (i) + { + if (*p != *q) + return FALSE; + p++; + q++; + i--; + } + return TRUE; +} + +/* 31 bit hash function */ +guint +g_string_hash (const GString *str) +{ + const gchar *p = str->str; + gint n = str->len; + guint h = 0; + + while (n--) + { + h = (h << 5) - h + *p; + p++; + } + + return h; +} + GString* g_string_assign (GString *string, const gchar *rval) @@ -320,7 +362,7 @@ g_string_insert_len (GString *fstring, g_memmove (string->str + pos + len, string->str + pos, string->len - pos); /* insert the new string */ - strncpy (string->str + pos, val, len); + g_memmove (string->str + pos, val, len); string->len += len; @@ -457,15 +499,17 @@ g_string_down (GString *fstring) { GRealString *string = (GRealString *) fstring; guchar *s; + gint n = string->len; g_return_val_if_fail (string != NULL, NULL); s = string->str; - while (*s) + while (n) { *s = tolower (*s); s++; + n--; } return fstring; @@ -476,15 +520,17 @@ g_string_up (GString *fstring) { GRealString *string = (GRealString *) fstring; guchar *s; + gint n = string->len; g_return_val_if_fail (string != NULL, NULL); s = string->str; - while (*s) + while (n) { *s = toupper (*s); s++; + n--; } return fstring; diff --git a/testglib.c b/testglib.c index 940851bfe..33bb4c9a3 100644 --- a/testglib.c +++ b/testglib.c @@ -798,8 +798,37 @@ main (int argc, g_print ("ok\n"); + /* g_string_equal */ + string1 = g_string_new ("test"); + string2 = g_string_new ("te"); + g_assert (! g_string_equal(string1, string2)); + g_string_append (string2, "st"); + g_assert (g_string_equal(string1, string2)); + g_string_free (string1, TRUE); + g_string_free (string2, TRUE); + + /* Check handling of embedded ASCII 0 (NUL) characters in GString. */ + string1 = g_string_new ("fiddle"); + string2 = g_string_new ("fiddle"); + g_assert (g_string_equal(string1, string2)); + g_string_append_c(string1, '\0'); + g_assert (! g_string_equal(string1, string2)); + g_string_append_c(string2, '\0'); + g_assert (g_string_equal(string1, string2)); + g_string_append_c(string1, 'x'); + g_string_append_c(string2, 'y'); + g_assert (! g_string_equal(string1, string2)); + g_assert (string1->len == 8); + g_string_append(string1, "yzzy"); + g_assert (string1->len == 12); + g_assert ( memcmp(string1->str, "fiddle\0xyzzy", 13) == 0); + g_string_insert(string1, 1, "QED"); + g_assert ( memcmp(string1->str, "fQEDiddle\0xyzzy", 16) == 0); + g_string_free (string1, TRUE); + g_string_free (string2, TRUE); + g_print ("checking timers...\n"); - + timer = g_timer_new (); g_print (" spinning for 3 seconds...\n"); diff --git a/tests/string-test.c b/tests/string-test.c index 539b904b5..8c0b7ce02 100644 --- a/tests/string-test.c +++ b/tests/string-test.c @@ -180,6 +180,35 @@ main (int argc, g_assert (strcmp (string1->str, "firstlast") == 0); g_string_free (string1, TRUE); + /* g_string_equal */ + string1 = g_string_new ("test"); + string2 = g_string_new ("te"); + g_assert (! g_string_equal(string1, string2)); + g_string_append (string2, "st"); + g_assert (g_string_equal(string1, string2)); + g_string_free (string1, TRUE); + g_string_free (string2, TRUE); + + /* Check handling of embedded ASCII 0 (NUL) characters in GString. */ + string1 = g_string_new ("fiddle"); + string2 = g_string_new ("fiddle"); + g_assert (g_string_equal(string1, string2)); + g_string_append_c(string1, '\0'); + g_assert (! g_string_equal(string1, string2)); + g_string_append_c(string2, '\0'); + g_assert (g_string_equal(string1, string2)); + g_string_append_c(string1, 'x'); + g_string_append_c(string2, 'y'); + g_assert (! g_string_equal(string1, string2)); + g_assert (string1->len == 8); + g_string_append(string1, "yzzy"); + g_assert (string1->len == 12); + g_assert ( memcmp(string1->str, "fiddle\0xyzzy", 13) == 0); + g_string_insert(string1, 1, "QED"); + g_assert ( memcmp(string1->str, "fQEDiddle\0xyzzy", 16) == 0); + g_string_free (string1, TRUE); + g_string_free (string2, TRUE); + return 0; } diff --git a/tests/testglib.c b/tests/testglib.c index 940851bfe..33bb4c9a3 100644 --- a/tests/testglib.c +++ b/tests/testglib.c @@ -798,8 +798,37 @@ main (int argc, g_print ("ok\n"); + /* g_string_equal */ + string1 = g_string_new ("test"); + string2 = g_string_new ("te"); + g_assert (! g_string_equal(string1, string2)); + g_string_append (string2, "st"); + g_assert (g_string_equal(string1, string2)); + g_string_free (string1, TRUE); + g_string_free (string2, TRUE); + + /* Check handling of embedded ASCII 0 (NUL) characters in GString. */ + string1 = g_string_new ("fiddle"); + string2 = g_string_new ("fiddle"); + g_assert (g_string_equal(string1, string2)); + g_string_append_c(string1, '\0'); + g_assert (! g_string_equal(string1, string2)); + g_string_append_c(string2, '\0'); + g_assert (g_string_equal(string1, string2)); + g_string_append_c(string1, 'x'); + g_string_append_c(string2, 'y'); + g_assert (! g_string_equal(string1, string2)); + g_assert (string1->len == 8); + g_string_append(string1, "yzzy"); + g_assert (string1->len == 12); + g_assert ( memcmp(string1->str, "fiddle\0xyzzy", 13) == 0); + g_string_insert(string1, 1, "QED"); + g_assert ( memcmp(string1->str, "fQEDiddle\0xyzzy", 16) == 0); + g_string_free (string1, TRUE); + g_string_free (string2, TRUE); + g_print ("checking timers...\n"); - + timer = g_timer_new (); g_print (" spinning for 3 seconds...\n");