Skip to content

Commit c7472ce

Browse files
committed
test-resolve-tables: new "test", useful to print mappings
1 parent fc8eec1 commit c7472ce

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@
251251
/test-rbtree
252252
/test-replace-var
253253
/test-resolve
254+
/test-resolve-tables
254255
/test-ring
255256
/test-rlimit-util
256257
/test-sched-prio

Makefile.am

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,6 +1499,7 @@ tests += \
14991499
test-af-list \
15001500
test-arphrd-list \
15011501
test-dns-domain \
1502+
test-resolve-tables \
15021503
test-install-root \
15031504
test-rlimit-util \
15041505
test-signal-util
@@ -1663,6 +1664,17 @@ test_dns_domain_LDADD = \
16631664
libsystemd-network.la \
16641665
libshared.la
16651666

1667+
test_resolve_tables_SOURCES = \
1668+
src/resolve/test-resolve-tables.c \
1669+
src/shared/test-tables.h \
1670+
src/resolve/dns-type.c \
1671+
src/resolve/dns-type.h \
1672+
src/resolve/dns_type-from-name.h \
1673+
src/resolve/dns_type-to-name.h
1674+
1675+
test_resolve_tables_LDADD = \
1676+
libshared.la
1677+
16661678
if ENABLE_EFI
16671679
manual_tests += \
16681680
test-boot-timestamp

src/resolve/test-resolve-tables.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/***
2+
This file is part of systemd
3+
4+
Copyright 2013 Zbigniew Jędrzejewski-Szmek
5+
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.
10+
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.
15+
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/>.
18+
***/
19+
20+
#include "dns-type.h"
21+
#include "test-tables.h"
22+
23+
int main(int argc, char **argv) {
24+
test_table_sparse(dns_type, DNS_TYPE);
25+
26+
return EXIT_SUCCESS;
27+
}

0 commit comments

Comments
 (0)