diff --git a/lib/src/clixon_err.c b/lib/src/clixon_err.c index 1b5fb732..660df968 100644 --- a/lib/src/clixon_err.c +++ b/lib/src/clixon_err.c @@ -149,19 +149,24 @@ clicon_err_reset(void) return 0; } +/*! Find error category struct given name + */ static struct clixon_err_cats * find_category(int category) { clixon_err_cats *cec = NULL; + int found = 0; if ((cec = _err_cat_list) != NULL){ do { - if (cec->cec_category == category) + if (cec->cec_category == category){ + found++; break; + } cec = NEXTQ(clixon_err_cats *, cec); } while (cec && cec != _err_cat_list); } - return cec; + return found?cec:NULL; } /*! Report an error. diff --git a/test/config.sh.in b/test/config.sh.in index bd213d7f..f7db74de 100755 --- a/test/config.sh.in +++ b/test/config.sh.in @@ -69,5 +69,6 @@ DATASTORE_TOP="config" # clixon yang revisions occuring in tests CLIXON_LIB_REV="2021-03-08" CLIXON_CONFIG_REV="2021-03-08" +CLIXON_RESTCONF_REV="2020-12-30" CLIXON_EXAMPLE_REV="2020-12-01" diff --git a/test/test_restconf.sh b/test/test_restconf.sh index 4af53375..7887b24b 100755 --- a/test/test_restconf.sh +++ b/test/test_restconf.sh @@ -33,7 +33,7 @@ if [ -d ${TOP_SRCDIR}/example/main/$y ]; then else cp /usr/local/share/clixon/$y $dir/ fi -y=clixon-restconf@2020-12-30.yang +y=clixon-restconf@${CLIXON_RESTCONF_REV}.yang if [ -d ${TOP_SRCDIR}/yang/clixon ]; then cp ${TOP_SRCDIR}/yang/clixon/$y $dir/ else