diff --git a/Knot.files b/Knot.files index d4c8c28620257cc1cc63a7e44b26d0b6f9ad17e1..3363946d1cd6ce57be4eb4103fbeb9aac857010a 100644 --- a/Knot.files +++ b/Knot.files @@ -253,3 +253,5 @@ src/libknot/tsig-op.c src/libknot/tsig-op.h src/libknot/util/conv.c src/libknot/util/conv.h +src/tests/libknot/libknot/tsig_tests.h +src/tests/libknot/libknot/tsig_tests.c diff --git a/src/Makefile.am b/src/Makefile.am index 2eee620c8efdc8a4e184a063c69733a6c062fbee..f4f2d6264ad5d5110f580c5da6c1562b55545239 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -116,6 +116,8 @@ unittests_libknot_SOURCES = \ tests/libknot/libknot/rdata_tests.h \ tests/libknot/libknot/rrset_tests.c \ tests/libknot/libknot/rrset_tests.h \ + tests/libknot/libknot/tsig_tests.c \ + tests/libknot/libknot/tsig_tests.h \ tests/libknot/libknot/zone_tests.c \ tests/libknot/libknot/zone_tests.h \ tests/libknot/libknot/zone_tree_tests.h\ diff --git a/src/tests/libknot/libknot/tsig_tests.c b/src/tests/libknot/libknot/tsig_tests.c new file mode 100644 index 0000000000000000000000000000000000000000..81b65637f4c3667b9dd668e9c412f55583114423 --- /dev/null +++ b/src/tests/libknot/libknot/tsig_tests.c @@ -0,0 +1,57 @@ +/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <assert.h> + +#include "tests/libknot/libknot/rrset_tests.h" +#include "libknot/common.h" +#include "libknot/util/descriptor.h" +#include "libknot/rrset.h" +#include "libknot/dname.h" +#include "libknot/rdata.h" +#include "libknot/util/utils.h" +#include "libknot/zone/node.h" +#include "libknot/util/debug.h" + + +#include "tsig_tests.h" + +static int knot_tsig_tests_count(int argc, char *argv[]); +static int knot_tsig_tests_run(int argc, char *argv[]); + +/*! Exported unit API. + */ +unit_api tsig_tests_api = { + "DNS library - tsig", //! Unit name + &knot_tsig_tests_count, //! Count scheduled tests + &knot_tsig_tests_run //! Run scheduled tests +}; + +static const int KNOT_TSIG_TEST_COUNT = 1; + +/*! This helper routine should report number of + * scheduled tests for given parameters. + */ +static int knot_tsig_tests_count(int argc, char *argv[]) +{ + return KNOT_TSIG_TEST_COUNT; +} + +/*! Run all scheduled tests for given parameters. + */ +static int knot_tsig_tests_run(int argc, char *argv[]) +{ +} diff --git a/src/tests/libknot/libknot/tsig_tests.h b/src/tests/libknot/libknot/tsig_tests.h new file mode 100644 index 0000000000000000000000000000000000000000..8ea15f617a5dd76cf6093ed8036c65db7e2c8ebb --- /dev/null +++ b/src/tests/libknot/libknot/tsig_tests.h @@ -0,0 +1,9 @@ +#ifndef TSIH_TESTS_H +#define TSIH_TESTS_H + +#include "common/libtap/tap_unit.h" + +/* Unit API. */ +unit_api tsig_tests_api; + +#endif // TSIH_TESTS_H diff --git a/src/tests/libknot/unittests_libknot.c b/src/tests/libknot/unittests_libknot.c index 62d4b90771fdcbbfc473846a87bb65e82602df54..d522e1db1498585f520fb57acaef3ad738867c28 100644 --- a/src/tests/libknot/unittests_libknot.c +++ b/src/tests/libknot/unittests_libknot.c @@ -33,6 +33,7 @@ #include "tests/libknot/libknot/query_tests.h" #include "tests/libknot/libknot/zonedb_tests.h" #include "tests/libknot/libknot/zone_tree_tests.h" +#include "tests/libknot/libknot/tsig_tests.h" // Run all loaded units int main(int argc, char *argv[]) @@ -58,6 +59,7 @@ int main(int argc, char *argv[]) &query_tests_api, &zonedb_tests_api, //! DNS library (zonedb) unit &zone_tree_tests_api, + &tsig_tests_api, NULL };