From 7cb346a0e3f83bffa0bfba5b35ab5e8a27c0a9e2 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 9 Aug 2017 13:16:01 +0200 Subject: [PATCH 04/29] tests: And check for assertion due to invalid table name The old test would simply crash when attempting to use a resource with the invalid table name for the first time. With the validity checks, we now assert much earlier. Adapt the test to succeed if the check fails as expected. https://bugzilla.gnome.org/show_bug.cgi?id=785983 --- tests/test-gom-table-name.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test-gom-table-name.c b/tests/test-gom-table-name.c index 7c099d0..d17f661 100644 --- a/tests/test-gom-table-name.c +++ b/tests/test-gom-table-name.c @@ -156,6 +156,14 @@ table_name (void) char *s1, *s2; ItemResource *it; + if (!g_test_subprocess ()) { + /* Rerun this same test in a subprocess */ + g_test_trap_subprocess (NULL, 0, 0); + g_test_trap_assert_failed (); + g_test_trap_assert_stderr ("*CRITICAL*is_valid_table_name*failed*"); + return; + } + adapter = gom_adapter_new(); //ret = gom_adapter_open_sync(adapter, "file:test.db", &error); ret = gom_adapter_open_sync(adapter, ":memory:", &error); -- 2.21.1 (Apple Git-122.3)