summaryrefslogtreecommitdiff
path: root/tests/unit_test_sample.c
diff options
context:
space:
mode:
authorShane Kerr <shane@isc.org>2007-11-16 11:04:12 +0000
committerShane Kerr <shane@isc.org>2007-11-16 11:04:12 +0000
commit6e999c3c8a96354e088da8a5a35c9ab92f419ec7 (patch)
tree375ea7f6ca88c7732d4e675d2d52b3f3693e21ec /tests/unit_test_sample.c
parentb9ced0286885a375857acb742091a10a787b07c7 (diff)
downloadisc-dhcp-6e999c3c8a96354e088da8a5a35c9ab92f419ec7.tar.gz
Unit test framework now added.
See RT ticket #17223 for more.
Diffstat (limited to 'tests/unit_test_sample.c')
-rw-r--r--tests/unit_test_sample.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/unit_test_sample.c b/tests/unit_test_sample.c
new file mode 100644
index 00000000..86d63365
--- /dev/null
+++ b/tests/unit_test_sample.c
@@ -0,0 +1,25 @@
+#include "config.h"
+#include "t_api.h"
+
+static void foo(void);
+
+/*
+ * T_testlist is a list of tests that are invoked.
+ */
+testspec_t T_testlist[] = {
+ { foo, "sample test" },
+ { NULL, NULL }
+};
+
+static void
+foo(void) {
+ static const char *test_desc =
+ "this is an example test, for no actual module";
+
+ t_assert("sample", 1, T_REQUIRED, test_desc);
+
+ /* ... */ /* Test code would go here. */
+
+ t_result(T_PASS);
+}
+