diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-11-29 14:29:31 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-30 19:42:35 +0100 |
commit | c6cefd13eb55c8124a01e90021282f8610a05012 (patch) | |
tree | d1bc3022f1467030ffd53263a003ba726d817139 /src/test/test-dns-domain.c | |
parent | 1dfbf0007af3023c2e3ae8282a0d0f229f3a89e3 (diff) |
dns-domain: make sure dns_name_to_wire_format() may properly encode the root domain
The root domain consists of zero labels, and we should be able to encode
that.
Diffstat (limited to 'src/test/test-dns-domain.c')
-rw-r--r-- | src/test/test-dns-domain.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/test-dns-domain.c b/src/test/test-dns-domain.c index 3e470c0ef2..0762faa9a7 100644 --- a/src/test/test-dns-domain.c +++ b/src/test/test-dns-domain.c @@ -66,11 +66,12 @@ static void test_dns_name_to_wire_format_one(const char *what, const char *expec } static void test_dns_name_to_wire_format(void) { + const char out0[] = { 0 }; const char out1[] = { 3, 'f', 'o', 'o', 0 }; const char out2[] = { 5, 'h', 'a', 'l', 'l', 'o', 3, 'f', 'o', 'o', 3, 'b', 'a', 'r', 0 }; const char out3[] = { 4, ' ', 'f', 'o', 'o', 3, 'b', 'a', 'r', 0 }; - test_dns_name_to_wire_format_one("", NULL, 0, -EINVAL); + test_dns_name_to_wire_format_one("", out0, sizeof(out0), sizeof(out0)); test_dns_name_to_wire_format_one("foo", out1, sizeof(out1), sizeof(out1)); test_dns_name_to_wire_format_one("foo", out1, sizeof(out1) + 1, sizeof(out1)); |