diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_dns.c | 8 | ||||
| -rw-r--r-- | tests/test_dns.h | 1 | ||||
| -rw-r--r-- | tests/tests.c | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/tests/test_dns.c b/tests/test_dns.c index 1b15e1c..29ed05e 100644 --- a/tests/test_dns.c +++ b/tests/test_dns.c @@ -1,8 +1,12 @@ #include "dnslite.h" #include "unity.h" -void test_dnsl_encode_hostname (void) -{ +void test_dnsl_encode_hostname (void) { struct dnsl_error error; TEST_ASSERT_EQUAL_STRING_LEN("\x03\x64\x6e\x73\x06\x67\x6f\x6f\x67\x6c\x65\x03\x63\x6f\x6d\x00", dnsl_encode_hostname("dns.google.com", &error), 16); } + +void test_dnsl_construct_question_query (void) { + struct dnsl_error error; + dnsl_encode_hostname("git.paterissa.net", &error); +} diff --git a/tests/test_dns.h b/tests/test_dns.h index d481edf..cf6d961 100644 --- a/tests/test_dns.h +++ b/tests/test_dns.h @@ -2,5 +2,6 @@ #define DNSL_TESTS_DNS_H void test_dnsl_encode_hostname (void); +void test_dnsl_construct_question_query (void); #endif diff --git a/tests/tests.c b/tests/tests.c index 9ec1a84..d871f1d 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -7,7 +7,7 @@ void setUp (void) { struct dnsl_error error; - if(dnsl_socket_init(&error) != 0) + if(dnsl_init(&error) != 0) { printf("Could not initialize sockets: [%d] %s\n", error.code, error.msg); } @@ -15,7 +15,7 @@ void setUp (void) void tearDown (void) { - dnsl_socket_fini(); + dnsl_fini(); } int main (void) |
