]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-resolve-tables: new "test", useful to print mappings
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 2 Feb 2015 01:12:46 +0000 (20:12 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 29 Jan 2016 17:13:08 +0000 (12:13 -0500)
.gitignore
Makefile.am
src/resolve/test-resolve-tables.c [new file with mode: 0644]

index b9db9784adf83feaa1da8274a1d2e54054a409de..586b3796b1b894b003749f71295b2d0a0999e262 100644 (file)
 /test-rbtree
 /test-replace-var
 /test-resolve
+/test-resolve-tables
 /test-ring
 /test-rlimit-util
 /test-sched-prio
index 57cfe932c89fc9a8af577785aaa1df6d03911805..20ea2145327623df70c84da65e862b04a36f8792 100644 (file)
@@ -1499,6 +1499,7 @@ tests += \
        test-af-list \
        test-arphrd-list \
        test-dns-domain \
+       test-resolve-tables \
        test-install-root \
        test-rlimit-util \
        test-signal-util
@@ -1663,6 +1664,17 @@ test_dns_domain_LDADD = \
        libsystemd-network.la \
        libshared.la
 
+test_resolve_tables_SOURCES = \
+       src/resolve/test-resolve-tables.c \
+       src/shared/test-tables.h \
+       src/resolve/dns-type.c \
+       src/resolve/dns-type.h \
+       src/resolve/dns_type-from-name.h \
+       src/resolve/dns_type-to-name.h
+
+test_resolve_tables_LDADD = \
+       libshared.la
+
 if ENABLE_EFI
 manual_tests += \
        test-boot-timestamp
diff --git a/src/resolve/test-resolve-tables.c b/src/resolve/test-resolve-tables.c
new file mode 100644 (file)
index 0000000..63660af
--- /dev/null
@@ -0,0 +1,27 @@
+/***
+  This file is part of systemd
+
+  Copyright 2013 Zbigniew Jędrzejewski-Szmek
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include "dns-type.h"
+#include "test-tables.h"
+
+int main(int argc, char **argv) {
+        test_table_sparse(dns_type, DNS_TYPE);
+
+        return EXIT_SUCCESS;
+}