aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSamuel Johnson <[email protected]>2025-11-18 23:26:07 -0500
committerSamuel Johnson <[email protected]>2025-11-18 23:26:07 -0500
commite57054801bdfe47be697f2e5a55aad2c06c0730d (patch)
tree86a803a00b5f411b58c07d4d47e25c9ca707a6e7 /tests
parent8518b3d1ac814837dbeed751112c1c9a66f86565 (diff)
Add query and question constructionfeat/query_construction
Diffstat (limited to 'tests')
-rw-r--r--tests/test_dns.c8
-rw-r--r--tests/test_dns.h1
-rw-r--r--tests/tests.c4
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)