summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/sntp/tests/sntptest.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/sntp/tests/sntptest.c')
-rw-r--r--contrib/ntp/sntp/tests/sntptest.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/contrib/ntp/sntp/tests/sntptest.c b/contrib/ntp/sntp/tests/sntptest.c
new file mode 100644
index 0000000..73c1ad2
--- /dev/null
+++ b/contrib/ntp/sntp/tests/sntptest.c
@@ -0,0 +1,33 @@
+
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "sntp-opts.h"
+#include "sntptest.h"
+
+void
+sntptest(void) {
+ optionSaveState(&sntpOptions);
+}
+
+
+void
+sntptest_destroy(void) {
+ 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);
+}
+
OpenPOWER on IntegriCloud