Commit 16b83a9a authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

version bump to 1.1.1, binary age 1, interface age 0. updates. updates.

Tue Aug  4 15:17:54 1998  Tim Janik  <timj@gtk.org>

        * configure.in: version bump to 1.1.1, binary age 1, interface age 0.
        * NEWS: updates.
        * README: updates.
        * INSTALL: updates and fixes.
        * COPYING: include the GNU LGPL, rather than shipping an empty file.
        * AUTHORS: listed original authors here, and added people who made
        significant improvements to glib.

        * glib.h:
        * gutils.c: implement g_get_current_dir() which returns a newly
        allocated string, instead of a g_getcwd() variant that operates
        on a static buffer.
        export glib_interface_age and glib_binary_age.
        as a convenience, macro definitions have been added for
        g_node_insert_data, g_node_insert_data_before, g_node_append_data and
        g_node_prepend_data.

        * testglib.c: minor cleanups, print current dir.
parent 8b853a62
Peter Mattis (petm@xcf.berkeley.edu)
Original Authors
----------------
Peter Mattis <petm@xcf.berkeley.edu>
Spencer Kimball <spencer@xcf.berkeley.edu>
Josh MacDonald <jmacd@xcf.berkeley.edu>
Other people who made significant
improvements to GLIB (shamelessly
ripped from the ChangeLog, listed
in alphabetiacal order)
---------------------------------
Raja R Harinath <harinath@cs.umn.edu>
Tim Janik <timj@gtk.org>
Paolo Molaro <lupus@debian.org>
Manish Singh <yosh@gimp.org>
Owen Taylor <otaylor@gtk.org>
There are also many others who have contributed patches and fixes;
we thank them, for helping us in advancing GLIB.
This diff is collapsed.
Tue Aug 4 15:17:54 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 1, interface age 0.
* NEWS: updates.
* README: updates.
* INSTALL: updates and fixes.
* COPYING: include the GNU LGPL, rather than shipping an empty file.
* AUTHORS: listed original authors here, and added people who made
significant improvements to glib.
* glib.h:
* gutils.c: implement g_get_current_dir() which returns a newly
allocated string, instead of a g_getcwd() variant that operates
on a static buffer.
export glib_interface_age and glib_binary_age.
as a convenience, macro definitions have been added for
g_node_insert_data, g_node_insert_data_before, g_node_append_data and
g_node_prepend_data.
* testglib.c: minor cleanups, print current dir.
Mon Aug 3 16:02:26 1998 Tim Janik <timj@gtk.org>
* glib.h:
......
Tue Aug 4 15:17:54 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 1, interface age 0.
* NEWS: updates.
* README: updates.
* INSTALL: updates and fixes.
* COPYING: include the GNU LGPL, rather than shipping an empty file.
* AUTHORS: listed original authors here, and added people who made
significant improvements to glib.
* glib.h:
* gutils.c: implement g_get_current_dir() which returns a newly
allocated string, instead of a g_getcwd() variant that operates
on a static buffer.
export glib_interface_age and glib_binary_age.
as a convenience, macro definitions have been added for
g_node_insert_data, g_node_insert_data_before, g_node_append_data and
g_node_prepend_data.
* testglib.c: minor cleanups, print current dir.
Mon Aug 3 16:02:26 1998 Tim Janik <timj@gtk.org>
* glib.h:
......
Tue Aug 4 15:17:54 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 1, interface age 0.
* NEWS: updates.
* README: updates.
* INSTALL: updates and fixes.
* COPYING: include the GNU LGPL, rather than shipping an empty file.
* AUTHORS: listed original authors here, and added people who made
significant improvements to glib.
* glib.h:
* gutils.c: implement g_get_current_dir() which returns a newly
allocated string, instead of a g_getcwd() variant that operates
on a static buffer.
export glib_interface_age and glib_binary_age.
as a convenience, macro definitions have been added for
g_node_insert_data, g_node_insert_data_before, g_node_append_data and
g_node_prepend_data.
* testglib.c: minor cleanups, print current dir.
Mon Aug 3 16:02:26 1998 Tim Janik <timj@gtk.org>
* glib.h:
......
Tue Aug 4 15:17:54 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 1, interface age 0.
* NEWS: updates.
* README: updates.
* INSTALL: updates and fixes.
* COPYING: include the GNU LGPL, rather than shipping an empty file.
* AUTHORS: listed original authors here, and added people who made
significant improvements to glib.
* glib.h:
* gutils.c: implement g_get_current_dir() which returns a newly
allocated string, instead of a g_getcwd() variant that operates
on a static buffer.
export glib_interface_age and glib_binary_age.
as a convenience, macro definitions have been added for
g_node_insert_data, g_node_insert_data_before, g_node_append_data and
g_node_prepend_data.
* testglib.c: minor cleanups, print current dir.
Mon Aug 3 16:02:26 1998 Tim Janik <timj@gtk.org>
* glib.h:
......
Tue Aug 4 15:17:54 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 1, interface age 0.
* NEWS: updates.
* README: updates.
* INSTALL: updates and fixes.
* COPYING: include the GNU LGPL, rather than shipping an empty file.
* AUTHORS: listed original authors here, and added people who made
significant improvements to glib.
* glib.h:
* gutils.c: implement g_get_current_dir() which returns a newly
allocated string, instead of a g_getcwd() variant that operates
on a static buffer.
export glib_interface_age and glib_binary_age.
as a convenience, macro definitions have been added for
g_node_insert_data, g_node_insert_data_before, g_node_append_data and
g_node_prepend_data.
* testglib.c: minor cleanups, print current dir.
Mon Aug 3 16:02:26 1998 Tim Janik <timj@gtk.org>
* glib.h:
......
Tue Aug 4 15:17:54 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 1, interface age 0.
* NEWS: updates.
* README: updates.
* INSTALL: updates and fixes.
* COPYING: include the GNU LGPL, rather than shipping an empty file.
* AUTHORS: listed original authors here, and added people who made
significant improvements to glib.
* glib.h:
* gutils.c: implement g_get_current_dir() which returns a newly
allocated string, instead of a g_getcwd() variant that operates
on a static buffer.
export glib_interface_age and glib_binary_age.
as a convenience, macro definitions have been added for
g_node_insert_data, g_node_insert_data_before, g_node_append_data and
g_node_prepend_data.
* testglib.c: minor cleanups, print current dir.
Mon Aug 3 16:02:26 1998 Tim Janik <timj@gtk.org>
* glib.h:
......
Tue Aug 4 15:17:54 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 1, interface age 0.
* NEWS: updates.
* README: updates.
* INSTALL: updates and fixes.
* COPYING: include the GNU LGPL, rather than shipping an empty file.
* AUTHORS: listed original authors here, and added people who made
significant improvements to glib.
* glib.h:
* gutils.c: implement g_get_current_dir() which returns a newly
allocated string, instead of a g_getcwd() variant that operates
on a static buffer.
export glib_interface_age and glib_binary_age.
as a convenience, macro definitions have been added for
g_node_insert_data, g_node_insert_data_before, g_node_append_data and
g_node_prepend_data.
* testglib.c: minor cleanups, print current dir.
Mon Aug 3 16:02:26 1998 Tim Janik <timj@gtk.org>
* glib.h:
......
Tue Aug 4 15:17:54 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 1, interface age 0.
* NEWS: updates.
* README: updates.
* INSTALL: updates and fixes.
* COPYING: include the GNU LGPL, rather than shipping an empty file.
* AUTHORS: listed original authors here, and added people who made
significant improvements to glib.
* glib.h:
* gutils.c: implement g_get_current_dir() which returns a newly
allocated string, instead of a g_getcwd() variant that operates
on a static buffer.
export glib_interface_age and glib_binary_age.
as a convenience, macro definitions have been added for
g_node_insert_data, g_node_insert_data_before, g_node_append_data and
g_node_prepend_data.
* testglib.c: minor cleanups, print current dir.
Mon Aug 3 16:02:26 1998 Tim Janik <timj@gtk.org>
* glib.h:
......
Simple install procedure
========================
% gzip -cd glib-1.1.0.tar.gz | tar xvf - # unpack the sources
% cd glib-1.1.0 # change to the toplevel directory
% gzip -cd glib-1.1.1.tar.gz | tar xvf - # unpack the sources
% cd glib-1.1.1 # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK
% make # build GLIB
[ Become root if necessary ]
% make install # install GTK
% make install # install GLIB
The Nitty-Gritty
================
......
What is new in GLib 1.1.1:
* An n-way tree implementation is provided now, based on the GNode structure.
* Bugfix for pointer arrays.
What is new in GLib 1.1.0:
* GLib is distributed seperatedly from Gtk+ now and uses a sophisticated
......
General Information
===================
This is GLib version 1.1.0. GLib, is a library which includes support
This is GLib version 1.1.1. GLib, is a library which includes support
routines for C such as lists, trees, hashes, memory allocation, and
many other things.
Versions of GLib prior to 1.1.0 are distributed with GTK+ versions 1.1.0
and earlier.
Versions of GLib prior to 1.1.0 are distributed with GTK+ versions prior
to 1.1.0.
The official ftp site is:
ftp://ftp.gtk.org/pub/gtk
......
......@@ -65,6 +65,8 @@
#undef GLIB_MAJOR_VERSION
#undef GLIB_MINOR_VERSION
#undef GLIB_MICRO_VERSION
#undef GLIB_INTERFACE_AGE
#undef GLIB_BINARY_AGE
/* #undef PACKAGE */
/* #undef VERSION */
......
......@@ -14,9 +14,9 @@ cflags_set=${CFLAGS+set}
#
GLIB_MAJOR_VERSION=1
GLIB_MINOR_VERSION=1
GLIB_MICRO_VERSION=0
GLIB_MICRO_VERSION=1
GLIB_INTERFACE_AGE=0
GLIB_BINARY_AGE=0
GLIB_BINARY_AGE=1
GLIB_VERSION=$GLIB_MAJOR_VERSION.$GLIB_MINOR_VERSION.$GLIB_MICRO_VERSION
AC_SUBST(GLIB_VERSION)
......@@ -41,6 +41,8 @@ AM_CONFIG_HEADER(glibconfig.h)
AC_DEFINE_UNQUOTED(GLIB_MAJOR_VERSION, $GLIB_MAJOR_VERSION)
AC_DEFINE_UNQUOTED(GLIB_MINOR_VERSION, $GLIB_MINOR_VERSION)
AC_DEFINE_UNQUOTED(GLIB_MICRO_VERSION, $GLIB_MICRO_VERSION)
AC_DEFINE_UNQUOTED(GLIB_INTERFACE_AGE, $GLIB_INTERFACE_AGE)
AC_DEFINE_UNQUOTED(GLIB_BINARY_AGE, $GLIB_BINARY_AGE)
dnl Initialize libtool
AM_PROG_LIBTOOL
......
......@@ -782,6 +782,23 @@ GNode* g_node_find (GNode *root,
GTraverseFlags flags,
gpointer data);
/* convenience macros */
#define g_node_append(parent, node) G_STMT_START { \
g_node_insert_before ((parent), NULL, (node)); \
} G_STMT_END
#define g_node_insert_data(parent, position, data) G_STMT_START { \
g_node_insert ((parent), (position), g_node_new ((data))); \
} G_STMT_END
#define g_node_insert_data_before(parent, sibling, data) G_STMT_START { \
g_node_insert_before ((parent), (sibling), g_node_new ((data))); \
} G_STMT_END
#define g_node_prepend_data(parent, data) G_STMT_START { \
g_node_prepend ((parent), g_node_new ((data))); \
} G_STMT_END
#define g_node_append_data(parent, data) G_STMT_START { \
g_node_insert_before ((parent), NULL, g_node_new ((data))); \
} G_STMT_END
/* traversal function, assumes that `node' is root
* (only traverses `node' and its subtree).
* this function is just a high level interface to
......@@ -827,11 +844,6 @@ GNode* g_node_last_sibling (GNode *node);
((GNode*) (node))->next : NULL)
#define g_node_first_child(node) ((node) ? \
((GNode*) (node))->children : NULL)
#define g_node_append(parent, node) G_STMT_START { \
g_node_insert_before ((parent), \
NULL, \
(node)); \
} G_STMT_END
......@@ -964,10 +976,10 @@ gint g_snprintf (gchar *string,
gchar const *format,
...) G_GNUC_PRINTF (3, 4);
gchar* g_basename (const gchar *file_name);
/* strings are newly allocated with g_malloc() */
gchar* g_dirname (const gchar *file_name);
#if 0
gchar* g_getcwd (void);
#endif
gchar* g_get_current_dir (void);
/* We make the assumption that if memmove isn't available, then
......@@ -976,7 +988,7 @@ gchar* g_getcwd (void);
#ifdef HAVE_MEMMOVE
#define g_memmove memmove
#else
#define g_memmove(a,b,c) bcopy(b,a,c)
#define g_memmove(a,b,c) bcopy((b), (a), (c))
#endif
/* Errors
......@@ -1451,6 +1463,8 @@ gpointer g_tuples_index (GTuples *tuples,
extern const guint glib_major_version;
extern const guint glib_minor_version;
extern const guint glib_micro_version;
extern const guint glib_interface_age;
extern const guint glib_binary_age;
#ifdef __cplusplus
}
......
......@@ -782,6 +782,23 @@ GNode* g_node_find (GNode *root,
GTraverseFlags flags,
gpointer data);
/* convenience macros */
#define g_node_append(parent, node) G_STMT_START { \
g_node_insert_before ((parent), NULL, (node)); \
} G_STMT_END
#define g_node_insert_data(parent, position, data) G_STMT_START { \
g_node_insert ((parent), (position), g_node_new ((data))); \
} G_STMT_END
#define g_node_insert_data_before(parent, sibling, data) G_STMT_START { \
g_node_insert_before ((parent), (sibling), g_node_new ((data))); \
} G_STMT_END
#define g_node_prepend_data(parent, data) G_STMT_START { \
g_node_prepend ((parent), g_node_new ((data))); \
} G_STMT_END
#define g_node_append_data(parent, data) G_STMT_START { \
g_node_insert_before ((parent), NULL, g_node_new ((data))); \
} G_STMT_END
/* traversal function, assumes that `node' is root
* (only traverses `node' and its subtree).
* this function is just a high level interface to
......@@ -827,11 +844,6 @@ GNode* g_node_last_sibling (GNode *node);
((GNode*) (node))->next : NULL)
#define g_node_first_child(node) ((node) ? \
((GNode*) (node))->children : NULL)
#define g_node_append(parent, node) G_STMT_START { \
g_node_insert_before ((parent), \
NULL, \
(node)); \
} G_STMT_END
......@@ -964,10 +976,10 @@ gint g_snprintf (gchar *string,
gchar const *format,
...) G_GNUC_PRINTF (3, 4);
gchar* g_basename (const gchar *file_name);
/* strings are newly allocated with g_malloc() */
gchar* g_dirname (const gchar *file_name);
#if 0
gchar* g_getcwd (void);
#endif
gchar* g_get_current_dir (void);
/* We make the assumption that if memmove isn't available, then
......@@ -976,7 +988,7 @@ gchar* g_getcwd (void);
#ifdef HAVE_MEMMOVE
#define g_memmove memmove
#else
#define g_memmove(a,b,c) bcopy(b,a,c)
#define g_memmove(a,b,c) bcopy((b), (a), (c))
#endif
/* Errors
......@@ -1451,6 +1463,8 @@ gpointer g_tuples_index (GTuples *tuples,
extern const guint glib_major_version;
extern const guint glib_minor_version;
extern const guint glib_micro_version;
extern const guint glib_interface_age;
extern const guint glib_binary_age;
#ifdef __cplusplus
}
......
......@@ -29,6 +29,8 @@
const guint glib_major_version = GLIB_MAJOR_VERSION;
const guint glib_minor_version = GLIB_MINOR_VERSION;
const guint glib_micro_version = GLIB_MICRO_VERSION;
const guint glib_interface_age = GLIB_INTERFACE_AGE;
const guint glib_binary_age = GLIB_BINARY_AGE;
extern char* g_vsprintf (const gchar *fmt, va_list *args, va_list *args2);
......@@ -149,32 +151,45 @@ g_dirname (const gchar *file_name)
return base;
}
#ifdef MAXPATHLEN
#define G_PATH_LENGTH (MAXPATHLEN + 1)
#elif defined (PATH_MAX)
#define G_PATH_LENGTH (PATH_MAX + 1)
#else /* !MAXPATHLEN */
#define G_PATH_LENGTH (2048 + 1)
#endif /* !MAXPATHLEN && !PATH_MAX */
gchar*
g_getcwd (void)
g_get_current_dir (void)
{
static gchar g_getcwd_buf[MAXPATHLEN + 1] = { 0 };
register gchar *dir;
g_getcwd_buf[0] = 0;
gchar *buffer;
gchar *dir;
buffer = g_new (gchar, G_PATH_LENGTH);
*buffer = 0;
/* We don't use getcwd(3) on SUNOS, because, it does a popen("pwd")
* and, if that wasn't bad enough, hangs in doing so.
*/
#if defined (sun) && !defined (__SVR4)
dir = getwd (g_getcwd_buf);
dir = getwd (buffer);
#else /* !sun */
dir = getcwd (g_getcwd_buf, MAXPATHLEN);
dir = getcwd (buffer, G_PATH_LENGTH - 1);
#endif /* !sun */
if (!dir || g_getcwd_buf[0] == 0)
if (!dir || !*buffer)
{
/* hm, we should probably g_error() out here...
/* hm, should we g_error() out here?
* this can happen if e.g. "./" has mode \0000
*/
g_getcwd_buf[0] = '/';
g_getcwd_buf[1] = 0;
buffer[0] = '/';
buffer[1] = 0;
}
dir = g_strdup (buffer);
g_free (buffer);
return g_getcwd_buf;
return dir;
}
static gchar *g_tmp_dir = NULL;
......
......@@ -40,6 +40,8 @@
#undef GLIB_MAJOR_VERSION
#undef GLIB_MINOR_VERSION
#undef GLIB_MICRO_VERSION
#undef GLIB_INTERFACE_AGE
#undef GLIB_BINARY_AGE
/* The number of bytes in a char. */
#undef SIZEOF_CHAR
......
......@@ -29,6 +29,8 @@
const guint glib_major_version = GLIB_MAJOR_VERSION;
const guint glib_minor_version = GLIB_MINOR_VERSION;
const guint glib_micro_version = GLIB_MICRO_VERSION;
const guint glib_interface_age = GLIB_INTERFACE_AGE;
const guint glib_binary_age = GLIB_BINARY_AGE;
extern char* g_vsprintf (const gchar *fmt, va_list *args, va_list *args2);
......@@ -149,32 +151,45 @@ g_dirname (const gchar *file_name)
return base;
}
#ifdef MAXPATHLEN
#define G_PATH_LENGTH (MAXPATHLEN + 1)
#elif defined (PATH_MAX)
#define G_PATH_LENGTH (PATH_MAX + 1)
#else /* !MAXPATHLEN */
#define G_PATH_LENGTH (2048 + 1)
#endif /* !MAXPATHLEN && !PATH_MAX */
gchar*
g_getcwd (void)
g_get_current_dir (void)
{
static gchar g_getcwd_buf[MAXPATHLEN + 1] = { 0 };
register gchar *dir;
g_getcwd_buf[0] = 0;
gchar *buffer;
gchar *dir;
buffer = g_new (gchar, G_PATH_LENGTH);
*buffer = 0;
/* We don't use getcwd(3) on SUNOS, because, it does a popen("pwd")
* and, if that wasn't bad enough, hangs in doing so.
*/
#if defined (sun) && !defined (__SVR4)
dir = getwd (g_getcwd_buf);
dir = getwd (buffer);
#else /* !sun */
dir = getcwd (g_getcwd_buf, MAXPATHLEN);
dir = getcwd (buffer, G_PATH_LENGTH - 1);
#endif /* !sun */
if (!dir || g_getcwd_buf[0] == 0)
if (!dir || !*buffer)
{
/* hm, we should probably g_error() out here...
/* hm, should we g_error() out here?
* this can happen if e.g. "./" has mode \0000
*/
g_getcwd_buf[0] = '/';
g_getcwd_buf[1] = 0;
buffer[0] = '/';
buffer[1] = 0;
}
dir = g_strdup (buffer);
g_free (buffer);
return g_getcwd_buf;
return dir;
}
static gchar *g_tmp_dir = NULL;
......
......@@ -77,8 +77,8 @@ g_node_test (void)
g_node_append (root, node_B);
TEST (NULL, root->children == node_B);
g_node_append (node_B, g_node_new (C2P ('E')));
g_node_prepend (node_B, g_node_new (C2P ('C')));
g_node_append_data (node_B, C2P ('E'));
g_node_prepend_data (node_B, C2P ('C'));
g_node_insert (node_B, 1, g_node_new (C2P ('D')));
node_F = g_node_new (C2P ('F'));
......@@ -88,9 +88,9 @@ g_node_test (void)
node_G = g_node_new (C2P ('G'));
g_node_append (node_F, node_G);
node_J = g_node_new (C2P ('J'));
g_node_insert (node_G, -1, node_J);
g_node_prepend (node_G, node_J);
g_node_insert (node_G, 42, g_node_new (C2P ('K')));
g_node_insert (node_G, 0, g_node_new (C2P ('H')));
g_node_insert_data (node_G, 0, C2P ('H'));
g_node_insert (node_G, 1, g_node_new (C2P ('I')));
TEST (NULL, g_node_depth (root) == 1);
......@@ -253,6 +253,7 @@ main (int argc,
GTimer *timer;
gint nums[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
gint morenums[10] = { 8, 9, 7, 0, 3, 2, 5, 1, 4, 6};
gchar *string;
gchar *mem[10000], *tmp_string, *tmp_string_2;
gint i, j;
......@@ -283,10 +284,29 @@ main (int argc,
};
guint n_dirname_checks = sizeof (dirname_checks) / sizeof (dirname_checks[0]);
g_print ("checking size of gint8...%ld (should be 1)\n", (glong)sizeof (gint8));
g_print ("checking size of gint16...%ld (should be 2)\n", (glong)sizeof (gint16));
g_print ("checking size of gint32...%ld (should be 4)\n", (glong)sizeof (gint32));
g_print ("TestGLib v%u.%u.%u (i:%u b:%u)\n",
glib_major_version,
glib_minor_version,
glib_micro_version,
glib_interface_age,
glib_binary_age);
string = g_get_current_dir ();
g_print ("cwd: %s\n", string);
g_free (string);
/* type sizes */
g_print ("checking size of gint8: %d", sizeof (gint8));
TEST (NULL, sizeof (gint8) == 1);
g_print ("\nchecking size of gint16: %d", sizeof (gint16));
TEST (NULL, sizeof (gint16) == 2);
g_print ("\nchecking size of gint32: %d", sizeof (gint32));
TEST (NULL, sizeof (gint32) == 4);
#ifdef HAVE_GINT64
g_print ("\nchecking size of gint64: %d", sizeof (gint64));
TEST (NULL, sizeof (gint64) == 8);
#endif /* HAVE_GINT64 */
g_print ("\n");
g_print ("checking g_dirname()...");
for (i = 0; i < n_dirname_checks; i++)
......@@ -296,7 +316,7 @@ main (int argc,
dirname = g_dirname (dirname_checks[i].filename);
if (strcmp (dirname, dirname_checks[i].dirname) != 0)
{
g_print ("failed for \"%s\"==\"%s\" (returned: \"%s\")\n",
g_print ("\nfailed for \"%s\"==\"%s\" (returned: \"%s\")\n",
dirname_checks[i].filename,
dirname_checks[i].dirname,
dirname);
......
......@@ -77,8 +77,8 @@ g_node_test (void)
g_node_append (root, node_B);
TEST (NULL, root->children == node_B);
g_node_append (node_B, g_node_new (C2P ('E')));
g_node_prepend (node_B, g_node_new (C2P ('C')));
g_node_append_data (node_B, C2P ('E'));
g_node_prepend_data (node_B, C2P ('C'));
g_node_insert (node_B, 1, g_node_new (C2P ('D')));
node_F = g_node_new (C2P ('F'));
......@@ -88,9 +88,9 @@ g_node_test (void)
node_G = g_node_new (C2P ('G'));
g_node_append (node_F, node_G);
node_J = g_node_new (C2P ('J'));
g_node_insert (node_G, -1, node_J);
g_node_prepend (node_G, node_J);
g_node_insert (node_G, 42, g_node_new (C2P ('K')));
g_node_insert (node_G, 0, g_node_new (C2P ('H')));
g_node_insert_data (node_G, 0, C2P ('H'));
g_node_insert (node_G, 1, g_node_new (C2P ('I')));
TEST (NULL, g_node_depth (root) == 1);
......@@ -253,6 +253,7 @@ main (int argc,
GTimer *timer;
gint nums[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
gint morenums[10] = { 8, 9, 7, 0, 3, 2, 5, 1, 4, 6};
gchar *string;
gchar *mem[10000], *tmp_string, *tmp_string_2;
gint i, j;
......@@ -283,10 +284,29 @@ main (int argc,
};
guint n_dirname_checks = sizeof (dirname_checks) / sizeof (dirname_checks[0]);
g_print ("checking size of gint8...%ld (should be 1)\n", (glong)sizeof (gint8));
g_print ("checking size of gint16...%ld (should be 2)\n", (glong)sizeof (gint16));
g_print ("checking size of gint32...%ld (should be 4)\n", (glong)sizeof (gint32));
g_print ("TestGLib v%u.%u.%u (i:%u b:%u)\n",
glib_major_version,
glib_minor_version,
glib_micro_version,
glib_interface_age,
glib_binary_age);
string = g_get_current_dir ();
g_print ("cwd: %s\n", string);
g_free (string);
/* type sizes */
g_print ("checking size of gint8: %d", sizeof (gint8));
TEST (NULL, sizeof (gint8) == 1);
g_print ("\nchecking size of gint16: %d", sizeof (gint16));
TEST (NULL, sizeof (gint16) == 2);
g_print ("\nchecking size of gint32: %d", sizeof (gint32));
TEST (NULL, sizeof (gint32) == 4);
#ifdef HAVE_GINT64
g_print ("\nchecking size of gint64: %d", sizeof (gint64));
TEST (NULL, sizeof (gint64) == 8);
#endif /* HAVE_GINT64 */
g_print ("\n");
g_print ("checking g_dirname()...");
for (i = 0; i < n_dirname_checks; i++)
......@@ -296,7 +316,7 @@ main (int argc,
dirname = g_dirname (dirname_checks[i].filename);
if (strcmp (dirname, dirname_checks[i].dirname) != 0)
{
g_print ("failed for \"%s\"==\"%s\" (returned: \"%s\")\n",
g_print ("\nfailed for \"%s\"==\"%s\" (returned: \"%s\")\n",
dirname_checks[i].filename,
dirname_checks[i].dirname,
dirname);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment