summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSebastian Wilhelmi <seppi@seppi.de>2004-02-29 16:48:37 +0000
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>2004-02-29 16:48:37 +0000
commit769f36db47c3e81225fd6625b5251b50a0aedb8a (patch)
tree6419cccdbe485f995da7f0f76fc1c61baa92bbbf /tests
parentfe2efd06a08c1a035339b1a6e46446a9a02958b1 (diff)
Moved the assembler functions from gatomic.h to gatomic.c, which makes for
2004-02-29 Sebastian Wilhelmi <seppi@seppi.de> * configure.in, glib/gatomic.c, glib/gatomic.h: Moved the assembler functions from gatomic.h to gatomic.c, which makes for better maintainability. Also use gint instead of gint32 to be able to use reference counting for ABI-fixed structures with gint/guint. * glib/gthread.h: Adapted accordingly. * tests/atomic-test.c: Updated to test for G_MAXINT and G_MININT.
Diffstat (limited to 'tests')
-rw-r--r--tests/atomic-test.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/atomic-test.c b/tests/atomic-test.c
index 0f94788d0..323fec83f 100644
--- a/tests/atomic-test.c
+++ b/tests/atomic-test.c
@@ -11,7 +11,7 @@ main (int argc,
char *argv[])
{
gint i;
- gint32 atomic = -5;
+ gint atomic = -5;
gpointer atomic_pointer = NULL;
gpointer biggest_pointer = atomic_pointer - 1;
@@ -43,6 +43,12 @@ main (int argc,
g_assert (!g_atomic_int_compare_and_exchange (&atomic, 42, 12));
g_assert (atomic == 20);
+ g_assert (g_atomic_int_compare_and_exchange (&atomic, 20, G_MAXINT));
+ g_assert (atomic == G_MAXINT);
+
+ g_assert (g_atomic_int_compare_and_exchange (&atomic, G_MAXINT, G_MININT));
+ g_assert (atomic == G_MININT);
+
g_assert (g_atomic_pointer_compare_and_exchange (&atomic_pointer,
NULL, biggest_pointer));
g_assert (atomic_pointer == biggest_pointer);