diff options
author | glebius <glebius@FreeBSD.org> | 2015-10-26 11:35:40 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2015-10-26 11:35:40 +0000 |
commit | c62812877398840dae0ba74b03e9e6a43cc56fc5 (patch) | |
tree | 304551aa93f09787d4f56a966c6409faf1b1bcb0 /contrib/ntp/sntp/tests/kodDatabase.c | |
parent | 9e809ce638c9be9ffb800ced1b91c0e8997f4c9e (diff) | |
download | FreeBSD-src-c62812877398840dae0ba74b03e9e6a43cc56fc5.zip FreeBSD-src-c62812877398840dae0ba74b03e9e6a43cc56fc5.tar.gz |
Upgrade NTP to 4.2.8p4.
Security: FreeBSD-SA-15:25.ntp
Security: CVE-2015-7871
Security: CVE-2015-7855
Security: CVE-2015-7854
Security: CVE-2015-7853
Security: CVE-2015-7852
Security: CVE-2015-7851
Security: CVE-2015-7850
Security: CVE-2015-7849
Security: CVE-2015-7848
Security: CVE-2015-7701
Security: CVE-2015-7703
Security: CVE-2015-7704, CVE-2015-7705
Security: CVE-2015-7691, CVE-2015-7692, CVE-2015-7702
Diffstat (limited to 'contrib/ntp/sntp/tests/kodDatabase.c')
-rw-r--r-- | contrib/ntp/sntp/tests/kodDatabase.c | 73 |
1 files changed, 43 insertions, 30 deletions
diff --git a/contrib/ntp/sntp/tests/kodDatabase.c b/contrib/ntp/sntp/tests/kodDatabase.c index a6b86d0..0c3615d 100644 --- a/contrib/ntp/sntp/tests/kodDatabase.c +++ b/contrib/ntp/sntp/tests/kodDatabase.c @@ -4,24 +4,29 @@ #include "sntptest.h" #include "ntp_stdlib.h" #include "sntp-opts.h" - #include "kod_management.h" +#include "ntp_io.h" #include "unity.h" -void setUp(void) -{ - kod_init_kod_db("/dev/null", TRUE); -} +void setUp(void); +void test_SingleEntryHandling(void); +void test_MultipleEntryHandling(void); +void test_NoMatchInSearch(void); +void test_AddDuplicate(void); +void test_DeleteEntry(void); -void tearDown(void) -{ + +void +setUp(void) { + kod_init_kod_db("/dev/null", TRUE); } -void test_SingleEntryHandling() { - char HOST[] = "192.0.2.5"; - char REASON[] = "DENY"; +void +test_SingleEntryHandling(void) { + const char HOST[] = "192.0.2.5"; + const char REASON[] = "DENY"; add_entry(HOST, REASON); @@ -32,15 +37,17 @@ void test_SingleEntryHandling() { TEST_ASSERT_EQUAL_STRING(REASON, result->type); } -void test_MultipleEntryHandling() { - char HOST1[] = "192.0.2.3"; - char REASON1[] = "DENY"; - char HOST2[] = "192.0.5.5"; - char REASON2[] = "RATE"; +void +test_MultipleEntryHandling(void) { + const char HOST1[] = "192.0.2.3"; + const char REASON1[] = "DENY"; - char HOST3[] = "192.0.10.1"; - char REASON3[] = "DENY"; + const char HOST2[] = "192.0.5.5"; + const char REASON2[] = "RATE"; + + const char HOST3[] = "192.0.10.1"; + const char REASON3[] = "DENY"; add_entry(HOST1, REASON1); add_entry(HOST2, REASON2); @@ -63,10 +70,12 @@ void test_MultipleEntryHandling() { free(result); } -void test_NoMatchInSearch() { - char HOST_ADD[] = "192.0.2.6"; - char HOST_NOTADD[] = "192.0.6.1"; - char REASON[] = "DENY"; + +void +test_NoMatchInSearch(void) { + const char HOST_ADD[] = "192.0.2.6"; + const char HOST_NOTADD[] = "192.0.6.1"; + const char REASON[] = "DENY"; add_entry(HOST_ADD, REASON); @@ -76,10 +85,12 @@ void test_NoMatchInSearch() { TEST_ASSERT_TRUE(result == NULL); } -void test_AddDuplicate() { - char HOST[] = "192.0.2.3"; - char REASON1[] = "RATE"; - char REASON2[] = "DENY"; + +void +test_AddDuplicate(void) { + const char HOST[] = "192.0.2.3"; + const char REASON1[] = "RATE"; + const char REASON2[] = "DENY"; add_entry(HOST, REASON1); struct kod_entry* result1; @@ -101,11 +112,13 @@ void test_AddDuplicate() { free(result2); } -void test_DeleteEntry() { - char HOST1[] = "192.0.2.1"; - char HOST2[] = "192.0.2.2"; - char HOST3[] = "192.0.2.3"; - char REASON[] = "DENY"; + +void +test_DeleteEntry(void) { + const char HOST1[] = "192.0.2.1"; + const char HOST2[] = "192.0.2.2"; + const char HOST3[] = "192.0.2.3"; + const char REASON[] = "DENY"; add_entry(HOST1, REASON); add_entry(HOST2, REASON); |