mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 08:20:01 -04:00
add test for cfg_map_findclause()
Add a test for `cfg_map_findclause()` ensuring its correct behaviour (returning NULL) if a clause does not exists.
This commit is contained in:
parent
d1c55d78c6
commit
b13bd6cb85
1 changed files with 13 additions and 0 deletions
|
|
@ -303,6 +303,18 @@ view \"_bind\" chaos {\n\
|
|||
cfg_obj_detach(&clone);
|
||||
}
|
||||
|
||||
static const cfg_clausedef_t *const empty_clausesets[] = { NULL };
|
||||
|
||||
static cfg_type_t cfg_type_empty_map = {
|
||||
"empty_map", NULL, NULL, NULL, &cfg_rep_map, &empty_clausesets,
|
||||
};
|
||||
|
||||
ISC_RUN_TEST_IMPL(cfg_map_findclause_empty) {
|
||||
const cfg_clausedef_t *result = cfg_map_findclause(&cfg_type_empty_map,
|
||||
"anything");
|
||||
assert_null(result);
|
||||
}
|
||||
|
||||
ISC_TEST_LIST_START
|
||||
|
||||
ISC_TEST_ENTRY(addzoneconf)
|
||||
|
|
@ -310,6 +322,7 @@ ISC_TEST_ENTRY(parse_buffer)
|
|||
ISC_TEST_ENTRY(cfg_map_firstclause)
|
||||
ISC_TEST_ENTRY(cfg_map_nextclause)
|
||||
ISC_TEST_ENTRY(cfg_clone_copy)
|
||||
ISC_TEST_ENTRY(cfg_map_findclause_empty)
|
||||
|
||||
ISC_TEST_LIST_END
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue