aboutsummaryrefslogtreecommitdiff
path: root/tests/test_dns.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_dns.c')
-rw-r--r--tests/test_dns.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_dns.c b/tests/test_dns.c
new file mode 100644
index 0000000..1b15e1c
--- /dev/null
+++ b/tests/test_dns.c
@@ -0,0 +1,8 @@
+#include "dnslite.h"
+#include "unity.h"
+
+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);
+}