summaryrefslogtreecommitdiff
path: root/sntp/tests/sntptest.h
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2015-07-01 03:12:13 +0000
committerCy Schubert <cy@FreeBSD.org>2015-07-01 03:12:13 +0000
commit873997f35a991eee09ed91148a0cf332360380da (patch)
tree5b1ffa3ad0e56e0e9f2991011729791ee86d7632 /sntp/tests/sntptest.h
parent4ba32eb5a8bf3455c09d1513ed2af8d2c861a6ba (diff)
Notes
Diffstat (limited to 'sntp/tests/sntptest.h')
-rw-r--r--sntp/tests/sntptest.h52
1 files changed, 24 insertions, 28 deletions
diff --git a/sntp/tests/sntptest.h b/sntp/tests/sntptest.h
index d5add9cbf465e..eff6f6e99dcb5 100644
--- a/sntp/tests/sntptest.h
+++ b/sntp/tests/sntptest.h
@@ -1,35 +1,31 @@
#ifndef SNTPTEST_H
#define SNTPTEST_H
-#include "tests_main.h"
-
-extern "C" {
#include "ntp_stdlib.h"
#include "sntp-opts.h"
-};
-
-class sntptest : public ntptest {
-protected:
- sntptest() {
- optionSaveState(&sntpOptions);
- }
-
- ~sntptest() {
- optionRestore(&sntpOptions);
- }
-
- void ActivateOption(const char* option, const char* argument) {
- const int ARGV_SIZE = 4;
-
- char* opts[ARGV_SIZE];
-
- opts[0] = estrdup("sntpopts");
- opts[1] = estrdup(option);
- opts[2] = estrdup(argument);
- opts[3] = estrdup("127.0.0.1");
-
- optionProcess(&sntpOptions, ARGV_SIZE, opts);
- }
-};
+
+
+sntptest() {
+ optionSaveState(&sntpOptions);
+}
+
+sntptest_destroy() {
+ optionRestore(&sntpOptions);
+}
+
+void ActivateOption(const char* option, const char* argument) {
+
+ const int ARGV_SIZE = 4;
+
+ char* opts[ARGV_SIZE];
+
+ opts[0] = estrdup("sntpopts");
+ opts[1] = estrdup(option);
+ opts[2] = estrdup(argument);
+ opts[3] = estrdup("127.0.0.1");
+
+ optionProcess(&sntpOptions, ARGV_SIZE, opts);
+}
+
#endif // SNTPTEST_H