From 2b3581c234f0097a2598395d1e0012b4ddd9a5ba Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Mon, 17 Jun 2019 11:50:22 +0200 Subject: tests: Don't assume / is not writable on Windows in test-token.c --- trust/test-token.c | 12 +++++++----- 1 file 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 -- cgit v1.1