summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/sntp/tests/sntptest.h
blob: eff6f6e99dcb5542aab6b9b5076197f1cf3d2095 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef SNTPTEST_H
#define SNTPTEST_H

#include "ntp_stdlib.h"
#include "sntp-opts.h"


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
OpenPOWER on IntegriCloud