Skip to content

Commit

Permalink
* NEW [unit test] unit test for env.
Browse files Browse the repository at this point in the history
Signed-off-by: Hermann0222 <yukang.wei@emqx.io>
  • Loading branch information
StargazerWayne committed Aug 10, 2023
1 parent e70d58f commit 203af1b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/supplemental/nanolib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ nng_test(hash_test)
nng_test(dbtree_test)
nng_test(cmd_test)
nng_test(conf_test)
nng_test(env_test)
nng_test(rule_test)
nng_test(lib_base64_test)

Expand Down
18 changes: 18 additions & 0 deletions src/supplemental/nanolib/env_test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "nng/supplemental/nanolib/env.h"

#include "nuts.h"

void
test_env(void)
{
conf *conf_test = NULL;
NUTS_TRUE((conf_test = nng_zalloc(sizeof(conf))) != NULL);

read_env_conf(conf_test);
conf_fini(conf_test);
}

NUTS_TESTS = {
{"test env", test_env},
{NULL, NULL}
};

0 comments on commit 203af1b

Please sign in to comment.