]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/resolve/test-resolve-tables.c
2 This file is part of systemd
4 Copyright 2013 Zbigniew Jędrzejewski-Szmek
6 systemd is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
11 systemd is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public License
17 along with systemd; If not, see <http://www.gnu.org/licenses/>.
21 #include "test-tables.h"
23 int main(int argc
, char **argv
) {
26 test_table_sparse(dns_type
, DNS_TYPE
);
28 log_info("/* DNS_TYPE */");
29 for (i
= 0; i
< _DNS_TYPE_MAX
; i
++) {
32 s
= dns_type_to_string(i
);
33 assert_se(s
== NULL
|| strlen(s
) < _DNS_TYPE_STRING_MAX
);
36 log_info("%-*s %s%s%s%s%s%s%s%s%s",
37 (int) _DNS_TYPE_STRING_MAX
- 1, s
,
38 dns_type_is_pseudo(i
) ? "pseudo " : "",
39 dns_type_is_valid_query(i
) ? "valid_query " : "",
40 dns_type_is_valid_rr(i
) ? "is_valid_rr " : "",
41 dns_type_may_redirect(i
) ? "may_redirect " : "",
42 dns_type_is_dnssec(i
) ? "dnssec " : "",
43 dns_type_is_obsolete(i
) ? "obsolete " : "",
44 dns_type_may_wildcard(i
) ? "wildcard " : "",
45 dns_type_apex_only(i
) ? "apex_only " : "",
46 dns_type_needs_authentication(i
) ? "needs_authentication" : "");
49 log_info("/* DNS_CLASS */");
50 for (i
= 0; i
< _DNS_CLASS_MAX
; i
++) {
53 s
= dns_class_to_string(i
);
54 assert_se(s
== NULL
|| strlen(s
) < _DNS_CLASS_STRING_MAX
);
58 (int) _DNS_CLASS_STRING_MAX
- 1, s
,
59 dns_class_is_pseudo(i
) ? "is_pseudo " : "",
60 dns_class_is_valid_rr(i
) ? "is_valid_rr " : "");