From: Andrew Zaborowski <andrew.zaborowski@intel.com>
To: ell@lists.linux.dev
Subject: [PATCH 2/6] unit: Update net_domain_list_parse test
Date: Tue, 20 Sep 2022 15:31:57 +0200 [thread overview]
Message-ID: <20220920133201.3303119-2-andrew.zaborowski@intel.com> (raw)
In-Reply-To: <20220920133201.3303119-1-andrew.zaborowski@intel.com>
---
unit/test-net.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/unit/test-net.c b/unit/test-net.c
index ff5d2b0..f3f1522 100644
--- a/unit/test-net.c
+++ b/unit/test-net.c
@@ -113,11 +113,13 @@ static void test_net_domain_list_parse(const void *data)
static const uint8_t l1[] = { 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e',
3, 'c', 'o', 'm', 0,
4, 't', 'e', 's', 't', 0 };
- static const uint8_t l2[] = { 0, 0};
+ static const uint8_t l2[] = { 0, 0 };
static const uint8_t l3[] = { 4, '.', '=', '2', '3', 0 };
+ static const uint8_t l4[] = { 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e',
+ 3, 'c', 'o', 'm', 0, 0 };
char **domains;
- domains = net_domain_list_parse(l1, sizeof(l1));
+ domains = net_domain_list_parse(l1, sizeof(l1), false);
assert(domains);
assert(domains[0]);
assert(!strcmp(domains[0], "example.com"));
@@ -126,14 +128,21 @@ static void test_net_domain_list_parse(const void *data)
assert(!domains[2]);
l_strfreev(domains);
- assert(!net_domain_list_parse(l2, sizeof(l2)));
+ assert(!net_domain_list_parse(l2, sizeof(l2), false));
- domains = net_domain_list_parse(l3, sizeof(l3));
+ domains = net_domain_list_parse(l3, sizeof(l3), false);
assert(domains);
assert(domains[0]);
assert(!strcmp(domains[0], "\\.\\06123"));
assert(!domains[1]);
l_strfreev(domains);
+
+ domains = net_domain_list_parse(l4, sizeof(l4), true);
+ assert(domains);
+ assert(domains[0]);
+ assert(!strcmp(domains[0], "example.com"));
+ assert(!domains[1]);
+ l_strfreev(domains);
}
int main(int argc, char *argv[])
--
2.34.1
next prev parent reply other threads:[~2022-09-20 13:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-20 13:31 [PATCH 1/6] net: Allow padding in net_domain_list_parse Andrew Zaborowski
2022-09-20 13:31 ` Andrew Zaborowski [this message]
2022-09-20 13:31 ` [PATCH 3/6] netconfig: Set .v6_configured when we set an address Andrew Zaborowski
2022-09-20 13:31 ` [PATCH 4/6] netconfig: Handle DNS data from l_icmp6_router Andrew Zaborowski
2022-09-20 13:32 ` [PATCH 5/6] icmp6,netconfig: Skip SLLAO if RS sent from optimistic address Andrew Zaborowski
2022-09-20 13:32 ` [PATCH 6/6] netconfig: Handle missing optimistic_dad /proc file Andrew Zaborowski
2022-09-20 15:06 ` [PATCH 1/6] net: Allow padding in net_domain_list_parse Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220920133201.3303119-2-andrew.zaborowski@intel.com \
--to=andrew.zaborowski@intel.com \
--cc=ell@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).