From 229cf18051fd73b496d268f1864502cbd964a6df Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Mon, 21 Aug 2017 21:23:03 -0700 Subject: [PATCH] libkvs/test/kvs_dir: Add extra corner case test --- src/common/libkvs/test/kvs_dir.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/libkvs/test/kvs_dir.c b/src/common/libkvs/test/kvs_dir.c index ece3f40ee8ed..cc51f5704d76 100644 --- a/src/common/libkvs/test/kvs_dir.c +++ b/src/common/libkvs/test/kvs_dir.c @@ -47,6 +47,12 @@ void test_empty (void) errno = 0; dir = kvsdir_create (NULL, NULL, "foo", "{\"data\":\"MQA=\",\"type\":\"FOO\",\"ver\":1}"); + ok (dir == NULL && errno == EINVAL, + "kvsdir_create with invalid treeobj fails with EINVAL"); + + errno = 0; + dir = kvsdir_create (NULL, NULL, "foo", + "{\"data\":\"MQA=\",\"type\":\"val\",\"ver\":1}"); ok (dir == NULL && errno == EINVAL, "kvsdir_create with non-dir treeobj fails with EINVAL");