[glib] Improve testutils test coverage
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Improve testutils test coverage
- Date: Mon, 23 Aug 2010 04:39:27 +0000 (UTC)
commit 780d6bfa88900fa5a01375467b0cbb686f7b1d1f
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Aug 23 00:37:52 2010 -0400
Improve testutils test coverage
glib/tests/testing.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/glib/tests/testing.c b/glib/tests/testing.c
index 6b5be0b..2b257f2 100644
--- a/glib/tests/testing.c
+++ b/glib/tests/testing.c
@@ -46,6 +46,19 @@ test_assertions (void)
g_assert_cmpstr ("fzz", >, "faa");
g_assert_cmpstr ("fzz", ==, "fzz");
+ if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR))
+ {
+ g_assert_cmpstr ("fzz", !=, "fzz");
+ }
+ g_test_trap_assert_failed ();
+ g_test_trap_assert_stderr ("*assertion failed*");
+
+ if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR))
+ {
+ g_assert_cmpint (4, !=, 4);
+ }
+ g_test_trap_assert_failed ();
+ g_test_trap_assert_stderr ("*assertion failed*");
}
/* test g_test_timer* API */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]