Skip to content

Commit

Permalink
libkvs/test: Add kvsdir corner case tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chu11 committed Aug 22, 2017
1 parent f2b1388 commit 7581258
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/common/libkvs/test/kvs_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ void test_empty (void)
ok (dir == NULL && errno == EINVAL,
"kvsdir_create with empty JSON objects fails with EINVAL");

errno = 0;
dir = kvsdir_create (NULL, NULL, "foo", "foo");
ok (dir == NULL && errno == EINVAL,
"kvsdir_create with bad JSON objects fails with EINVAL");

errno = 0;
dir = kvsdir_create (NULL, NULL, "foo",
"{\"data\":\"MQA=\",\"type\":\"FOO\",\"ver\":1}");
ok (dir == NULL && errno == EINVAL,
"kvsdir_create with non-dir treeobj fails with EINVAL");

if (!(o = treeobj_create_dir ()))
BAIL_OUT ("treeobj_create_dir failed");
if (!(s = json_dumps (o, JSON_COMPACT)))
Expand Down

0 comments on commit 7581258

Please sign in to comment.