From: Damir Tomic Date: Sat, 4 Jul 2015 08:38:08 +0000 (+0200) Subject: minor fixes, adding void, cleanup... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f49f9c941850ec0df56df97f5da32397b5bb609a;p=thirdparty%2Fntp.git minor fixes, adding void, cleanup... bk: 55979b706j29g3PbwwvxYx7HFebsmA --- diff --git a/tests/libntp/a_md5encrypt.c b/tests/libntp/a_md5encrypt.c index 0b748dcde..efa5ce58a 100644 --- a/tests/libntp/a_md5encrypt.c +++ b/tests/libntp/a_md5encrypt.c @@ -33,7 +33,7 @@ const char *packet = "ijklmnopqrstuvwx"; const int totalLength = packetLength + keyIdLength + digestLength; const char *expectedPacket = "ijklmnopqrstuvwx\0\0\0\0\x0c\x0e\x84\xcf\x0b\xb7\xa8\x68\x8e\x52\x38\xdb\xbc\x1c\x39\x53"; -void test_Encrypt() { +void test_Encrypt(void) { char *packetPtr = malloc(totalLength*sizeof(*packetPtr)); //new char[totalLength]; memset(packetPtr+packetLength, 0, keyIdLength); @@ -52,13 +52,13 @@ void test_Encrypt() { free(packetPtr); //delete[] packetPtr; } -void test_DecryptValid() { +void test_DecryptValid(void) { cache_secretsize = keyLength; TEST_ASSERT_TRUE(MD5authdecrypt(keytype, (u_char*)key, (u_int32*)expectedPacket, packetLength, 20)); } -void test_DecryptInvalid() { +void test_DecryptInvalid(void) { cache_secretsize = keyLength; const char *invalidPacket = "ijklmnopqrstuvwx\0\0\0\0\x0c\x0e\x84\xcf\x0b\xb7\xa8\x68\x8e\x52\x38\xdb\xbc\x1c\x39\x54"; @@ -66,7 +66,7 @@ void test_DecryptInvalid() { TEST_ASSERT_FALSE(MD5authdecrypt(keytype, (u_char*)key, (u_int32*)invalidPacket, packetLength, 20)); } -void test_IPv4AddressToRefId() { +void test_IPv4AddressToRefId(void) { sockaddr_u addr; addr.sa4.sin_family = AF_INET; addr.sa4.sin_port = htons(80); @@ -77,7 +77,7 @@ void test_IPv4AddressToRefId() { TEST_ASSERT_EQUAL(address, addr2refid(&addr)); } -void test_IPv6AddressToRefId() { +void test_IPv6AddressToRefId(void) { const struct in6_addr address = { 0x20, 0x01, 0x0d, 0xb8, 0x85, 0xa3, 0x08, 0xd3, diff --git a/tests/libntp/atouint.c b/tests/libntp/atouint.c index 33c15a914..f312794af 100644 --- a/tests/libntp/atouint.c +++ b/tests/libntp/atouint.c @@ -6,7 +6,7 @@ #include "unity.h" -void test_RegularPositive() { +void test_RegularPositive(void) { const char *str = "305"; u_long actual; @@ -14,28 +14,28 @@ void test_RegularPositive() { TEST_ASSERT_EQUAL(305, actual); } -void test_PositiveOverflowBoundary() { +void test_PositiveOverflowBoundary(void) { const char *str = "4294967296"; u_long actual; TEST_ASSERT_FALSE(atouint(str, &actual)); } -void test_PositiveOverflowBig() { +void test_PositiveOverflowBig(void) { const char *str = "8000000000"; u_long actual; TEST_ASSERT_FALSE(atouint(str, &actual)); } -void test_Negative() { +void test_Negative(void) { const char *str = "-1"; u_long actual; TEST_ASSERT_FALSE(atouint(str, &actual)); } -void test_IllegalChar() { +void test_IllegalChar(void) { const char *str = "50c3"; u_long actual; diff --git a/tests/libntp/authkeys.c b/tests/libntp/authkeys.c index b949628da..d9b772928 100644 --- a/tests/libntp/authkeys.c +++ b/tests/libntp/authkeys.c @@ -68,7 +68,7 @@ void AddUntrustedKey(keyid_t keyno) { authtrust(keyno, FALSE); } -void test_AddTrustedKeys() { +void test_AddTrustedKeys(void) { const keyid_t KEYNO1 = 5; const keyid_t KEYNO2 = 8; @@ -79,7 +79,7 @@ void test_AddTrustedKeys() { TEST_ASSERT_TRUE(authistrusted(KEYNO2)); } -void test_AddUntrustedKey() { +void test_AddUntrustedKey(void) { const keyid_t KEYNO = 3; AddUntrustedKey(KEYNO); @@ -87,7 +87,7 @@ void test_AddUntrustedKey() { TEST_ASSERT_FALSE(authistrusted(KEYNO)); } -void test_HaveKeyCorrect() { +void test_HaveKeyCorrect(void) { const keyid_t KEYNO = 3; AddTrustedKey(KEYNO); @@ -96,21 +96,21 @@ void test_HaveKeyCorrect() { TEST_ASSERT_TRUE(authhavekey(KEYNO)); } -void test_HaveKeyIncorrect() { +void test_HaveKeyIncorrect(void) { const keyid_t KEYNO = 2; TEST_ASSERT_FALSE(auth_havekey(KEYNO)); TEST_ASSERT_FALSE(authhavekey(KEYNO)); } -void test_AddWithAuthUseKey() { +void test_AddWithAuthUseKey(void) { const keyid_t KEYNO = 5; const char* KEY = "52a"; TEST_ASSERT_TRUE(authusekey(KEYNO, KEYTYPE, (u_char*)KEY)); } -void test_EmptyKey() { +void test_EmptyKey(void) { const keyid_t KEYNO = 3; const char* KEY = ""; diff --git a/tests/libntp/buftvtots.c b/tests/libntp/buftvtots.c index edeedf63a..0dc738050 100644 --- a/tests/libntp/buftvtots.c +++ b/tests/libntp/buftvtots.c @@ -13,7 +13,7 @@ -void test_ZeroBuffer() { +void test_ZeroBuffer(void) { #ifndef SYS_WINNT const struct timeval input = {0, 0}; const l_fp expected = {0 + JAN_1970, 0}; @@ -27,7 +27,7 @@ void test_ZeroBuffer() { #endif } -void test_IntegerAndFractionalBuffer() { +void test_IntegerAndFractionalBuffer(void) { #ifndef SYS_WINNT const struct timeval input = {5, 500000}; // 5.5 const l_fp expected = {5 + JAN_1970, HALF}; @@ -50,7 +50,7 @@ void test_IntegerAndFractionalBuffer() { #endif } -void test_IllegalMicroseconds() { +void test_IllegalMicroseconds(void) { #ifndef SYS_WINNT const struct timeval input = {0, 1100000}; // > 999 999 microseconds. @@ -63,7 +63,7 @@ void test_IllegalMicroseconds() { } -void test_AlwaysFalseOnWindows() { +void test_AlwaysFalseOnWindows(void) { #ifdef SYS_WINNT /* * Under Windows, buftvtots will just return diff --git a/tests/libntp/calendar.c b/tests/libntp/calendar.c index 4ac1df469..f13251e28 100644 --- a/tests/libntp/calendar.c +++ b/tests/libntp/calendar.c @@ -1,31 +1,26 @@ #include "config.h" -#include "ntp_stdlib.h" //test fail without this include, for some reason +#include "ntp_stdlib.h" #include "ntp_calendar.h" #include "unity.h" -//#include "test-libntp.h" - - #include -//#include static int leapdays(int year); -char * CalendarFromCalToString(const struct calendar cal); //& -char * CalendarFromIsoToString(const struct isodate iso); //& +char * CalendarFromCalToString(const struct calendar cal); +char * CalendarFromIsoToString(const struct isodate iso); //tehnically, booleans -int IsEqualCal(const struct calendar expected, const struct calendar actual); //&& -int IsEqualIso(const struct isodate expected, const struct isodate actual); //&& +int IsEqualCal(const struct calendar expected, const struct calendar actual); +int IsEqualIso(const struct isodate expected, const struct isodate actual); -char * DateFromCalToStringCal(const struct calendar cal); //& -char * DateFromIsoToStringIso(const struct isodate iso); //& +char * DateFromCalToStringCal(const struct calendar cal); +char * DateFromIsoToStringIso(const struct isodate iso); //tehnically, booleans -int sEqualDateCal(const struct calendar expected, const struct calendar actual); //&& -int IsEqualDateIso(const struct isodate expected, const struct isodate actual); //&& - +int sEqualDateCal(const struct calendar expected, const struct calendar actual); +int IsEqualDateIso(const struct isodate expected, const struct isodate actual); // --------------------------------------------------------------------- @@ -110,7 +105,7 @@ char * CalendarFromIsoToString(const struct isodate iso) { //& } -int IsEqualCal(const struct calendar expected, const struct calendar actual) { //&& +int IsEqualCal(const struct calendar expected, const struct calendar actual) { if (expected.year == actual.year && (!expected.yearday || expected.yearday == actual.yearday) && expected.month == actual.month && @@ -125,7 +120,7 @@ int IsEqualCal(const struct calendar expected, const struct calendar actual) { / } } -int IsEqualIso(const struct isodate expected, const struct isodate actual) { //&& +int IsEqualIso(const struct isodate expected, const struct isodate actual) { if (expected.year == actual.year && expected.week == actual.week && expected.weekday == actual.weekday && @@ -139,7 +134,7 @@ int IsEqualIso(const struct isodate expected, const struct isodate actual) { //& } } -char * DateFromCalToString(const struct calendar cal) { //& +char * DateFromCalToString(const struct calendar cal) { char * ss = malloc (sizeof (char) * 100); @@ -161,7 +156,7 @@ char * DateFromCalToString(const struct calendar cal) { //& //ss << cal.year << "-" << (u_int)cal.month << "-" << (u_int)cal.monthday << " (" << cal.yearday << ")"; } -char * DateFromIsoToString(const struct isodate iso) { //& +char * DateFromIsoToString(const struct isodate iso) { char * ss = malloc (sizeof (char) * 100); @@ -181,7 +176,7 @@ char * DateFromIsoToString(const struct isodate iso) { //& } //boolean -int IsEqualDateCal(const struct calendar expected, const struct calendar actual) { //&& +int IsEqualDateCal(const struct calendar expected, const struct calendar actual) { if (expected.year == actual.year && (!expected.yearday || expected.yearday == actual.yearday) && expected.month == actual.month && @@ -194,7 +189,7 @@ int IsEqualDateCal(const struct calendar expected, const struct calendar actual) } //boolean -int IsEqualDateIso(const struct isodate expected, const struct isodate actual) { //&& +int IsEqualDateIso(const struct isodate expected, const struct isodate actual) { if (expected.year == actual.year && expected.week == actual.week && expected.weekday == actual.weekday) { @@ -227,7 +222,7 @@ static const u_short real_month_days[2][14] = { // test the day/sec join & split ops, making sure that 32bit // intermediate results would definitely overflow and the hi DWORD of // the 'vint64' is definitely needed. -void test_DaySplitMerge() { +void test_DaySplitMerge(void) { int32 day,sec; for (day = -1000000; day <= 1000000; day += 100) { for (sec = -100000; sec <= 186400; sec += 10000) { @@ -251,7 +246,7 @@ void test_DaySplitMerge() { } } -void test_SplitYearDays1() { +void test_SplitYearDays1(void) { int32 eyd; for (eyd = -1; eyd <= 365; eyd++) { ntpcal_split split = ntpcal_split_yeardays(eyd, 0); @@ -265,7 +260,7 @@ void test_SplitYearDays1() { } } -void test_SplitYearDays2() { +void test_SplitYearDays2(void) { int32 eyd; for (eyd = -1; eyd <= 366; eyd++) { ntpcal_split split = ntpcal_split_yeardays(eyd, 1); @@ -280,7 +275,7 @@ void test_SplitYearDays2() { } } -void test_RataDie1() { +void test_RataDie1(void) { int32 testDate = 1; // 0001-01-01 (proleptic date) struct calendar expected = { 1, 1, 1, 1 }; struct calendar actual; @@ -290,7 +285,7 @@ void test_RataDie1() { } // check last day of february for first 10000 years -void test_LeapYears1() { +void test_LeapYears1(void) { struct calendar dateIn, dateOut; for (dateIn.year = 1; dateIn.year < 10000; ++dateIn.year) { @@ -305,7 +300,7 @@ void test_LeapYears1() { } // check first day of march for first 10000 years -void test_LeapYears2() { +void test_LeapYears2(void) { struct calendar dateIn, dateOut; for (dateIn.year = 1; dateIn.year < 10000; ++dateIn.year) { @@ -323,7 +318,7 @@ void test_LeapYears2() { // (since the input is all nominal days of the calendar in that range // and the result of the inverse calculation must match the input no // invalid output can occur.) -void test_RoundTripDate() { +void test_RoundTripDate(void) { struct calendar truDate, expDate = { 1600, 0, 12, 31 };; int32 truRdn, expRdn = ntpcal_date_to_rd(&expDate); int leaps; @@ -352,7 +347,7 @@ void test_RoundTripDate() { } // Roundtrip testing on calyearstart -void test_RoundTripYearStart() { +void test_RoundTripYearStart(void) { static const time_t pivot = 0; u_int32 ntp, expys, truys; struct calendar date; @@ -368,7 +363,7 @@ void test_RoundTripYearStart() { } // Roundtrip testing on calymonthstart -void test_RoundTripMonthStart() { +void test_RoundTripMonthStart(void) { static const time_t pivot = 0; u_int32 ntp, expms, trums; struct calendar date; @@ -384,7 +379,7 @@ void test_RoundTripMonthStart() { } // Roundtrip testing on calweekstart -void test_RoundTripWeekStart() { +void test_RoundTripWeekStart(void) { static const time_t pivot = 0; u_int32 ntp, expws, truws; struct isodate date; @@ -400,7 +395,7 @@ void test_RoundTripWeekStart() { } // Roundtrip testing on caldaystart -void test_RoundTripDayStart() { +void test_RoundTripDayStart(void) { static const time_t pivot = 0; u_int32 ntp, expds, truds; struct calendar date; diff --git a/tests/libntp/caljulian.c b/tests/libntp/caljulian.c index 907f25d86..e2137eee8 100644 --- a/tests/libntp/caljulian.c +++ b/tests/libntp/caljulian.c @@ -6,11 +6,9 @@ #include "test-libntp.h" - #include //#include -//added struct to calendar! char * CalendarToString(const struct calendar cal) { char * ss = malloc (sizeof (char) * 100); @@ -58,20 +56,20 @@ int IsEqual(const struct calendar expected, const struct calendar actual) { } -void setUp() +void setUp(void) { ntpcal_set_timefunc(timefunc); settime(1970, 1, 1, 0, 0, 0); } -void tearDown() +void tearDown(void) { ntpcal_set_timefunc(NULL); } -void test_RegularTime() { +void test_RegularTime(void) { u_long testDate = 3485080800UL; // 2010-06-09 14:00:00 struct calendar expected = {2010,160,6,9,14,0,0}; @@ -82,7 +80,7 @@ void test_RegularTime() { TEST_ASSERT_TRUE(IsEqual(expected, actual)); } -void test_LeapYear() { +void test_LeapYear(void) { u_long input = 3549902400UL; // 2012-06-28 20:00:00Z struct calendar expected = {2012, 179, 6, 28, 20, 0, 0}; @@ -93,7 +91,7 @@ void test_LeapYear() { TEST_ASSERT_TRUE(IsEqual(expected, actual)); } -void test_uLongBoundary() { +void test_uLongBoundary(void) { u_long time = 4294967295UL; // 2036-02-07 6:28:15 struct calendar expected = {2036,0,2,7,6,28,15}; @@ -104,7 +102,7 @@ void test_uLongBoundary() { TEST_ASSERT_TRUE(IsEqual(expected, actual)); } -void test_uLongWrapped() { +void test_uLongWrapped(void) { u_long time = 0; struct calendar expected = {2036,0,2,7,6,28,16}; diff --git a/tests/libntp/calyearstart.c b/tests/libntp/calyearstart.c index b293c9339..137d41530 100644 --- a/tests/libntp/calyearstart.c +++ b/tests/libntp/calyearstart.c @@ -1,25 +1,25 @@ #include "config.h" -#include "ntp_stdlib.h" //test fail without this include, for some reason +#include "ntp_stdlib.h" #include "ntp_calendar.h" #include "unity.h" #include "test-libntp.h" -void setUp() +void setUp(void) { ntpcal_set_timefunc(timefunc); settime(1970, 1, 1, 0, 0, 0); } -void tearDown() +void tearDown(void) { ntpcal_set_timefunc(NULL); } -void test_NoWrapInDateRange() { +void test_NoWrapInDateRange(void) { const u_int32 input = 3486372600UL; // 2010-06-24 12:50:00. const u_int32 expected = 3471292800UL; // 2010-01-01 00:00:00 @@ -27,7 +27,7 @@ void test_NoWrapInDateRange() { TEST_ASSERT_EQUAL(expected, calyearstart(input, NULL)); } -void test_NoWrapInDateRangeLeapYear() { +void test_NoWrapInDateRangeLeapYear(void) { const u_int32 input = 3549528000UL; // 2012-06-24 12:00:00 const u_int32 expected = 3534364800UL; // 2012-01-01 00:00:00 @@ -35,7 +35,7 @@ void test_NoWrapInDateRangeLeapYear() { TEST_ASSERT_EQUAL(expected, calyearstart(input, NULL)); } -void test_WrapInDateRange() { +void test_WrapInDateRange(void) { const u_int32 input = 19904UL; // 2036-02-07 12:00:00 const u_int32 expected = 4291747200UL; // 2036-01-01 00:00:00 diff --git a/tests/libntp/clocktime.c b/tests/libntp/clocktime.c index a9c0fec82..c036e0736 100644 --- a/tests/libntp/clocktime.c +++ b/tests/libntp/clocktime.c @@ -15,13 +15,13 @@ // dependent on the actual system time. -void setUp() +void setUp(void) { ntpcal_set_timefunc(timefunc); settime(2000, 1, 1, 0, 0, 0); } -void tearDown() +void tearDown(void) { ntpcal_set_timefunc(NULL); } @@ -29,7 +29,7 @@ void tearDown() // --------------------------------------------------------------------- // test cases -void test_CurrentYear() { +void test_CurrentYear(void) { // Timestamp: 2010-06-24 12:50:00Z const u_int32 timestamp = 3486372600UL; const u_int32 expected = timestamp; // exactly the same. @@ -44,7 +44,7 @@ void test_CurrentYear() { TEST_ASSERT_EQUAL(expected, actual); } -void test_CurrentYearFuzz() { +void test_CurrentYearFuzz(void) { /* * Timestamp (rec_ui) is: 2010-06-24 12:50:00 * Time sent into function is 12:00:00. @@ -66,7 +66,7 @@ void test_CurrentYearFuzz() { TEST_ASSERT_EQUAL(expected, actual); } -void test_TimeZoneOffset() { +void test_TimeZoneOffset(void) { /* * Timestamp (rec_ui) is: 2010-06-24 12:00:00 +0800 * (which is 2010-06-24 04:00:00Z) @@ -86,7 +86,7 @@ void test_TimeZoneOffset() { TEST_ASSERT_EQUAL(expected, actual); } -void test_WrongYearStart() { +void test_WrongYearStart(void) { /* * Timestamp (rec_ui) is: 2010-01-02 11:00:00Z * Time sent into function is 11:00:00. @@ -105,7 +105,7 @@ void test_WrongYearStart() { TEST_ASSERT_EQUAL(expected, actual); } -void test_PreviousYear() { +void test_PreviousYear(void) { /* * Timestamp is: 2010-01-01 01:00:00Z * Time sent into function is 23:00:00 @@ -124,7 +124,7 @@ void test_PreviousYear() { TEST_ASSERT_EQUAL(expected, actual); } -void test_NextYear() { +void test_NextYear(void) { /* * Timestamp is: 2009-12-31 23:00:00Z * Time sent into function is 01:00:00 @@ -142,7 +142,7 @@ void test_NextYear() { TEST_ASSERT_EQUAL(expected, actual); } -void test_NoReasonableConversion() { +void test_NoReasonableConversion(void) { /* Timestamp is: 2010-01-02 11:00:00Z */ const u_int32 timestamp = 3471418800UL; @@ -164,7 +164,7 @@ int isLE(u_int32 diff,u_int32 actual){ } -void test_AlwaysInLimit() { +void test_AlwaysInLimit(void) { /* Timestamp is: 2010-01-02 11:00:00Z */ const u_int32 timestamp = 3471418800UL; const u_short prime_incs[] = { 127, 151, 163, 179 }; diff --git a/tests/libntp/lfpfunc.c b/tests/libntp/lfpfunc.c index 188478d10..bb1720c22 100644 --- a/tests/libntp/lfpfunc.c +++ b/tests/libntp/lfpfunc.c @@ -318,7 +318,7 @@ double eps(double d) //---------------------------------------------------------------------- // test addition //---------------------------------------------------------------------- -void test_AdditionLR() { +void test_AdditionLR(void) { size_t idx=0; for (idx=0; idx < addsub_cnt; ++idx) { @@ -337,7 +337,7 @@ void test_AdditionLR() { } } -void test_AdditionRL() { +void test_AdditionRL(void) { size_t idx=0; for (idx=0; idx < addsub_cnt; ++idx) { @@ -356,7 +356,7 @@ void test_AdditionRL() { //---------------------------------------------------------------------- // test subtraction //---------------------------------------------------------------------- -void test_SubtractionLR() { +void test_SubtractionLR(void) { size_t idx=0; for (idx=0; idx < addsub_cnt; ++idx) { @@ -371,7 +371,7 @@ void test_SubtractionLR() { } } -void test_SubtractionRL() { +void test_SubtractionRL(void) { size_t idx=0; for (idx=0; idx < addsub_cnt; ++idx) { @@ -389,7 +389,7 @@ void test_SubtractionRL() { // test negation //---------------------------------------------------------------------- -void test_Negation() { +void test_Negation(void) { size_t idx=0; for (idx=0; idx < addsub_cnt; ++idx) { @@ -410,7 +410,7 @@ void test_Negation() { //---------------------------------------------------------------------- // test absolute value //---------------------------------------------------------------------- -void test_Absolute() { +void test_Absolute(void) { size_t idx=0; for (idx=0; idx < addsub_cnt; ++idx) { l_fp op1 = l_fp_init(addsub_tab[idx][0].h, addsub_tab[idx][0].l); @@ -445,7 +445,7 @@ void test_Absolute() { //---------------------------------------------------------------------- // fp -> double -> fp rountrip test //---------------------------------------------------------------------- -void test_FDF_RoundTrip() { +void test_FDF_RoundTrip(void) { // since a l_fp has 64 bits in it's mantissa and a double has // only 54 bits available (including the hidden '1') we have to // make a few concessions on the roundtrip precision. The 'eps()' @@ -477,8 +477,7 @@ void test_FDF_RoundTrip() { // This uses the local compare and checks if the operations using the // macros in 'ntp_fp.h' produce mathing results. // ---------------------------------------------------------------------- -void test_SignedRelOps() { - //const lfp_hl * tv(&addsub_tab[0][0]); +void test_SignedRelOps(void) { const lfp_hl * tv = (&addsub_tab[0][0]); size_t lc ; for (lc=addsub_tot-1; lc; --lc,++tv) { @@ -520,7 +519,7 @@ void test_SignedRelOps() { } } -void test_UnsignedRelOps() { +void test_UnsignedRelOps(void) { const lfp_hl * tv =(&addsub_tab[0][0]); size_t lc; for (lc=addsub_tot-1; lc; --lc,++tv) { diff --git a/tests/libntp/lfptest.h b/tests/libntp/lfptest.h index 7949821a2..a830b37a4 100644 --- a/tests/libntp/lfptest.h +++ b/tests/libntp/lfptest.h @@ -3,6 +3,8 @@ #include "ntp_fp.h" +int IsEqual(const l_fp expected, const l_fp actual); + int IsEqual(const l_fp expected, const l_fp actual) { if (L_ISEQU(&expected, &actual)) { return TRUE; diff --git a/tests/libntp/msyslog.c b/tests/libntp/msyslog.c index 23ec40110..bad0e90a9 100644 --- a/tests/libntp/msyslog.c +++ b/tests/libntp/msyslog.c @@ -10,7 +10,6 @@ void format_errmsg (char *, size_t, const char *, int); #endif - void test_msnprintf(void) { #define FMT_PREFIX "msyslog.cpp ENOENT: " char exp_buf[512]; diff --git a/tests/libntp/refnumtoa.c b/tests/libntp/refnumtoa.c index 8a37690ce..037ed4c18 100644 --- a/tests/libntp/refnumtoa.c +++ b/tests/libntp/refnumtoa.c @@ -10,7 +10,7 @@ static const int UNUSED_REFCLOCK_ID = 250; -void test_LocalClock() { +void test_LocalClock(void) { #ifdef REFCLOCK /* clockname() is useless otherwise */ /* We test with a refclock address of type LOCALCLOCK. * with id 8 @@ -38,7 +38,7 @@ void test_LocalClock() { -void test_UnknownId() { +void test_UnknownId(void) { #ifdef REFCLOCK /* refnumtoa() is useless otherwise */ /* We test with a currently unused refclock ID */ u_int32 addr = REFCLOCK_ADDR; diff --git a/tests/libntp/run-a_md5encrypt.c b/tests/libntp/run-a_md5encrypt.c index a480c4a67..5be6b06df 100644 --- a/tests/libntp/run-a_md5encrypt.c +++ b/tests/libntp/run-a_md5encrypt.c @@ -27,11 +27,11 @@ extern void setUp(void); extern void tearDown(void); void resetTest(void); -extern void test_Encrypt(); -extern void test_DecryptValid(); -extern void test_DecryptInvalid(); -extern void test_IPv4AddressToRefId(); -extern void test_IPv6AddressToRefId(); +extern void test_Encrypt(void); +extern void test_DecryptValid(void); +extern void test_DecryptInvalid(void); +extern void test_IPv4AddressToRefId(void); +extern void test_IPv6AddressToRefId(void); //=======Test Reset Option===== diff --git a/tests/libntp/run-atouint.c b/tests/libntp/run-atouint.c index 7adb0840c..7185031e5 100644 --- a/tests/libntp/run-atouint.c +++ b/tests/libntp/run-atouint.c @@ -26,11 +26,12 @@ //=======External Functions This Runner Calls===== extern void setUp(void); extern void tearDown(void); -extern void test_RegularPositive(); -extern void test_PositiveOverflowBoundary(); -extern void test_PositiveOverflowBig(); -extern void test_Negative(); -extern void test_IllegalChar(); +void resetTest(void); +extern void test_RegularPositive(void); +extern void test_PositiveOverflowBoundary(void); +extern void test_PositiveOverflowBig(void); +extern void test_Negative(void); +extern void test_IllegalChar(void); //=======Test Reset Option===== diff --git a/tests/libntp/run-authkeys.c b/tests/libntp/run-authkeys.c index 5e65cc9dc..9f988ab9f 100644 --- a/tests/libntp/run-authkeys.c +++ b/tests/libntp/run-authkeys.c @@ -26,12 +26,13 @@ //=======External Functions This Runner Calls===== extern void setUp(void); extern void tearDown(void); -extern void test_AddTrustedKeys(); -extern void test_AddUntrustedKey(); -extern void test_HaveKeyCorrect(); -extern void test_HaveKeyIncorrect(); -extern void test_AddWithAuthUseKey(); -extern void test_EmptyKey(); +void resetTest(void); +extern void test_AddTrustedKeys(void); +extern void test_AddUntrustedKey(void); +extern void test_HaveKeyCorrect(void); +extern void test_HaveKeyIncorrect(void); +extern void test_AddWithAuthUseKey(void); +extern void test_EmptyKey(void); //=======Test Reset Option===== diff --git a/tests/libntp/run-buftvtots.c b/tests/libntp/run-buftvtots.c index c54c33912..1929cc3b8 100644 --- a/tests/libntp/run-buftvtots.c +++ b/tests/libntp/run-buftvtots.c @@ -26,10 +26,11 @@ //=======External Functions This Runner Calls===== extern void setUp(void); extern void tearDown(void); -extern void test_ZeroBuffer(); -extern void test_IntegerAndFractionalBuffer(); -extern void test_IllegalMicroseconds(); -extern void test_AlwaysFalseOnWindows(); +void resetTest(void); +extern void test_ZeroBuffer(void); +extern void test_IntegerAndFractionalBuffer(void); +extern void test_IllegalMicroseconds(void); +extern void test_AlwaysFalseOnWindows(void); //=======Test Reset Option===== diff --git a/tests/libntp/run-calendar.c b/tests/libntp/run-calendar.c index 07a5092f3..c3bd54481 100644 --- a/tests/libntp/run-calendar.c +++ b/tests/libntp/run-calendar.c @@ -26,17 +26,18 @@ //=======External Functions This Runner Calls===== extern void setUp(void); extern void tearDown(void); -extern void test_DaySplitMerge(); -extern void test_SplitYearDays1(); -extern void test_SplitYearDays2(); -extern void test_RataDie1(); -extern void test_LeapYears1(); -extern void test_LeapYears2(); -extern void test_RoundTripDate(); -extern void test_RoundTripYearStart(); -extern void test_RoundTripMonthStart(); -extern void test_RoundTripWeekStart(); -extern void test_RoundTripDayStart(); +void resetTest(void); +extern void test_DaySplitMerge(void); +extern void test_SplitYearDays1(void); +extern void test_SplitYearDays2(void); +extern void test_RataDie1(void); +extern void test_LeapYears1(void); +extern void test_LeapYears2(void); +extern void test_RoundTripDate(void); +extern void test_RoundTripYearStart(void); +extern void test_RoundTripMonthStart(void); +extern void test_RoundTripWeekStart(void); +extern void test_RoundTripDayStart(void); //=======Test Reset Option===== @@ -55,17 +56,17 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "calendar.c"; UnityBegin("calendar.c"); - RUN_TEST(test_DaySplitMerge, 230); - RUN_TEST(test_SplitYearDays1, 254); - RUN_TEST(test_SplitYearDays2, 268); - RUN_TEST(test_RataDie1, 283); - RUN_TEST(test_LeapYears1, 293); - RUN_TEST(test_LeapYears2, 308); - RUN_TEST(test_RoundTripDate, 326); - RUN_TEST(test_RoundTripYearStart, 355); - RUN_TEST(test_RoundTripMonthStart, 371); - RUN_TEST(test_RoundTripWeekStart, 387); - RUN_TEST(test_RoundTripDayStart, 403); + RUN_TEST(test_DaySplitMerge, 225); + RUN_TEST(test_SplitYearDays1, 249); + RUN_TEST(test_SplitYearDays2, 263); + RUN_TEST(test_RataDie1, 278); + RUN_TEST(test_LeapYears1, 288); + RUN_TEST(test_LeapYears2, 303); + RUN_TEST(test_RoundTripDate, 321); + RUN_TEST(test_RoundTripYearStart, 350); + RUN_TEST(test_RoundTripMonthStart, 366); + RUN_TEST(test_RoundTripWeekStart, 382); + RUN_TEST(test_RoundTripDayStart, 398); return (UnityEnd()); } diff --git a/tests/libntp/run-caljulian.c b/tests/libntp/run-caljulian.c index b4e3f480e..53027c4db 100644 --- a/tests/libntp/run-caljulian.c +++ b/tests/libntp/run-caljulian.c @@ -27,10 +27,10 @@ extern void setUp(void); extern void tearDown(void); void resetTest(void); -extern void test_RegularTime(); -extern void test_LeapYear(); -extern void test_uLongBoundary(); -extern void test_uLongWrapped(); +extern void test_RegularTime(void); +extern void test_LeapYear(void); +extern void test_uLongBoundary(void); +extern void test_uLongWrapped(void); //=======Test Reset Option===== @@ -49,10 +49,10 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "caljulian.c"; UnityBegin("caljulian.c"); - RUN_TEST(test_RegularTime, 74); - RUN_TEST(test_LeapYear, 85); - RUN_TEST(test_uLongBoundary, 96); - RUN_TEST(test_uLongWrapped, 107); + RUN_TEST(test_RegularTime, 72); + RUN_TEST(test_LeapYear, 83); + RUN_TEST(test_uLongBoundary, 94); + RUN_TEST(test_uLongWrapped, 105); return (UnityEnd()); } diff --git a/tests/libntp/run-calyearstart.c b/tests/libntp/run-calyearstart.c index d54a0b562..352267382 100644 --- a/tests/libntp/run-calyearstart.c +++ b/tests/libntp/run-calyearstart.c @@ -26,9 +26,10 @@ //=======External Functions This Runner Calls===== extern void setUp(void); extern void tearDown(void); -extern void test_NoWrapInDateRange(); -extern void test_NoWrapInDateRangeLeapYear(); -extern void test_WrapInDateRange(); +void resetTest(void); +extern void test_NoWrapInDateRange(void); +extern void test_NoWrapInDateRangeLeapYear(void); +extern void test_WrapInDateRange(void); //=======Test Reset Option===== diff --git a/tests/libntp/run-clocktime.c b/tests/libntp/run-clocktime.c index f21de83ea..be65a46bd 100644 --- a/tests/libntp/run-clocktime.c +++ b/tests/libntp/run-clocktime.c @@ -26,14 +26,15 @@ //=======External Functions This Runner Calls===== extern void setUp(void); extern void tearDown(void); -extern void test_CurrentYear(); -extern void test_CurrentYearFuzz(); -extern void test_TimeZoneOffset(); -extern void test_WrongYearStart(); -extern void test_PreviousYear(); -extern void test_NextYear(); -extern void test_NoReasonableConversion(); -extern void test_AlwaysInLimit(); +void resetTest(void); +extern void test_CurrentYear(void); +extern void test_CurrentYearFuzz(void); +extern void test_TimeZoneOffset(void); +extern void test_WrongYearStart(void); +extern void test_PreviousYear(void); +extern void test_NextYear(void); +extern void test_NoReasonableConversion(void); +extern void test_AlwaysInLimit(void); //=======Test Reset Option===== diff --git a/tests/libntp/run-lfpfunc.c b/tests/libntp/run-lfpfunc.c index 2f0e1c254..0f78f9418 100644 --- a/tests/libntp/run-lfpfunc.c +++ b/tests/libntp/run-lfpfunc.c @@ -27,15 +27,15 @@ extern void setUp(void); extern void tearDown(void); void resetTest(void); -extern void test_AdditionLR(); -extern void test_AdditionRL(); -extern void test_SubtractionLR(); -extern void test_SubtractionRL(); -extern void test_Negation(); -extern void test_Absolute(); -extern void test_FDF_RoundTrip(); -extern void test_SignedRelOps(); -extern void test_UnsignedRelOps(); +extern void test_AdditionLR(void); +extern void test_AdditionRL(void); +extern void test_SubtractionLR(void); +extern void test_SubtractionRL(void); +extern void test_Negation(void); +extern void test_Absolute(void); +extern void test_FDF_RoundTrip(void); +extern void test_SignedRelOps(void); +extern void test_UnsignedRelOps(void); //=======Test Reset Option===== @@ -54,14 +54,14 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "lfpfunc.c"; UnityBegin("lfpfunc.c"); - RUN_TEST(test_AdditionLR, 320); - RUN_TEST(test_AdditionRL, 339); - RUN_TEST(test_SubtractionLR, 358); - RUN_TEST(test_SubtractionRL, 373); - RUN_TEST(test_Negation, 391); - RUN_TEST(test_Absolute, 412); - RUN_TEST(test_FDF_RoundTrip, 447); - RUN_TEST(test_SignedRelOps, 479); + RUN_TEST(test_AdditionLR, 321); + RUN_TEST(test_AdditionRL, 340); + RUN_TEST(test_SubtractionLR, 359); + RUN_TEST(test_SubtractionRL, 374); + RUN_TEST(test_Negation, 392); + RUN_TEST(test_Absolute, 413); + RUN_TEST(test_FDF_RoundTrip, 448); + RUN_TEST(test_SignedRelOps, 480); RUN_TEST(test_UnsignedRelOps, 522); return (UnityEnd()); diff --git a/tests/libntp/run-msyslog.c b/tests/libntp/run-msyslog.c index ea566a716..3e4fac926 100644 --- a/tests/libntp/run-msyslog.c +++ b/tests/libntp/run-msyslog.c @@ -53,14 +53,14 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "msyslog.c"; UnityBegin("msyslog.c"); - RUN_TEST(test_msnprintf, 14); - RUN_TEST(test_msnprintfLiteralPercentm, 30); - RUN_TEST(test_msnprintfBackslashLiteralPercentm, 45); - RUN_TEST(test_msnprintfBackslashPercent, 59); - RUN_TEST(test_msnprintfHangingPercent, 74); - RUN_TEST(test_format_errmsgHangingPercent, 91); - RUN_TEST(test_msnprintfNullTarget, 106); - RUN_TEST(test_msnprintfTruncate, 117); + RUN_TEST(test_msnprintf, 13); + RUN_TEST(test_msnprintfLiteralPercentm, 29); + RUN_TEST(test_msnprintfBackslashLiteralPercentm, 44); + RUN_TEST(test_msnprintfBackslashPercent, 58); + RUN_TEST(test_msnprintfHangingPercent, 73); + RUN_TEST(test_format_errmsgHangingPercent, 90); + RUN_TEST(test_msnprintfNullTarget, 105); + RUN_TEST(test_msnprintfTruncate, 116); return (UnityEnd()); } diff --git a/tests/libntp/run-refidsmear.c b/tests/libntp/run-refidsmear.c index 30651f35f..9eabcdb53 100644 --- a/tests/libntp/run-refidsmear.c +++ b/tests/libntp/run-refidsmear.c @@ -46,7 +46,7 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "refidsmear.c"; UnityBegin("refidsmear.c"); - RUN_TEST(test_refidsmear, 100); + RUN_TEST(test_refidsmear, 101); return (UnityEnd()); } diff --git a/tests/libntp/run-refnumtoa.c b/tests/libntp/run-refnumtoa.c index 60981ca5a..ccdc8cf59 100644 --- a/tests/libntp/run-refnumtoa.c +++ b/tests/libntp/run-refnumtoa.c @@ -26,8 +26,9 @@ //=======External Functions This Runner Calls===== extern void setUp(void); extern void tearDown(void); -extern void test_LocalClock(); -extern void test_UnknownId(); +void resetTest(void); +extern void test_LocalClock(void); +extern void test_UnknownId(void); //=======Test Reset Option===== diff --git a/tests/libntp/run-ssl_init.c b/tests/libntp/run-ssl_init.c index 452a60a9a..96d0271ca 100644 --- a/tests/libntp/run-ssl_init.c +++ b/tests/libntp/run-ssl_init.c @@ -26,11 +26,12 @@ //=======External Functions This Runner Calls===== extern void setUp(void); extern void tearDown(void); -extern void test_MD5KeyTypeWithoutDigestLength(); -extern void test_MD5KeyTypeWithDigestLength(); -extern void test_SHA1KeyTypeWithDigestLength(); -extern void test_MD5KeyName(); -extern void test_SHA1KeyName(); +void resetTest(void); +extern void test_MD5KeyTypeWithoutDigestLength(void); +extern void test_MD5KeyTypeWithDigestLength(void); +extern void test_SHA1KeyTypeWithDigestLength(void); +extern void test_MD5KeyName(void); +extern void test_SHA1KeyName(void); //=======Test Reset Option===== diff --git a/tests/libntp/run-timespecops.c b/tests/libntp/run-timespecops.c index b56e7560f..1f352d27f 100644 --- a/tests/libntp/run-timespecops.c +++ b/tests/libntp/run-timespecops.c @@ -26,34 +26,35 @@ //=======External Functions This Runner Calls===== extern void setUp(void); extern void tearDown(void); -extern void test_Helpers1(); -extern void test_Normalise(); -extern void test_SignNoFrac(); -extern void test_SignWithFrac(); -extern void test_CmpFracEQ(); -extern void test_CmpFracGT(); -extern void test_CmpFracLT(); -extern void test_AddFullNorm(); -extern void test_AddFullOflow1(); -extern void test_AddNsecNorm(); -extern void test_AddNsecOflow1(); -extern void test_SubFullNorm(); -extern void test_SubFullOflow(); -extern void test_SubNsecNorm(); -extern void test_SubNsecOflow(); -extern void test_Neg(); -extern void test_AbsNoFrac(); -extern void test_AbsWithFrac(); -extern void test_Helpers2(); -extern void test_ToLFPbittest(); -extern void test_ToLFPrelPos(); -extern void test_ToLFPrelNeg(); -extern void test_ToLFPabs(); -extern void test_FromLFPbittest(); -extern void test_FromLFPrelPos(); -extern void test_FromLFPrelNeg(); -extern void test_LFProundtrip(); -extern void test_ToString(); +void resetTest(void); +extern void test_Helpers1(void); +extern void test_Normalise(void); +extern void test_SignNoFrac(void); +extern void test_SignWithFrac(void); +extern void test_CmpFracEQ(void); +extern void test_CmpFracGT(void); +extern void test_CmpFracLT(void); +extern void test_AddFullNorm(void); +extern void test_AddFullOflow1(void); +extern void test_AddNsecNorm(void); +extern void test_AddNsecOflow1(void); +extern void test_SubFullNorm(void); +extern void test_SubFullOflow(void); +extern void test_SubNsecNorm(void); +extern void test_SubNsecOflow(void); +extern void test_Neg(void); +extern void test_AbsNoFrac(void); +extern void test_AbsWithFrac(void); +extern void test_Helpers2(void); +extern void test_ToLFPbittest(void); +extern void test_ToLFPrelPos(void); +extern void test_ToLFPrelNeg(void); +extern void test_ToLFPabs(void); +extern void test_FromLFPbittest(void); +extern void test_FromLFPrelPos(void); +extern void test_FromLFPrelNeg(void); +extern void test_LFProundtrip(void); +extern void test_ToString(void); //=======Test Reset Option===== diff --git a/tests/libntp/run-timevalops.c b/tests/libntp/run-timevalops.c index 013aae1f2..0430d6a91 100644 --- a/tests/libntp/run-timevalops.c +++ b/tests/libntp/run-timevalops.c @@ -26,34 +26,35 @@ //=======External Functions This Runner Calls===== extern void setUp(void); extern void tearDown(void); -extern void test_Helpers1(); -extern void test_Normalise(); -extern void test_SignNoFrac(); -extern void test_SignWithFrac(); -extern void test_CmpFracEQ(); -extern void test_CmpFracGT(); -extern void test_CmpFracLT(); -extern void test_AddFullNorm(); -extern void test_AddFullOflow1(); -extern void test_AddUsecNorm(); -extern void test_AddUsecOflow1(); -extern void test_SubFullNorm(); -extern void test_SubFullOflow(); -extern void test_SubUsecNorm(); -extern void test_SubUsecOflow(); -extern void test_Neg(); -extern void test_AbsNoFrac(); -extern void test_AbsWithFrac(); -extern void test_Helpers2(); -extern void test_ToLFPbittest(); -extern void test_ToLFPrelPos(); -extern void test_ToLFPrelNeg(); -extern void test_ToLFPabs(); -extern void test_FromLFPbittest(); -extern void test_FromLFPrelPos(); -extern void test_FromLFPrelNeg(); -extern void test_LFProundtrip(); -extern void test_ToString(); +void resetTest(void); +extern void test_Helpers1(void); +extern void test_Normalise(void); +extern void test_SignNoFrac(void); +extern void test_SignWithFrac(void); +extern void test_CmpFracEQ(void); +extern void test_CmpFracGT(void); +extern void test_CmpFracLT(void); +extern void test_AddFullNorm(void); +extern void test_AddFullOflow1(void); +extern void test_AddUsecNorm(void); +extern void test_AddUsecOflow1(void); +extern void test_SubFullNorm(void); +extern void test_SubFullOflow(void); +extern void test_SubUsecNorm(void); +extern void test_SubUsecOflow(void); +extern void test_Neg(void); +extern void test_AbsNoFrac(void); +extern void test_AbsWithFrac(void); +extern void test_Helpers2(void); +extern void test_ToLFPbittest(void); +extern void test_ToLFPrelPos(void); +extern void test_ToLFPrelNeg(void); +extern void test_ToLFPabs(void); +extern void test_FromLFPbittest(void); +extern void test_FromLFPrelPos(void); +extern void test_FromLFPrelNeg(void); +extern void test_LFProundtrip(void); +extern void test_ToString(void); //=======Test Reset Option===== diff --git a/tests/libntp/run-vi64ops.c b/tests/libntp/run-vi64ops.c index 7e8c2cbeb..8615359d7 100644 --- a/tests/libntp/run-vi64ops.c +++ b/tests/libntp/run-vi64ops.c @@ -27,9 +27,9 @@ extern void setUp(void); extern void tearDown(void); void resetTest(void); -extern void test_ParseVUI64_pos(); -extern void test_ParseVUI64_neg(); -extern void test_ParseVUI64_case(); +extern void test_ParseVUI64_pos(void); +extern void test_ParseVUI64_neg(void); +extern void test_ParseVUI64_case(void); //=======Test Reset Option===== @@ -48,9 +48,9 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "vi64ops.c"; UnityBegin("vi64ops.c"); - RUN_TEST(test_ParseVUI64_pos, 33); - RUN_TEST(test_ParseVUI64_neg, 47); - RUN_TEST(test_ParseVUI64_case, 60); + RUN_TEST(test_ParseVUI64_pos, 32); + RUN_TEST(test_ParseVUI64_neg, 46); + RUN_TEST(test_ParseVUI64_case, 59); return (UnityEnd()); } diff --git a/tests/libntp/ssl_init.c b/tests/libntp/ssl_init.c index fe22414e3..8fbea8178 100644 --- a/tests/libntp/ssl_init.c +++ b/tests/libntp/ssl_init.c @@ -16,11 +16,11 @@ static const size_t TEST_SHA1_DIGEST_LENGTH = 20; // keytype_from_text() -void test_MD5KeyTypeWithoutDigestLength() { +void test_MD5KeyTypeWithoutDigestLength(void) { TEST_ASSERT_EQUAL(KEY_TYPE_MD5, keytype_from_text("MD5", NULL)); } -void test_MD5KeyTypeWithDigestLength() { +void test_MD5KeyTypeWithDigestLength(void) { size_t digestLength; size_t expected = TEST_MD5_DIGEST_LENGTH; @@ -29,7 +29,7 @@ void test_MD5KeyTypeWithDigestLength() { } -void test_SHA1KeyTypeWithDigestLength() { +void test_SHA1KeyTypeWithDigestLength(void) { #ifdef OPENSSL size_t digestLength; size_t expected = TEST_SHA1_DIGEST_LENGTH; @@ -44,11 +44,11 @@ void test_SHA1KeyTypeWithDigestLength() { // keytype_name() -void test_MD5KeyName() { +void test_MD5KeyName(void) { TEST_ASSERT_EQUAL_STRING("MD5", keytype_name(KEY_TYPE_MD5)); } -void test_SHA1KeyName() { +void test_SHA1KeyName(void) { #ifdef OPENSSL TEST_ASSERT_EQUAL_STRING("SHA", keytype_name(NID_sha)); #else diff --git a/tests/libntp/timespecops.c b/tests/libntp/timespecops.c index bb2619a07..3a6bf5c9c 100644 --- a/tests/libntp/timespecops.c +++ b/tests/libntp/timespecops.c @@ -152,7 +152,7 @@ u_int32 my_tsf_to_tick(u_int32 tsf) // test support stuff -- part 1 // --------------------------------------------------------------------- -void test_Helpers1() { +void test_Helpers1(void) { struct timespec x; for (x.tv_sec = -2; x.tv_sec < 3; x.tv_sec++) { @@ -172,7 +172,7 @@ void test_Helpers1() { // test normalisation //---------------------------------------------------------------------- -void test_Normalise() { +void test_Normalise(void) { long ns; for ( ns = -2000000000; ns <= 2000000000; ns += 10000000) { struct timespec x = timespec_init(0, ns); @@ -186,7 +186,7 @@ void test_Normalise() { // test classification //---------------------------------------------------------------------- -void test_SignNoFrac() { +void test_SignNoFrac(void) { // sign test, no fraction int i; for (i = -4; i <= 4; ++i) { @@ -198,7 +198,7 @@ void test_SignNoFrac() { } } -void test_SignWithFrac() { +void test_SignWithFrac(void) { // sign test, with fraction int i; for (i = -4; i <= 4; ++i) { @@ -212,7 +212,7 @@ void test_SignWithFrac() { //---------------------------------------------------------------------- // test compare //---------------------------------------------------------------------- -void test_CmpFracEQ() { +void test_CmpFracEQ(void) { // fractions are equal int i,j; for (i = -4; i <= 4; ++i) @@ -225,7 +225,7 @@ void test_CmpFracEQ() { } } -void test_CmpFracGT() { +void test_CmpFracGT(void) { // fraction a bigger fraction b int i,j; for (i = -4; i <= 4; ++i) @@ -238,7 +238,7 @@ void test_CmpFracGT() { } } -void test_CmpFracLT() { +void test_CmpFracLT(void) { // fraction a less fraction b int i,j; for (i = -4; i <= 4; ++i) @@ -255,7 +255,7 @@ void test_CmpFracLT() { // Test addition (sum) //---------------------------------------------------------------------- -void test_AddFullNorm() { +void test_AddFullNorm(void) { int i,j; for (i = -4; i <= 4; ++i) for (j = -4; j <= 4; ++j) { @@ -269,7 +269,7 @@ void test_AddFullNorm() { } } -void test_AddFullOflow1() { +void test_AddFullOflow1(void) { int i,j; for (i = -4; i <= 4; ++i) for (j = -4; j <= 4; ++j) { @@ -283,7 +283,7 @@ void test_AddFullOflow1() { } } -void test_AddNsecNorm() { +void test_AddNsecNorm(void) { int i; for (i = -4; i <= 4; ++i) { struct timespec a = timespec_init(i, 200); @@ -295,7 +295,7 @@ void test_AddNsecNorm() { } } -void test_AddNsecOflow1() { +void test_AddNsecOflow1(void) { int i; for (i = -4; i <= 4; ++i) { struct timespec a = timespec_init(i, 200); @@ -311,7 +311,7 @@ void test_AddNsecOflow1() { // test subtraction (difference) //---------------------------------------------------------------------- -void test_SubFullNorm() { +void test_SubFullNorm(void) { int i,j; for (i = -4; i <= 4; ++i) for (j = -4; j <= 4; ++j) { @@ -325,7 +325,7 @@ void test_SubFullNorm() { } } -void test_SubFullOflow() { +void test_SubFullOflow(void) { int i,j; for (i = -4; i <= 4; ++i) for (j = -4; j <= 4; ++j) { @@ -339,7 +339,7 @@ void test_SubFullOflow() { } } -void test_SubNsecNorm() { +void test_SubNsecNorm(void) { int i; for (i = -4; i <= 4; ++i) { struct timespec a = timespec_init(i, 600); @@ -351,7 +351,7 @@ void test_SubNsecNorm() { } } -void test_SubNsecOflow() { +void test_SubNsecOflow(void) { int i; for (i = -4; i <= 4; ++i) { struct timespec a = timespec_init( i , 100); @@ -367,7 +367,7 @@ void test_SubNsecOflow() { // test negation //---------------------------------------------------------------------- -void test_Neg() { +void test_Neg(void) { int i; for (i = -4; i <= 4; ++i) { struct timespec a = timespec_init(i, 100); @@ -384,7 +384,7 @@ void test_Neg() { // test abs value //---------------------------------------------------------------------- -void test_AbsNoFrac() { +void test_AbsNoFrac(void) { int i; for (i = -4; i <= 4; ++i) { struct timespec a = timespec_init(i , 0); @@ -395,7 +395,7 @@ void test_AbsNoFrac() { } } -void test_AbsWithFrac() { +void test_AbsWithFrac(void) { int i; for (i = -4; i <= 4; ++i) { struct timespec a = timespec_init(i, 100); @@ -410,7 +410,7 @@ void test_AbsWithFrac() { // test support stuff -- part 2 // --------------------------------------------------------------------- -void test_Helpers2() { +void test_Helpers2(void) { struct timespec limit = timespec_init(0,2); struct timespec x, y; @@ -442,7 +442,7 @@ void test_Helpers2() { // conversion to l_fp //---------------------------------------------------------------------- -void test_ToLFPbittest() { +void test_ToLFPbittest(void) { l_fp lfpClose = l_fp_init(0,1); u_int32 i; for (i = 0; i < 1000000000; i+=1000) { @@ -455,7 +455,7 @@ void test_ToLFPbittest() { } } -void test_ToLFPrelPos() { +void test_ToLFPrelPos(void) { int i; for (i = 0; i < COUNTOF(fdata); i++) { struct timespec a = timespec_init(1, fdata[i].nsec); @@ -467,7 +467,7 @@ void test_ToLFPrelPos() { } } -void test_ToLFPrelNeg() { +void test_ToLFPrelNeg(void) { int i; for (i = 0; i < COUNTOF(fdata); i++) { struct timespec a = timespec_init(-1, fdata[i].nsec); @@ -479,7 +479,7 @@ void test_ToLFPrelNeg() { } } -void test_ToLFPabs() { +void test_ToLFPabs(void) { int i; for (i = 0; i < COUNTOF(fdata); i++) { struct timespec a = timespec_init(1, fdata[i].nsec); @@ -494,7 +494,7 @@ void test_ToLFPabs() { //---------------------------------------------------------------------- // conversion from l_fp //---------------------------------------------------------------------- -void test_FromLFPbittest() { +void test_FromLFPbittest(void) { struct timespec limit = timespec_init(0,2); // Not *exactly* a bittest, because 2**32 tests would take a @@ -513,7 +513,7 @@ void test_FromLFPbittest() { } } -void test_FromLFPrelPos() { +void test_FromLFPrelPos(void) { struct timespec limit = timespec_init(0,2); int i; for (i = 0; i < COUNTOF(fdata); i++) { @@ -526,7 +526,7 @@ void test_FromLFPrelPos() { } } -void test_FromLFPrelNeg() { +void test_FromLFPrelNeg(void) { struct timespec limit = timespec_init(0,2); int i; for (i = 0; i < COUNTOF(fdata); i++) { @@ -541,7 +541,7 @@ void test_FromLFPrelNeg() { // nsec -> frac -> nsec roundtrip, using a prime start and increment -void test_LFProundtrip() { +void test_LFProundtrip(void) { int32_t t; u_int32 i; for (t = -1; t < 2; ++t) @@ -560,7 +560,7 @@ void test_LFProundtrip() { // string formatting //---------------------------------------------------------------------- -void test_ToString() { +void test_ToString(void) { static const struct { time_t sec; long nsec; diff --git a/tests/libntp/timevalops.c b/tests/libntp/timevalops.c index 080dfb737..07ddd4735 100644 --- a/tests/libntp/timevalops.c +++ b/tests/libntp/timevalops.c @@ -150,7 +150,7 @@ u_int32 my_tsf_to_tick(u_int32 tsf) // test support stuff - part1 // --------------------------------------------------------------------- -void test_Helpers1() { +void test_Helpers1(void) { struct timeval x; for (x.tv_sec = -2; x.tv_sec < 3; x.tv_sec++) { @@ -170,7 +170,7 @@ void test_Helpers1() { // test normalisation //---------------------------------------------------------------------- -void test_Normalise() { +void test_Normalise(void) { long ns; for (ns = -2000000000; ns <= 2000000000; ns += 10000000) { struct timeval x = timeval_init(0, ns); @@ -184,7 +184,7 @@ void test_Normalise() { // test classification //---------------------------------------------------------------------- -void test_SignNoFrac() { +void test_SignNoFrac(void) { int i; // sign test, no fraction for (i = -4; i <= 4; ++i) { @@ -196,7 +196,7 @@ void test_SignNoFrac() { } } -void test_SignWithFrac() { +void test_SignWithFrac(void) { // sign test, with fraction int i; for (i = -4; i <= 4; ++i) { @@ -211,7 +211,7 @@ void test_SignWithFrac() { //---------------------------------------------------------------------- // test compare //---------------------------------------------------------------------- -void test_CmpFracEQ() { +void test_CmpFracEQ(void) { int i,j; // fractions are equal for (i = -4; i <= 4; ++i) @@ -225,7 +225,7 @@ void test_CmpFracEQ() { } } -void test_CmpFracGT() { +void test_CmpFracGT(void) { // fraction a bigger fraction b int i,j; for (i = -4; i <= 4; ++i) @@ -239,7 +239,7 @@ void test_CmpFracGT() { } } -void test_CmpFracLT() { +void test_CmpFracLT(void) { // fraction a less fraction b int i,j; for (i = -4; i <= 4; ++i) @@ -257,7 +257,7 @@ void test_CmpFracLT() { // Test addition (sum) //---------------------------------------------------------------------- -void test_AddFullNorm() { +void test_AddFullNorm(void) { int i,j; for (i = -4; i <= 4; ++i) for (j = -4; j <= 4; ++j) { @@ -271,7 +271,7 @@ void test_AddFullNorm() { } } -void test_AddFullOflow1() { +void test_AddFullOflow1(void) { int i,j; for (i = -4; i <= 4; ++i) for (j = -4; j <= 4; ++j) { @@ -285,7 +285,7 @@ void test_AddFullOflow1() { } } -void test_AddUsecNorm() { +void test_AddUsecNorm(void) { int i; for (i = -4; i <= 4; ++i) { struct timeval a = timeval_init(i, 200); @@ -297,7 +297,7 @@ void test_AddUsecNorm() { } } -void test_AddUsecOflow1() { +void test_AddUsecOflow1(void) { int i; for (i = -4; i <= 4; ++i) { struct timeval a = timeval_init(i, 200); @@ -313,7 +313,7 @@ void test_AddUsecOflow1() { // test subtraction (difference) //---------------------------------------------------------------------- -void test_SubFullNorm() { +void test_SubFullNorm(void) { int i,j; for (i = -4; i <= 4; ++i) for (j = -4; j <= 4; ++j) { @@ -327,7 +327,7 @@ void test_SubFullNorm() { } } -void test_SubFullOflow() { +void test_SubFullOflow(void) { int i,j; for (i = -4; i <= 4; ++i) for (j = -4; j <= 4; ++j) { @@ -341,7 +341,7 @@ void test_SubFullOflow() { } } -void test_SubUsecNorm() { +void test_SubUsecNorm(void) { int i = -4; for (i = -4; i <= 4; ++i) { struct timeval a = timeval_init(i, 600); @@ -353,7 +353,7 @@ void test_SubUsecNorm() { } } -void test_SubUsecOflow() { +void test_SubUsecOflow(void) { int i = -4; for (i = -4; i <= 4; ++i) { struct timeval a = timeval_init(i, 100); @@ -369,7 +369,7 @@ void test_SubUsecOflow() { // test negation //---------------------------------------------------------------------- -void test_Neg() { +void test_Neg(void) { int i = -4; for (i = -4; i <= 4; ++i) { struct timeval a = timeval_init(i, 100); @@ -386,7 +386,7 @@ void test_Neg() { // test abs value //---------------------------------------------------------------------- -void test_AbsNoFrac() { +void test_AbsNoFrac(void) { int i = -4; for (i = -4; i <= 4; ++i) { struct timeval a = timeval_init(i, 0); @@ -397,7 +397,7 @@ void test_AbsNoFrac() { } } -void test_AbsWithFrac() { +void test_AbsWithFrac(void) { int i = -4; for (i = -4; i <= 4; ++i) { struct timeval a = timeval_init(i, 100); @@ -413,8 +413,8 @@ void test_AbsWithFrac() { // --------------------------------------------------------------------- -void test_Helpers2() { - //struct AssertTimevalClose isClose = AssertTimevalClose_init(0, 2); +void test_Helpers2(void) { + struct timeval limit = timeval_init(0, 2); struct timeval x, y; long i; @@ -430,7 +430,7 @@ void test_Helpers2() { TEST_ASSERT_TRUE(AssertTimevalClose(x,y,limit));//ASSERT_PRED_FORMAT2(isClose, x, y); } else { - TEST_ASSERT_FALSE(AssertTimevalClose(x,y,limit));//ASSERT_PRED_FORMAT2(!isClose, x, y); + TEST_ASSERT_FALSE(AssertTimevalClose(x,y,limit)); } } } @@ -446,7 +446,7 @@ void test_Helpers2() { // conversion to l_fp //---------------------------------------------------------------------- -void test_ToLFPbittest() { +void test_ToLFPbittest(void) { l_fp lfpClose = l_fp_init(0,1); u_int32 i = 0; @@ -461,7 +461,7 @@ void test_ToLFPbittest() { } -void test_ToLFPrelPos() { +void test_ToLFPrelPos(void) { l_fp lfpClose = l_fp_init(0,1); int i = 0; @@ -471,11 +471,11 @@ void test_ToLFPrelPos() { l_fp r; r = tval_intv_to_lfp(a); - TEST_ASSERT_TRUE(AssertFpClose(E,r,lfpClose)); //ASSERT_PRED_FORMAT2(FpClose, E, r); + TEST_ASSERT_TRUE(AssertFpClose(E,r,lfpClose)); } } -void test_ToLFPrelNeg() { +void test_ToLFPrelNeg(void) { l_fp lfpClose = l_fp_init(0,1); int i = 0; for (i = 0; i < COUNTOF(fdata); i++) { @@ -484,11 +484,11 @@ void test_ToLFPrelNeg() { l_fp r; r = tval_intv_to_lfp(a); - TEST_ASSERT_TRUE(AssertFpClose(E,r,lfpClose)); //ASSERT_PRED_FORMAT2(FpClose,E, r); + TEST_ASSERT_TRUE(AssertFpClose(E,r,lfpClose)); } } -void test_ToLFPabs() { +void test_ToLFPabs(void) { l_fp lfpClose = l_fp_init(0,1); int i = 0; @@ -498,7 +498,7 @@ void test_ToLFPabs() { l_fp r; r = tval_stamp_to_lfp(a); - TEST_ASSERT_TRUE(AssertFpClose(E,r,lfpClose)); //ASSERT_PRED_FORMAT2(FpClose, E, r); + TEST_ASSERT_TRUE(AssertFpClose(E,r,lfpClose)); } } @@ -506,7 +506,7 @@ void test_ToLFPabs() { // conversion from l_fp //---------------------------------------------------------------------- -void test_FromLFPbittest() { +void test_FromLFPbittest(void) { struct timeval timevalClose = timeval_init(0,1); // Not *exactly* a bittest, because 2**32 tests would take a // really long time even on very fast machines! So we do test @@ -520,11 +520,11 @@ void test_FromLFPbittest() { r = lfp_intv_to_tval(a); // The conversion might be off by one microsecond when // comparing to calculated value. - TEST_ASSERT_TRUE(AssertTimevalClose(E,r,timevalClose)); //ASSERT_PRED_FORMAT2(TimevalClose, E, r); + TEST_ASSERT_TRUE(AssertTimevalClose(E,r,timevalClose)); } } -void test_FromLFPrelPos() { +void test_FromLFPrelPos(void) { struct timeval timevalClose = timeval_init(0,1); int i = 0; for (i = 0; i < COUNTOF(fdata); i++) { @@ -533,11 +533,11 @@ void test_FromLFPrelPos() { struct timeval r; r = lfp_intv_to_tval(a); - TEST_ASSERT_TRUE(AssertTimevalClose(E,r,timevalClose)); //ASSERT_PRED_FORMAT2(TimevalClose, E, r); + TEST_ASSERT_TRUE(AssertTimevalClose(E,r,timevalClose)); } } -void test_FromLFPrelNeg() { +void test_FromLFPrelNeg(void) { struct timeval timevalClose = timeval_init(0,1); int i = 0; for (i = 0; i < COUNTOF(fdata); i++) { @@ -546,12 +546,12 @@ void test_FromLFPrelNeg() { struct timeval r; r = lfp_intv_to_tval(a); - TEST_ASSERT_TRUE(AssertTimevalClose(E,r,timevalClose)); //ASSERT_PRED_FORMAT2(TimevalClose, E, r); + TEST_ASSERT_TRUE(AssertTimevalClose(E,r,timevalClose)); } } // usec -> frac -> usec roundtrip, using a prime start and increment -void test_LFProundtrip() { +void test_LFProundtrip(void) { int32_t t = -1; u_int32 i = 5; for (t = -1; t < 2; ++t) @@ -570,7 +570,7 @@ void test_LFProundtrip() { // string formatting //---------------------------------------------------------------------- -void test_ToString() { +void test_ToString(void) { static const struct { time_t sec; long usec; @@ -588,7 +588,7 @@ void test_ToString() { int i; for (i = 0; i < COUNTOF(data); ++i) { struct timeval a = timeval_init(data[i].sec, data[i].usec); - const char * E = data[i].repr; //?? + const char * E = data[i].repr; const char * r = tvaltoa(a); TEST_ASSERT_EQUAL_STRING(E, r); diff --git a/tests/libntp/vi64ops.c b/tests/libntp/vi64ops.c index af7dd1b7b..0dcd93514 100644 --- a/tests/libntp/vi64ops.c +++ b/tests/libntp/vi64ops.c @@ -7,30 +7,29 @@ #include "vint64ops.h" //technically bool -//int IsEqual(const vint64 &expected, const vint64 &actual) { int IsEqual(const vint64 expected, const vint64 actual) { if (0 == memcmp(&expected, &actual, sizeof(vint64))) { printf( "%x.", expected.D_s.hi); //<< std::hex << expected.D_s.hi << '.' - printf("%x",expected.D_s.lo);//<< std::hex << expected.D_s.lo + printf("%x",expected.D_s.lo); printf(" but was "); - printf("%x.",actual.D_s.hi); //<< std::hex << actual.D_s.hi << '.' - printf("%x\n",actual.D_s.lo); //<< std::hex << actual.D_s.lo; + printf("%x.",actual.D_s.hi); + printf("%x\n",actual.D_s.lo); return TRUE; } else { printf("expected: "); - printf( "%d.", expected.D_s.hi); //<< std::hex << expected.D_s.hi << '.' - printf("%d",expected.D_s.lo);//<< std::hex << expected.D_s.lo + printf( "%d.", expected.D_s.hi); + printf("%d",expected.D_s.lo); printf(" but was "); - printf("%d",actual.D_s.lo); //<< std::hex << actual.D_s.hi << '.' - printf("%d",actual.D_s.lo); //<< std::hex << actual.D_s.lo; + printf("%d",actual.D_s.lo); + printf("%d",actual.D_s.lo); return FALSE; } } // ---------------------------------------------------------------------- // test number parser -void test_ParseVUI64_pos() { +void test_ParseVUI64_pos(void) { vint64 act, exp; const char *sp; char *ep; @@ -44,7 +43,7 @@ void test_ParseVUI64_pos() { TEST_ASSERT_EQUAL(*ep, 'x'); } -void test_ParseVUI64_neg() { +void test_ParseVUI64_neg(void) { vint64 act, exp; const char *sp; char *ep; @@ -57,7 +56,7 @@ void test_ParseVUI64_neg() { TEST_ASSERT_EQUAL(*ep, 'x'); } -void test_ParseVUI64_case() { +void test_ParseVUI64_case(void) { vint64 act, exp; const char *sp; char *ep;