summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--trust/test-token.c12
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