tests: replace most g_print() with g_printerr()

I searched all files that mention g_test_run, and replaced most
g_print() calls. This avoids interfering with TAP. Exceptions:

* gio/tests/network-monitor: a manual mode that is run by
  "./network-monitor --watch" is unaffected
* glib/gtester.c: not a test
* glib/gtestutils.c: not a test
* glib/tests/logging.c: specifically exercising g_print()
* glib/tests/markup-parse.c: a manual mode that is run by
  "./markup-parse --cdata-as-text" is unaffected
* glib/tests/testing.c: specifically exercising capture of stdout
  in subprocesses
* glib/tests/utils.c: captures a subprocess's stdout
* glib/tests/testglib.c: exercises an assertion failure in g_print()

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=725981
Reviewed-by: Colin Walters <walters@verbum.org>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
Simon McVittie
2015-05-11 17:03:00 +01:00
parent 064183a633
commit 45dae4b506
29 changed files with 176 additions and 176 deletions

View File

@@ -29,7 +29,7 @@ test_object_init (TestObject *self)
TestObjectPrivate *priv = test_object_get_instance_private (self);
if (g_test_verbose ())
g_print ("Offset of %sPrivate for type '%s': %d\n",
g_printerr ("Offset of %sPrivate for type '%s': %d\n",
G_OBJECT_TYPE_NAME (self),
G_OBJECT_TYPE_NAME (self),
TestObject_private_offset);
@@ -93,7 +93,7 @@ test_derived_init (TestDerived *self)
TestDerivedPrivate *priv = test_derived_get_instance_private (self);
if (g_test_verbose ())
g_print ("Offset of %sPrivate for type '%s': %d\n",
g_printerr ("Offset of %sPrivate for type '%s': %d\n",
G_OBJECT_TYPE_NAME (self),
G_OBJECT_TYPE_NAME (self),
TestDerived_private_offset);
@@ -137,7 +137,7 @@ test_mixed_init (TestMixed *self)
TestMixedPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self, test_mixed_get_type (), TestMixedPrivate);
if (g_test_verbose ())
g_print ("Offset of %sPrivate for type '%s': %d\n",
g_printerr ("Offset of %sPrivate for type '%s': %d\n",
G_OBJECT_TYPE_NAME (self),
G_OBJECT_TYPE_NAME (self),
TestMixed_private_offset);
@@ -181,7 +181,7 @@ test_mixed_derived_init (TestMixedDerived *self)
TestMixedDerivedPrivate *priv = test_mixed_derived_get_instance_private (self);
if (g_test_verbose ())
g_print ("Offset of %sPrivate for type '%s': %d\n",
g_printerr ("Offset of %sPrivate for type '%s': %d\n",
G_OBJECT_TYPE_NAME (self),
G_OBJECT_TYPE_NAME (self),
TestMixedDerived_private_offset);