diff options
author | Daiki Ueno <dueno@redhat.com> | 2019-06-17 11:50:22 +0200 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2019-06-18 14:17:28 +0200 |
commit | 2b3581c234f0097a2598395d1e0012b4ddd9a5ba (patch) | |
tree | c17d52e720e8ac895b28c7c2c39ab2637d03e51f | |
parent | 6708ccf6126734b4d98cc849bc4542c45ffce191 (diff) |
tests: Don't assume / is not writable on Windows in test-token.c
-rw-r--r-- | trust/test-token.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/trust/test-token.c b/trust/test-token.c index a082ab7..4ff1f2f 100644 --- a/trust/test-token.c +++ b/trust/test-token.c @@ -240,11 +240,9 @@ test_not_writable (void) #ifdef OS_UNIX if (getuid () != 0) { -#endif token = p11_token_new (333, "/", "Label", P11_TOKEN_FLAG_NONE); assert (!p11_token_is_writable (token)); p11_token_free (token); -#ifdef OS_UNIX } #endif @@ -252,9 +250,13 @@ test_not_writable (void) assert (!p11_token_is_writable (token)); p11_token_free (token); - token = p11_token_new (333, "/non-existant", "Label", P11_TOKEN_FLAG_NONE); - assert (!p11_token_is_writable (token)); - p11_token_free (token); +#ifdef OS_UNIX + if (getuid () != 0) { + token = p11_token_new (333, "/non-existant", "Label", P11_TOKEN_FLAG_NONE); + assert (!p11_token_is_writable (token)); + p11_token_free (token); + } +#endif } static void |