summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-25 21:15:07 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-25 22:00:07 +0100
commit7e8131e9c6c150732503899a092206578fdc13de (patch)
tree4fdf956859911c9e4368a8e018e798465025920b /src/test
parentdc477e7385e8ab29efb8fadb72ec994077a105c6 (diff)
dns-domain: change dns_srv_type_is_valid() return value to bool
For similar reasons as dns_name_is_root() got changed in the previous commit.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-dns-domain.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/test/test-dns-domain.c b/src/test/test-dns-domain.c
index cefe8698c8..df34b72ab6 100644
--- a/src/test/test-dns-domain.c
+++ b/src/test/test-dns-domain.c
@@ -327,27 +327,27 @@ static void test_dns_service_name_is_valid(void) {
assert_se(!dns_service_name_is_valid("this is an overly long string that is certainly longer than 63 characters"));
}
-static void test_dns_srv_type_verify(void) {
-
- assert_se(dns_srv_type_verify("_http._tcp") > 0);
- assert_se(dns_srv_type_verify("_foo-bar._tcp") > 0);
- assert_se(dns_srv_type_verify("_w._udp") > 0);
- assert_se(dns_srv_type_verify("_a800._tcp") > 0);
- assert_se(dns_srv_type_verify("_a-800._tcp") > 0);
-
- assert_se(dns_srv_type_verify(NULL) == 0);
- assert_se(dns_srv_type_verify("") == 0);
- assert_se(dns_srv_type_verify("x") == 0);
- assert_se(dns_srv_type_verify("_foo") == 0);
- assert_se(dns_srv_type_verify("_tcp") == 0);
- assert_se(dns_srv_type_verify("_") == 0);
- assert_se(dns_srv_type_verify("_foo.") == 0);
- assert_se(dns_srv_type_verify("_föo._tcp") == 0);
- assert_se(dns_srv_type_verify("_f\no._tcp") == 0);
- assert_se(dns_srv_type_verify("_800._tcp") == 0);
- assert_se(dns_srv_type_verify("_-800._tcp") == 0);
- assert_se(dns_srv_type_verify("_-foo._tcp") == 0);
- assert_se(dns_srv_type_verify("_piep._foo._udp") == 0);
+static void test_dns_srv_type_is_valid(void) {
+
+ assert_se(dns_srv_type_is_valid("_http._tcp"));
+ assert_se(dns_srv_type_is_valid("_foo-bar._tcp"));
+ assert_se(dns_srv_type_is_valid("_w._udp"));
+ assert_se(dns_srv_type_is_valid("_a800._tcp"));
+ assert_se(dns_srv_type_is_valid("_a-800._tcp"));
+
+ assert_se(!dns_srv_type_is_valid(NULL));
+ assert_se(!dns_srv_type_is_valid(""));
+ assert_se(!dns_srv_type_is_valid("x"));
+ assert_se(!dns_srv_type_is_valid("_foo"));
+ assert_se(!dns_srv_type_is_valid("_tcp"));
+ assert_se(!dns_srv_type_is_valid("_"));
+ assert_se(!dns_srv_type_is_valid("_foo."));
+ assert_se(!dns_srv_type_is_valid("_föo._tcp"));
+ assert_se(!dns_srv_type_is_valid("_f\no._tcp"));
+ assert_se(!dns_srv_type_is_valid("_800._tcp"));
+ assert_se(!dns_srv_type_is_valid("_-800._tcp"));
+ assert_se(!dns_srv_type_is_valid("_-foo._tcp"));
+ assert_se(!dns_srv_type_is_valid("_piep._foo._udp"));
}
static void test_dns_service_join_one(const char *a, const char *b, const char *c, int r, const char *d) {
@@ -443,7 +443,7 @@ int main(int argc, char *argv[]) {
test_dns_name_is_valid();
test_dns_name_to_wire_format();
test_dns_service_name_is_valid();
- test_dns_srv_type_verify();
+ test_dns_srv_type_is_valid();
test_dns_service_join();
test_dns_service_split();
test_dns_name_change_suffix();