]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
minor warning fixes like adding void etc.
authorDamir Tomic <viperus@ntp.org>
Sat, 4 Jul 2015 07:49:26 +0000 (09:49 +0200)
committerDamir Tomic <viperus@ntp.org>
Sat, 4 Jul 2015 07:49:26 +0000 (09:49 +0200)
bk: 55979006Ht8Q4m8juxtzFgnKfHg5Og

sntp/tests/crypto.c
sntp/tests/keyFile.c
sntp/tests/kodDatabase.c
sntp/tests/kodFile.c
sntp/tests/packetProcessing.c
sntp/tests/run-keyFile.c
sntp/tests/run-kodDatabase.c
sntp/tests/run-kodFile.c
sntp/tests/run-utilities.c
sntp/tests/sntptest.h
sntp/tests/utilities.c

index 254469e63a94119469407f0b23e677b6baac0c2f..c9a1cedbf37513d67485378cb090b7e057aad0b0 100644 (file)
@@ -8,6 +8,7 @@
 #define MD5_LENGTH 16
 #define SHA1_LENGTH 20
 
+
 void test_MakeMd5Mac(void) {
 
        const char* PKT_DATA = "abcdefgh0123";
index 3769947c500890a0c491a1e8e3dea69386a47e44..10a68fb02480215b10bbe7f261fb82359d2ea597 100644 (file)
@@ -50,7 +50,7 @@ bool CompareKeysAlternative(int key_id,
 }
 
 
-void test_ReadEmptyKeyFile() {
+void test_ReadEmptyKeyFile(void) {
        struct key* keys = NULL;
 
        TEST_ASSERT_EQUAL(0, auth_init(CreatePath("key-test-empty", INPUT_DIR), &keys));
@@ -58,7 +58,7 @@ void test_ReadEmptyKeyFile() {
        TEST_ASSERT_TRUE(keys == NULL);
 }
 
-void test_ReadASCIIKeys() {
+void test_ReadASCIIKeys(void) {
        struct key* keys = NULL;
 
        TEST_ASSERT_EQUAL(2, auth_init(CreatePath("key-test-ascii", INPUT_DIR), &keys));
@@ -76,7 +76,7 @@ void test_ReadASCIIKeys() {
        TEST_ASSERT_TRUE(CompareKeysAlternative(50, 11, "MD5", "asciikeyOne", *result));
 }
 
-void test_ReadHexKeys() {
+void test_ReadHexKeys(void) {
        struct key* keys = NULL;
 
        TEST_ASSERT_EQUAL(3, auth_init(CreatePath("key-test-hex", INPUT_DIR), &keys));
@@ -102,7 +102,7 @@ void test_ReadHexKeys() {
        TEST_ASSERT_TRUE(CompareKeysAlternative(30, 13, "MD5", data2, *result));
 }
 
-void test_ReadKeyFileWithComments() {
+void test_ReadKeyFileWithComments(void) {
        struct key* keys = NULL;
 
        TEST_ASSERT_EQUAL(2, auth_init(CreatePath("key-test-comments", INPUT_DIR), &keys));
@@ -121,7 +121,7 @@ void test_ReadKeyFileWithComments() {
        TEST_ASSERT_TRUE(CompareKeysAlternative(34, 3, "MD5", "xyz", *result));
 }
 
-void test_ReadKeyFileWithInvalidHex() {
+void test_ReadKeyFileWithInvalidHex(void) {
        struct key* keys = NULL;
 
        TEST_ASSERT_EQUAL(1, auth_init(CreatePath("key-test-invalid-hex", INPUT_DIR), &keys));
index a6b86d06bf00c1c33ef2541d205acf0903be7370..f64dc73e133ae912a6bed0841c4ef27a39ac9aef 100644 (file)
@@ -19,7 +19,7 @@ void tearDown(void)
 }
 
 
-void test_SingleEntryHandling() {
+void test_SingleEntryHandling(void) {
        char HOST[] = "192.0.2.5";
        char REASON[] = "DENY";
 
@@ -32,7 +32,7 @@ void test_SingleEntryHandling() {
        TEST_ASSERT_EQUAL_STRING(REASON, result->type);
 }
 
-void test_MultipleEntryHandling() {
+void test_MultipleEntryHandling(void) {
        char HOST1[] = "192.0.2.3";
        char REASON1[] = "DENY";
 
@@ -63,7 +63,7 @@ void test_MultipleEntryHandling() {
        free(result);
 }
 
-void test_NoMatchInSearch() {
+void test_NoMatchInSearch(void) {
        char HOST_ADD[] = "192.0.2.6";
        char HOST_NOTADD[] = "192.0.6.1";
        char REASON[] = "DENY";
@@ -76,7 +76,7 @@ void test_NoMatchInSearch() {
        TEST_ASSERT_TRUE(result == NULL);
 }
 
-void test_AddDuplicate() {
+void test_AddDuplicate(void) {
        char HOST[] = "192.0.2.3";
        char REASON1[] = "RATE";
        char REASON2[] = "DENY";
@@ -101,7 +101,7 @@ void test_AddDuplicate() {
        free(result2);
 }
 
-void test_DeleteEntry() {
+void test_DeleteEntry(void) {
        char HOST1[] = "192.0.2.1";
        char HOST2[] = "192.0.2.2";
        char HOST3[] = "192.0.2.3";
index 7daec212692e2915f8e92abe0f063c11b58a9ec0..b76d1b117eea5625b20bf86b93d19ed579540ea0 100644 (file)
@@ -17,22 +17,22 @@ extern int kod_db_cnt;
 extern struct kod_entry** kod_db;
 extern char* kod_db_file;
 
-void setUp() {
+void setUp(void) {
                kod_db_cnt = 0;
                kod_db = NULL;
 }
 
-void tearDown() {
+void tearDown(void) {
 }
 
 
-void test_ReadEmptyFile() {
+void test_ReadEmptyFile(void) {
        kod_init_kod_db(CreatePath("kod-test-empty", INPUT_DIR), TRUE);
 
        TEST_ASSERT_EQUAL(0, kod_db_cnt);
 }
 
-void test_ReadCorrectFile() {
+void test_ReadCorrectFile(void) {
        kod_init_kod_db(CreatePath("kod-test-correct", INPUT_DIR), TRUE);
        
        TEST_ASSERT_EQUAL(2, kod_db_cnt);
@@ -50,7 +50,7 @@ void test_ReadCorrectFile() {
        TEST_ASSERT_EQUAL(0xfff, res->timestamp);
 }
 
-void test_ReadFileWithBlankLines() {
+void test_ReadFileWithBlankLines(void) {
        kod_init_kod_db(CreatePath("kod-test-blanks", INPUT_DIR), TRUE);
 
        TEST_ASSERT_EQUAL(3, kod_db_cnt);
@@ -73,7 +73,7 @@ void test_ReadFileWithBlankLines() {
        TEST_ASSERT_EQUAL(0xabcd, res->timestamp);
 }
 
-void test_WriteEmptyFile() {
+void test_WriteEmptyFile(void) {
        //kod_db_file = estrdup(CreatePath("kod-output-blank", OUTPUT_DIR)); //causing issues on psp-at1, replaced
        kod_db_file = estrdup("kod-output-blank");
        //printf("kod PATH: %s\n",kod_db_file);
@@ -89,7 +89,7 @@ void test_WriteEmptyFile() {
        fclose(is);
 }
 
-void test_WriteFileWithSingleEntry() {
+void test_WriteFileWithSingleEntry(void) {
        //kod_db_file = estrdup(CreatePath("kod-output-single", OUTPUT_DIR)); //causing issues on psp-at1, replaced
        kod_db_file = estrdup("kod-output-single"); 
        //printf("kod PATH: %s\n",kod_db_file);
@@ -113,7 +113,7 @@ void test_WriteFileWithSingleEntry() {
        TEST_ASSERT_TRUE(CompareFileContent(expected, actual));
 }
 
-void test_WriteFileWithMultipleEntries() {
+void test_WriteFileWithMultipleEntries(void) {
        //kod_db_file = estrdup(CreatePath("kod-output-multiple", OUTPUT_DIR)); //causing issues on psp-at1, replaced
        kod_db_file = estrdup("kod-output-multiple");
        //printf("kod PATH: %s\n",kod_db_file);
index 27ab72e4d4336a96fcf5c2c1af2cc9df2e6b4b8f..07bfc30f61e0eba3ec88817a8c44eac7eedded91 100644 (file)
@@ -43,7 +43,7 @@ void PrepareAuthenticationTestMD5(int key_id,
        PrepareAuthenticationTest(key_id, key_len, "MD5", key_seq);
 }
 
-void setUp() {
+void setUp(void) {
 
        sntptest();
        restoreKeyDb = false;
@@ -66,7 +66,7 @@ void setUp() {
 
 }
 
-void tearDown() {
+void tearDown(void) {
        
        if (restoreKeyDb) {
                key_cnt = 0;
index 0a6380d33b35f684f05af9096f7f6b7285698856..decf612c791c73b68d21b9de07cda1bb32874bf4 100644 (file)
 //=======External Functions This Runner Calls=====
 extern void setUp(void);
 extern void tearDown(void);
-extern void test_ReadEmptyKeyFile();
-extern void test_ReadASCIIKeys();
-extern void test_ReadHexKeys();
-extern void test_ReadKeyFileWithComments();
-extern void test_ReadKeyFileWithInvalidHex();
+void resetTest(void);
+extern void test_ReadEmptyKeyFile(void);
+extern void test_ReadASCIIKeys(void);
+extern void test_ReadHexKeys(void);
+extern void test_ReadKeyFileWithComments(void);
+extern void test_ReadKeyFileWithInvalidHex(void);
 
 
 //=======Test Reset Option=====
index 7fc96783e43b2eb41a21f8e614280cc2b8932c6a..db7addcd21050aca20148a213d618ebb073e7cbf 100644 (file)
 //=======External Functions This Runner Calls=====
 extern void setUp(void);
 extern void tearDown(void);
-extern void test_SingleEntryHandling();
-extern void test_MultipleEntryHandling();
-extern void test_NoMatchInSearch();
-extern void test_AddDuplicate();
-extern void test_DeleteEntry();
+void resetTest(void);
+extern void test_SingleEntryHandling(void);
+extern void test_MultipleEntryHandling(void);
+extern void test_NoMatchInSearch(void);
+extern void test_AddDuplicate(void);
+extern void test_DeleteEntry(void);
 
 
 //=======Test Reset Option=====
index 9c5896263ee07e9599f2bcf42c6282b87b102929..7e8490bd2bb03dbe9303af794960d92e7f450ab5 100644 (file)
 //=======External Functions This Runner Calls=====
 extern void setUp(void);
 extern void tearDown(void);
-extern void test_ReadEmptyFile();
-extern void test_ReadCorrectFile();
-extern void test_ReadFileWithBlankLines();
-extern void test_WriteEmptyFile();
-extern void test_WriteFileWithSingleEntry();
-extern void test_WriteFileWithMultipleEntries();
+void resetTest(void);
+extern void test_ReadEmptyFile(void);
+extern void test_ReadCorrectFile(void);
+extern void test_ReadFileWithBlankLines(void);
+extern void test_WriteEmptyFile(void);
+extern void test_WriteFileWithSingleEntry(void);
+extern void test_WriteFileWithMultipleEntries(void);
 
 
 //=======Test Reset Option=====
index 715bd110c2d466c108d1f12838ea2dd86edc0bcc..8b6448d40d25895b5d9ba921ee5df973e6c980c0 100644 (file)
 extern void setUp(void);
 extern void tearDown(void);
 void resetTest(void);
-extern void test_IPv4Address();
-extern void test_IPv6Address();
-extern void test_SetLiVnMode1();
-extern void test_SetLiVnMode2();
-extern void test_PktOutput();
-extern void test_LfpOutputBinaryFormat();
-extern void test_LfpOutputDecimalFormat();
+extern void test_IPv4Address(void);
+extern void test_IPv6Address(void);
+extern void test_SetLiVnMode1(void);
+extern void test_SetLiVnMode2(void);
+extern void test_PktOutput(void);
+extern void test_LfpOutputBinaryFormat(void);
+extern void test_LfpOutputDecimalFormat(void);
 
 
 //=======Test Reset Option=====
@@ -52,13 +52,13 @@ int main(int argc, char *argv[])
   progname = argv[0];
   Unity.TestFile = "utilities.c";
   UnityBegin("utilities.c");
-  RUN_TEST(test_IPv4Address, 68);
-  RUN_TEST(test_IPv6Address, 78);
-  RUN_TEST(test_SetLiVnMode1, 98);
-  RUN_TEST(test_SetLiVnMode2, 111);
-  RUN_TEST(test_PktOutput, 126);
-  RUN_TEST(test_LfpOutputBinaryFormat, 146);
-  RUN_TEST(test_LfpOutputDecimalFormat, 162);
+  RUN_TEST(test_IPv4Address, 66);
+  RUN_TEST(test_IPv6Address, 76);
+  RUN_TEST(test_SetLiVnMode1, 96);
+  RUN_TEST(test_SetLiVnMode2, 109);
+  RUN_TEST(test_PktOutput, 124);
+  RUN_TEST(test_LfpOutputBinaryFormat, 144);
+  RUN_TEST(test_LfpOutputDecimalFormat, 160);
 
   return (UnityEnd());
 }
index eff6f6e99dcb5542aab6b9b5076197f1cf3d2095..277361c5b5dfb89f6066e51dfb5ea921da89fcf3 100644 (file)
@@ -4,12 +4,15 @@
 #include "ntp_stdlib.h"
 #include "sntp-opts.h"
 
+void sntptest(void);
+void sntptest_destroy(void);
+void ActivateOption(const char* option, const char* argument);
 
-sntptest() {
+void sntptest(void) {
        optionSaveState(&sntpOptions);
 }
 
-sntptest_destroy() {
+void sntptest_destroy(void) {
        optionRestore(&sntpOptions);
 }
 
index 65be8df9d8e9c7ed715e995fe2fe2df3b709ab8a..29405255926c73e80daad809fc15da7c7d1cf30c 100644 (file)
@@ -34,8 +34,6 @@ struct addrinfo CreateAddrinfo( sockaddr_u* sock) {
 bool outputFileOpened;
 FILE* outputFile;
 
-//debugUtilitiesTest() : outputFileOpened(false) {}
-
 void InitDebugTest(const char * filename) {
        // Clear the contents of the current file.
        // Open the output file
@@ -65,7 +63,7 @@ void FinishDebugTest(const char * expected,
  * tests can be removed.
  */
 
-void test_IPv4Address() {
+void test_IPv4Address(void) {
        const char* ADDR = "192.0.2.10";
 
        sockaddr_u input = CreateSockaddr4(ADDR);
@@ -75,7 +73,7 @@ void test_IPv4Address() {
        TEST_ASSERT_EQUAL_STRING(ADDR, addrinfo_to_str(&inputA));
 }
 
-void test_IPv6Address() {
+void test_IPv6Address(void) {
        const struct in6_addr address = {
                                                0x20, 0x01, 0x0d, 0xb8,
                                                0x85, 0xa3, 0x08, 0xd3, 
@@ -95,7 +93,7 @@ void test_IPv6Address() {
        TEST_ASSERT_EQUAL_STRING(expected, addrinfo_to_str(&inputA));
 }
 
-void test_SetLiVnMode1() {
+void test_SetLiVnMode1(void) {
        struct pkt expected;
        expected.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
                                             NTP_VERSION,
@@ -108,7 +106,7 @@ void test_SetLiVnMode1() {
        TEST_ASSERT_EQUAL(expected.li_vn_mode, actual.li_vn_mode);
 }
 
-void test_SetLiVnMode2() {
+void test_SetLiVnMode2(void) {
        struct pkt expected;
        expected.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC,
                                             NTP_OLDVERSION,
@@ -123,7 +121,7 @@ void test_SetLiVnMode2() {
 
 /* Debug utilities tests */
 
-void test_PktOutput() {
+void test_PktOutput(void) {
        char * filename = "debug-output-pkt";//CreatePath("debug-output-pkt", OUTPUT_DIR);
        InitDebugTest(filename);
 
@@ -143,7 +141,7 @@ void test_PktOutput() {
        FinishDebugTest(CreatePath("debug-input-pkt", INPUT_DIR), filename);
 }
 
-void test_LfpOutputBinaryFormat() {
+void test_LfpOutputBinaryFormat(void) {
        char * filename = "debug-output-lfp-bin";//CreatePath("debug-output-lfp-bin", OUTPUT_DIR);
        InitDebugTest(filename);
 
@@ -159,7 +157,7 @@ void test_LfpOutputBinaryFormat() {
        FinishDebugTest(CreatePath("debug-input-lfp-bin", INPUT_DIR), filename);
 }
 
-void test_LfpOutputDecimalFormat() {
+void test_LfpOutputDecimalFormat(void) {
        char * filename = "debug-output-lfp-dec"; //CreatePath("debug-output-lfp-dec", OUTPUT_DIR);
        InitDebugTest(filename);