xref: /freebsd/contrib/ntp/sntp/tests/sntptest.c (revision d8a0fe102c0cfdfcd5b818f850eff09d8536c9bc)
1 
2 #include "config.h"
3 #include "ntp_stdlib.h"
4 #include "sntp-opts.h"
5 #include "sntptest.h"
6 
7 void
8 sntptest(void) {
9 	optionSaveState(&sntpOptions);
10 }
11 
12 
13 void
14 sntptest_destroy(void) {
15 	optionRestore(&sntpOptions);
16 }
17 
18 
19 void
20 ActivateOption(const char* option, const char* argument) {
21 
22 	const int ARGV_SIZE = 4;
23 
24 	char* opts[ARGV_SIZE];
25 
26 	opts[0] = estrdup("sntpopts");
27 	opts[1] = estrdup(option);
28 	opts[2] = estrdup(argument);
29 	opts[3] = estrdup("127.0.0.1");
30 
31 	optionProcess(&sntpOptions, ARGV_SIZE, opts);
32 }
33 
34