summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2013-12-01 21:50:56 -0500
committerRyan Lortie <desrt@desrt.ca>2013-12-01 23:38:11 -0500
commitdf3f799729212374364e90494a2f279a91f1e282 (patch)
treeb00445d7fb4d7195c2ad54a7e18c8fab4416f327
parenta552bb0659aea9703b2d3851b784e2e1e6c9a9d8 (diff)
downloaddconf-df3f799729212374364e90494a2f279a91f1e282.tar.gz
tests: remove another use of g_test_trap_fork()
-rw-r--r--tests/engine.c46
1 files changed, 20 insertions, 26 deletions
diff --git a/tests/engine.c b/tests/engine.c
index 0f85fdf..c523379 100644
--- a/tests/engine.c
+++ b/tests/engine.c
@@ -489,39 +489,33 @@ test_system_source (void)
g_assert (source != NULL);
/* Check to see that we get the warning about the missing file. */
- if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR))
- {
- g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
+ g_test_expect_message ("dconf", G_LOG_LEVEL_WARNING, "*gvdb does not exist; expect degraded performance*");
- /* Failing to open should return FALSE from refresh */
- reopened = dconf_engine_source_refresh (source);
- g_assert (!reopened);
- g_assert (source->values == NULL);
-
- /* Attempt the reopen to make sure we don't get two warnings.
- * We should see FALSE again since we go from NULL to NULL.
- */
- reopened = dconf_engine_source_refresh (source);
- g_assert (!reopened);
+ /* Failing to open should return FALSE from refresh */
+ reopened = dconf_engine_source_refresh (source);
+ g_assert (!reopened);
+ g_assert (source->values == NULL);
- /* Create the file after the fact and make sure it opens properly */
- first_table = dconf_mock_gvdb_table_new ();
- dconf_mock_gvdb_install ("/etc/dconf/db/site", first_table);
+ /* Attempt the reopen to make sure we don't get two warnings.
+ * We should see FALSE again since we go from NULL to NULL.
+ */
+ reopened = dconf_engine_source_refresh (source);
+ g_assert (!reopened);
- reopened = dconf_engine_source_refresh (source);
- g_assert (reopened);
- g_assert (source->values != NULL);
+ /* Create the file after the fact and make sure it opens properly */
+ first_table = dconf_mock_gvdb_table_new ();
+ dconf_mock_gvdb_install ("/etc/dconf/db/site", first_table);
- dconf_engine_source_free (source);
+ reopened = dconf_engine_source_refresh (source);
+ g_assert (reopened);
+ g_assert (source->values != NULL);
- exit (0);
- }
- g_test_trap_assert_passed ();
- /* Check that we only saw the warning, but only one time. */
- g_test_trap_assert_stderr ("*this gvdb does not exist; expect degraded performance*");
- g_test_trap_assert_stderr_unmatched ("*degraded*degraded*");
+ dconf_engine_source_free (source);
/* Create the file before the first refresh attempt */
+ source = dconf_engine_source_new ("system-db:site");
+ g_assert (source != NULL);
+
first_table = dconf_mock_gvdb_table_new ();
dconf_mock_gvdb_install ("/etc/dconf/db/site", first_table);
/* Hang on to a copy for ourselves for below... */