[glib: 3/11] tests: Port closure-refcount to g_test_message() from g_print()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 3/11] tests: Port closure-refcount to g_test_message() from g_print()
- Date: Wed, 27 Feb 2019 16:48:26 +0000 (UTC)
commit b4aadf6557077728db4f9650ac1ca84c311a0aaa
Author: Philip Withnall <withnall endlessm com>
Date: Wed Feb 27 11:52:26 2019 +0000
tests: Port closure-refcount to g_test_message() from g_print()
This allows more structured test output.
Signed-off-by: Philip Withnall <withnall endlessm com>
gobject/tests/closure-refcount.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gobject/tests/closure-refcount.c b/gobject/tests/closure-refcount.c
index e7d79703a..ac7a7a9ca 100644
--- a/gobject/tests/closure-refcount.c
+++ b/gobject/tests/closure-refcount.c
@@ -64,7 +64,7 @@ static gboolean seen_thread2 = FALSE;
static void
my_test_init (GTest * test)
{
- g_print ("init %p\n", test);
+ g_test_message ("Init %p", test);
test->value = 0;
test->test_pointer1 = TEST_POINTER1;
@@ -175,7 +175,7 @@ thread1_main (gpointer data)
test_closure (closure);
if (++count % 10000 == 0)
{
- g_printerr ("c");
+ g_test_message ("Yielding from thread1");
g_thread_yield(); /* force context switch */
seen_thread1 = TRUE;
}
@@ -193,7 +193,7 @@ thread2_main (gpointer data)
test_closure (closure);
if (++count % 10000 == 0)
{
- g_printerr ("C");
+ g_test_message ("Yielding from thread2");
g_thread_yield(); /* force context switch */
seen_thread2 = TRUE;
}
@@ -269,13 +269,13 @@ test_closure_refcount (void)
test_emissions (object);
if (++count % 10000 == 0)
{
- g_printerr (".\n");
+ g_test_message ("Yielding from main thread");
g_thread_yield(); /* force context switch */
}
}
stopping = TRUE;
- g_print ("\nstopping\n");
+ g_test_message ("Stopping");
/* wait for thread shutdown */
g_thread_join (thread1);
@@ -284,7 +284,7 @@ test_closure_refcount (void)
/* finalize object, destroy signals, run cleanup code */
g_object_unref (object);
- g_print ("stopped\n");
+ g_test_message ("Stopped");
g_assert (seen_thread1 != FALSE);
g_assert (seen_thread2 != FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]