|
unbound 0.1
|
Calls dname unit tests. More...
#include "config.h"#include <ctype.h>#include "util/log.h"#include "testcode/unitmain.h"#include "util/data/dname.h"#include "sldns/sbuffer.h"#include "sldns/str2wire.h"#include "sldns/wire2str.h"Functions | |
| static sldns_buffer * | dname_to_buf (sldns_buffer *b, const char *str) |
| put dname into buffer | |
| static void | dname_test_qdl (sldns_buffer *buff) |
| test query_dname_len function | |
| static void | dname_test_qdtl (sldns_buffer *buff) |
| test query_dname_tolower | |
| static void | dname_test_query_dname_compare (void) |
| test query_dname_compare | |
| static void | dname_test_count_labels (void) |
| test dname_count_labels | |
| static void | dname_test_count_size_labels (void) |
| test dname_count_size_labels | |
| static void | dname_test_pkt_dname_len (sldns_buffer *buff) |
| test pkt_dname_len | |
| static void | dname_test_pkt_dname_len_budget (sldns_buffer *buff) |
| test pkt_dname_len_budget | |
| static void | dname_test_dname_lab_cmp (void) |
| test dname_lab_cmp | |
| static void | dname_test_subdomain (void) |
| test dname_subdomain_c | |
| static void | dname_test_strict_subdomain (void) |
| test dname_strict_subdomain | |
| static void | dname_test_isroot (void) |
| test dname_is_root | |
| static void | dname_test_removelabel (void) |
| test dname_remove_label | |
| static void | dname_test_removelabellimitlen (void) |
| test dname_remove_label_limit_len | |
| static void | dname_test_sigcount (void) |
| test dname_signame_label_count | |
| static void | dname_test_iswild (void) |
| test dname_is_wild routine | |
| static void | dname_test_canoncmp (void) |
| test dname_canonical_compare | |
| static void | dname_test_topdomain (void) |
| Test dname_get_shared_topdomain. | |
| static void | dname_test_valid (void) |
| Test dname_valid. | |
| static void | dname_test_has_label (void) |
| Test dname_has_label. | |
| static void | dname_test_pdtl (sldns_buffer *loopbuf, sldns_buffer *boundbuf) |
| test pkt_dname_tolower | |
| static void | dname_setup_bufs (sldns_buffer *loopbuf, sldns_buffer *boundbuf) |
| setup looped dname and out-of-bounds dname ptr | |
| static void | test_long_names (void) |
| Test dname to string with long domain names. | |
| static void | dname_test_str (sldns_buffer *buff) |
| void | dname_test (void) |
| unit test dname handling functions | |
Variables | |
| char | desc_1 [] = "Domain is 1 octet too long." |
| uint8_t | wire_dom_1 [] |
| char | desc_2 [] = "Domain has the maximum allowed length (255)." |
| uint8_t | wire_dom_2 [] |
| char | desc_3 [] = "Domain has a length one label in the 255th position for a total of 257." |
| uint8_t | wire_dom_3 [] |
| char | desc_4 [] = "Domain has the maximum allowed length (255)." |
| uint8_t | wire_dom_4 [] |
| char | desc_5 [] = "Domain has a maximum length label (63) in the 255th position." |
| uint8_t | wire_dom_5 [] |
| char | desc_6 [] = "Domain has a too long label (65) in the 255th position." |
| uint8_t | wire_dom_6 [] |
| char | desc_7 [] = "Domain has a too long label (65) in the 187th position." |
| uint8_t | wire_dom_7 [] |
| char | desc_8 [] = "Domains has the maximum allowed length and ends with a maximum length label." |
| uint8_t | wire_dom_8 [] |
| char | desc_9 [] = "Domains has 254 octets, one less than the maximum allowed length." |
| uint8_t | wire_dom_9 [] |
Calls dname unit tests.
Exits with code 1 on a failure.
|
static |
put dname into buffer
References dname_to_buf(), fatal_exit(), sldns_buffer_begin(), sldns_buffer_capacity(), sldns_buffer_clear(), sldns_buffer_flip(), sldns_buffer_set_position(), sldns_get_errorstr_parse(), and sldns_str2wire_dname_buf().
Referenced by dname_test_qdl(), and dname_to_buf().
|
static |
test query_dname_len function
References dname_test_qdl(), dname_to_buf(), query_dname_len(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_qdl().
|
static |
test query_dname_tolower
References dname_test_qdtl(), query_dname_tolower(), sldns_buffer_begin(), sldns_buffer_write_at(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_qdtl().
|
static |
test query_dname_compare
References dname_test_query_dname_compare(), query_dname_compare(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_query_dname_compare().
|
static |
test dname_count_labels
References dname_count_labels(), dname_test_count_labels(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_count_labels().
|
static |
test dname_count_size_labels
References dname_count_size_labels(), dname_test_count_size_labels(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_count_size_labels().
|
static |
test pkt_dname_len
References dname_test_pkt_dname_len(), pkt_dname_len(), sldns_buffer_clear(), sldns_buffer_flip(), sldns_buffer_position(), sldns_buffer_set_position(), sldns_buffer_write(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_pkt_dname_len().
|
static |
test pkt_dname_len_budget
References dname_test_pkt_dname_len_budget(), pkt_dname_len_budget(), sldns_buffer_clear(), sldns_buffer_flip(), sldns_buffer_position(), sldns_buffer_set_position(), sldns_buffer_skip(), sldns_buffer_write(), sldns_buffer_write_u8(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_pkt_dname_len_budget().
|
static |
test dname_lab_cmp
References dname_lab_cmp(), dname_test_dname_lab_cmp(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_dname_lab_cmp().
|
static |
test dname_subdomain_c
References dname_subdomain_c(), dname_test_subdomain(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_subdomain().
|
static |
test dname_strict_subdomain
References dname_strict_subdomain(), dname_test_strict_subdomain(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_strict_subdomain().
|
static |
test dname_is_root
References dname_is_root(), dname_test_isroot(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_isroot().
|
static |
test dname_remove_label
References dname_remove_label(), dname_test_removelabel(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_removelabel().
|
static |
test dname_remove_label_limit_len
References dname_remove_label_limit_len(), dname_test_removelabellimitlen(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_removelabellimitlen().
|
static |
test dname_signame_label_count
References dname_signame_label_count(), dname_test_sigcount(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_sigcount().
|
static |
test dname_is_wild routine
References dname_is_wild(), dname_test_iswild(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_iswild().
|
static |
test dname_canonical_compare
References dname_canonical_compare(), dname_test_canoncmp(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_canoncmp().
|
static |
Test dname_get_shared_topdomain.
References dname_get_shared_topdomain(), dname_test_topdomain(), query_dname_compare(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_topdomain().
|
static |
Test dname_valid.
References dname_test_valid(), dname_valid(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_valid().
|
static |
Test dname_has_label.
References dname_has_label(), dname_test_has_label(), unit_assert, and unit_show_func().
Referenced by dname_test(), and dname_test_has_label().
|
static |
test pkt_dname_tolower
References dname_test_pdtl(), pkt_dname_tolower(), sldns_buffer_at(), and unit_show_func().
Referenced by dname_test(), and dname_test_pdtl().
|
static |
setup looped dname and out-of-bounds dname ptr
References dname_setup_bufs(), sldns_buffer_flip(), sldns_buffer_write_u16(), and sldns_buffer_write_u8().
Referenced by dname_setup_bufs(), and dname_test().
|
static |
Test dname to string with long domain names.
References dname_str(), sldns_wire2str_dname_buf(), test_long_names(), and unit_assert.
Referenced by test_long_names().
| void dname_test | ( | void | ) |
unit test dname handling functions
References dname_setup_bufs(), dname_test(), dname_test_canoncmp(), dname_test_count_labels(), dname_test_count_size_labels(), dname_test_dname_lab_cmp(), dname_test_has_label(), dname_test_isroot(), dname_test_iswild(), dname_test_pdtl(), dname_test_pkt_dname_len(), dname_test_pkt_dname_len_budget(), dname_test_qdl(), dname_test_qdtl(), dname_test_query_dname_compare(), dname_test_removelabel(), dname_test_removelabellimitlen(), dname_test_sigcount(), dname_test_strict_subdomain(), dname_test_subdomain(), dname_test_topdomain(), dname_test_valid(), sldns_buffer_flip(), sldns_buffer_free(), sldns_buffer_new(), and unit_assert.
Referenced by dname_test(), and main().
| uint8_t wire_dom_1[] |
| uint8_t wire_dom_2[] |
| uint8_t wire_dom_3[] |
| uint8_t wire_dom_4[] |
| uint8_t wire_dom_5[] |
| uint8_t wire_dom_6[] |
| uint8_t wire_dom_7[] |
| uint8_t wire_dom_8[] |
| uint8_t wire_dom_9[] |