diff options
| author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2017-01-17 20:41:17 +0000 |
|---|---|---|
| committer | Simon McVittie <smcv@collabora.com> | 2017-04-07 12:07:01 +0100 |
| commit | 40560fa0c7ec921c8144296c72a80d20f403b8bf (patch) | |
| tree | 669ec1db2dc0fac371e3ff494815119b1ec9b6e7 /test | |
| parent | ec6cf23718db402fd2c48cf1a76749d999af8fd2 (diff) | |
test, tools: assert impossible values of local enums are not reached
Based on part of a patch from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Diffstat (limited to 'test')
| -rw-r--r-- | test/test-utils-glib.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/test-utils-glib.c b/test/test-utils-glib.c index e13d20d3..bb481952 100644 --- a/test/test-utils-glib.c +++ b/test/test-utils-glib.c @@ -151,6 +151,8 @@ spawn_dbus_daemon (const gchar *binary, break; + case TEST_USER_ME: + /* cannot get here, fall through */ default: g_assert_not_reached (); } @@ -409,10 +411,15 @@ test_connect_to_bus_as_user (TestMainContext *ctx, case TEST_USER_ME: return test_connect_to_bus (ctx, address); - default: + case TEST_USER_ROOT: + case TEST_USER_MESSAGEBUS: + case TEST_USER_OTHER: g_test_skip ("setresuid() not available, or unsure about " "credentials-passing semantics on this platform"); return NULL; + + default: + g_return_val_if_reached (NULL); } #endif |
