coverage: added tests for all ints

This commit is contained in:
Olof hagsand 2021-10-06 08:36:34 +02:00
parent 26d37352f4
commit 7631c3f0a3
3 changed files with 53 additions and 8 deletions

View file

@ -206,10 +206,17 @@ clixon_stats_get_db(clicon_handle h,
cxobj *xt = NULL;
uint64_t nr = 0;
size_t sz = 0;
cxobj *xn = NULL;
/* This is the db cache */
if ((xt = xmldb_cache_get(h, dbname)) == NULL){
if ((xt = xmldb_cache_get(h, dbname)) == NULL){
/* Trigger cache if no exist */
if (xmldb_get(h, dbname, NULL, "/", &xn) < 0)
goto done;
xt = xmldb_cache_get(h, dbname);
}
if (xt == NULL){
cprintf(cb, "<datastore><name>%s</name><nr>0</nr><size>0</size></datastore>", dbname);
}
else{
@ -221,6 +228,8 @@ clixon_stats_get_db(clicon_handle h,
}
retval = 0;
done:
if (xn)
xml_free(xn);
return retval;
}