Calls ldns unit tests. More...
#include "config.h"#include "util/log.h"#include "testcode/unitmain.h"#include "sldns/sbuffer.h"#include "sldns/str2wire.h"#include "sldns/wire2str.h"#include "sldns/parseutil.h"Macros | |
| #define | xstr(s) str(s) |
| #define | str(s) #s |
| #define | SRCDIRSTR xstr(SRCDIR) |
Functions | |
| static void | buf_to_hex (uint8_t *b, size_t blen, char *s, size_t slen) |
| print buffer to hex into string | |
| static void | rr_transform (char *txt_in, char *wire1, char *txt_out, char *wire2, size_t bufs) |
| Transform input. | |
| static void | rr_checks (char *wire_chk, char *txt_chk, char *txt_out, char *wire_out, char *back) |
| Check if results are correct. | |
| static void | rr_test_file (const char *input, const char *check) |
| read rrs to and from string, and wireformat Skips empty lines and comments. | |
| static void | rr_tests (void) |
| read rrs to and from string, to and from wireformat | |
| static void | b64_test (void) |
| test various base64 decoding options | |
| void | ldns_test (void) |
| unit test for ldns functions | |
Variables | |
| static int | vbmp = 0 |
| verbose this unit test | |
Calls ldns unit tests.
Exits with code 1 on a failure.
|
static |
Transform input.
| txt_in | input text format. |
| wire1 | output wireformat in hex (txt_in converted to wire). |
| txt_out | output text format (converted from wire_out). |
| wire2 | output wireformat in hex, txt_out converted back to wireformat. |
| bufs | size of the text buffers. |
References buf_to_hex(), sldns_get_errorstr_parse(), sldns_str2wire_rr_buf(), sldns_wire2str_rr_buf(), unit_assert, and vbmp.
Referenced by rr_test_file().
|
static |
read rrs to and from string, and wireformat Skips empty lines and comments.
| input | input file with text format. |
| check | check file with hex and then textformat |
References fatal_exit(), rr_checks(), rr_transform(), unit_assert, and vbmp.
Referenced by rr_tests().