diff --git a/src/common/libkvs/test/kvs_dir.c b/src/common/libkvs/test/kvs_dir.c index ab67612b4253..ece3f40ee8ed 100644 --- a/src/common/libkvs/test/kvs_dir.c +++ b/src/common/libkvs/test/kvs_dir.c @@ -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)))