Skip to content

Commit

Permalink
tests: Don't assume / is not writable on Windows in test-token.c
Browse files Browse the repository at this point in the history
  • Loading branch information
ueno committed Jun 18, 2019
1 parent 6708ccf commit 2b3581c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions trust/test-token.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,21 +240,23 @@ 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

token = p11_token_new (333, "", "Label", P11_TOKEN_FLAG_NONE);
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
Expand Down

0 comments on commit 2b3581c

Please sign in to comment.