From 873997f35a991eee09ed91148a0cf332360380da Mon Sep 17 00:00:00 2001 From: Cy Schubert Date: Wed, 1 Jul 2015 03:12:13 +0000 Subject: Vendor import ntp-4.2.8p3. Approved by: delphij (implicit, using SO hat) Security: VuXML: 0d0f3050-1f69-11e5-9ba9-d050996490d0 Security: http://bugs.ntp.org/show_bug.cgi?id=2853 Security: https://www.kb.cert.org/vuls/id/668167 Security: http://support.ntp.org/bin/view/Main/SecurityNotice#June_2015_NTP_Security_Vulnerabi --- sntp/tests/sntptest.h | 52 ++++++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 28 deletions(-) (limited to 'sntp/tests/sntptest.h') 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 -- cgit v1.2.3