From: Harlan Stenn Date: Sat, 13 Jun 2015 02:47:12 +0000 (+0000) Subject: testcalshims.h cleanup X-Git-Tag: NTP_4_3_40~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d284afa8f6896c967ccb3e33c16db183d61f99cd;p=thirdparty%2Fntp.git testcalshims.h cleanup bk: 557b99b0dfvxS5d1vUSe3kwQIjaHXQ --- diff --git a/tests/libntp/a_md5encrypt.c b/tests/libntp/a_md5encrypt.c index 81b474748..e18367735 100644 --- a/tests/libntp/a_md5encrypt.c +++ b/tests/libntp/a_md5encrypt.c @@ -1,10 +1,6 @@ -#include "testcalshims.h" -//#include "config.h" +#include "config.h" #include "unity.h" - - - #ifdef OPENSSL # include "openssl/err.h" # include "openssl/rand.h" diff --git a/tests/libntp/atoint.c b/tests/libntp/atoint.c index c3a5b2a05..aca6ef596 100644 --- a/tests/libntp/atoint.c +++ b/tests/libntp/atoint.c @@ -1,4 +1,7 @@ -#include "testcalshims.h" +#include "config.h" + +#include "ntp_stdlib.h" +#include "ntp_calendar.h" #include "unity.h" void test_RegularPositive(void) { diff --git a/tests/libntp/atouint.c b/tests/libntp/atouint.c index 2dc45bc0a..33c15a914 100644 --- a/tests/libntp/atouint.c +++ b/tests/libntp/atouint.c @@ -1,5 +1,7 @@ -//#include "config.h" -#include "testcalshims.h" +#include "config.h" + +#include "ntp_stdlib.h" +#include "ntp_calendar.h" #include "ntp_fp.h" #include "unity.h" diff --git a/tests/libntp/authkeys.c b/tests/libntp/authkeys.c index 68ffb94ce..b949628da 100644 --- a/tests/libntp/authkeys.c +++ b/tests/libntp/authkeys.c @@ -1,7 +1,11 @@ /* This file contains test for both libntp/authkeys.c and libntp/authusekey.c */ #include "config.h" -//#include "testcalshims.h" + +#include "ntp.h" +#include "ntp_stdlib.h" +#include "ntp_calendar.h" + #include "unity.h" #ifdef OPENSSL @@ -9,8 +13,6 @@ # include "openssl/rand.h" # include "openssl/evp.h" #endif -#include "ntp.h" -#include "ntp_stdlib.h" u_long current_time = 4; int counter = 0; diff --git a/tests/libntp/hextoint.c b/tests/libntp/hextoint.c index 6a399c5a3..e9f0d398f 100644 --- a/tests/libntp/hextoint.c +++ b/tests/libntp/hextoint.c @@ -1,8 +1,10 @@ -#include "testcalshims.h" -//#include "config.h" +#include "config.h" + +#include "ntp_stdlib.h" +#include "ntp_calendar.h" #include "ntp_fp.h" + #include "unity.h" -//#include "libntptest.h" void test_SingleDigit(void) { diff --git a/tests/libntp/lfpfunc.c b/tests/libntp/lfpfunc.c index 2ce9a4b2e..6248eb7fa 100644 --- a/tests/libntp/lfpfunc.c +++ b/tests/libntp/lfpfunc.c @@ -1,19 +1,10 @@ -//#include "c_timestructs.h" - -#include "testcalshims.h" - -//#define UNITY_INCLUDE_DOUBLE //moved to unity -> nope, put into CFLAGS -//#define UNITY_EXCLUDE_FLOAT - -#include "unity.h" - -//#include "libntptest.h" -//#include "timestructs.h" - - +#include "config.h" +#include "ntp_stdlib.h" +#include "ntp_calendar.h" #include "ntp_fp.h" +#include "unity.h" #include #include diff --git a/tests/libntp/modetoa.c b/tests/libntp/modetoa.c index 616861d47..19a76d585 100644 --- a/tests/libntp/modetoa.c +++ b/tests/libntp/modetoa.c @@ -1,9 +1,9 @@ -#include "testcalshims.h" -//#include "config.h" -//#include "libntptest.h" //used for google test framework, not needed -#include "unity.h" -//#include "ntp_stdlib.h" +#include "config.h" + +#include "ntp_stdlib.h" +#include "ntp_calendar.h" +#include "unity.h" void test_KnownMode(void) { diff --git a/tests/libntp/numtoa.c b/tests/libntp/numtoa.c index d0a8b3aef..1d01c7843 100644 --- a/tests/libntp/numtoa.c +++ b/tests/libntp/numtoa.c @@ -1,6 +1,9 @@ -#include "testcalshims.h" -//#include "config.h" +#include "config.h" + +#include "ntp_stdlib.h" +#include "ntp_calendar.h" #include "ntp_fp.h" + #include "unity.h" diff --git a/tests/libntp/numtohost.c b/tests/libntp/numtohost.c index da94f5d1e..7472f46f6 100644 --- a/tests/libntp/numtohost.c +++ b/tests/libntp/numtohost.c @@ -1,5 +1,7 @@ -#include "testcalshims.h" -//#include "config.h" +#include "config.h" + +#include "ntp_stdlib.h" +#include "ntp_calendar.h" #include "ntp_fp.h" #include "unity.h" diff --git a/tests/libntp/run-test-a_md5encrypt.c b/tests/libntp/run-test-a_md5encrypt.c index fdd20955d..2a4ae7c15 100644 --- a/tests/libntp/run-test-a_md5encrypt.c +++ b/tests/libntp/run-test-a_md5encrypt.c @@ -49,11 +49,11 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "a_md5encrypt.c"; UnityBegin("a_md5encrypt.c"); - RUN_TEST(test_Encrypt, 41); - RUN_TEST(test_DecryptValid, 59); - RUN_TEST(test_DecryptInvalid, 65); - RUN_TEST(test_IPv4AddressToRefId, 73); - RUN_TEST(test_IPv6AddressToRefId, 84); + RUN_TEST(test_Encrypt, 37); + RUN_TEST(test_DecryptValid, 55); + RUN_TEST(test_DecryptInvalid, 61); + RUN_TEST(test_IPv4AddressToRefId, 69); + RUN_TEST(test_IPv6AddressToRefId, 80); return (UnityEnd()); } diff --git a/tests/libntp/run-test-atoint.c b/tests/libntp/run-test-atoint.c index 7618a50d7..2764c9a47 100644 --- a/tests/libntp/run-test-atoint.c +++ b/tests/libntp/run-test-atoint.c @@ -50,12 +50,12 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "atoint.c"; UnityBegin("atoint.c"); - RUN_TEST(test_RegularPositive, 4); - RUN_TEST(test_RegularNegative, 12); - RUN_TEST(test_PositiveOverflowBoundary, 20); - RUN_TEST(test_NegativeOverflowBoundary, 27); - RUN_TEST(test_PositiveOverflowBig, 34); - RUN_TEST(test_IllegalCharacter, 41); + RUN_TEST(test_RegularPositive, 7); + RUN_TEST(test_RegularNegative, 15); + RUN_TEST(test_PositiveOverflowBoundary, 23); + RUN_TEST(test_NegativeOverflowBoundary, 30); + RUN_TEST(test_PositiveOverflowBig, 37); + RUN_TEST(test_IllegalCharacter, 44); return (UnityEnd()); } diff --git a/tests/libntp/run-test-atouint.c b/tests/libntp/run-test-atouint.c index 767edabc3..7adb0840c 100644 --- a/tests/libntp/run-test-atouint.c +++ b/tests/libntp/run-test-atouint.c @@ -49,11 +49,11 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "atouint.c"; UnityBegin("atouint.c"); - RUN_TEST(test_RegularPositive, 7); - RUN_TEST(test_PositiveOverflowBoundary, 15); - RUN_TEST(test_PositiveOverflowBig, 22); - RUN_TEST(test_Negative, 29); - RUN_TEST(test_IllegalChar, 36); + RUN_TEST(test_RegularPositive, 9); + RUN_TEST(test_PositiveOverflowBoundary, 17); + RUN_TEST(test_PositiveOverflowBig, 24); + RUN_TEST(test_Negative, 31); + RUN_TEST(test_IllegalChar, 38); return (UnityEnd()); } diff --git a/tests/libntp/run-test-authkeys.c b/tests/libntp/run-test-authkeys.c index 664675a2a..5e65cc9dc 100644 --- a/tests/libntp/run-test-authkeys.c +++ b/tests/libntp/run-test-authkeys.c @@ -50,12 +50,12 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "authkeys.c"; UnityBegin("authkeys.c"); - RUN_TEST(test_AddTrustedKeys, 69); - RUN_TEST(test_AddUntrustedKey, 80); - RUN_TEST(test_HaveKeyCorrect, 88); - RUN_TEST(test_HaveKeyIncorrect, 97); - RUN_TEST(test_AddWithAuthUseKey, 104); - RUN_TEST(test_EmptyKey, 111); + RUN_TEST(test_AddTrustedKeys, 71); + RUN_TEST(test_AddUntrustedKey, 82); + RUN_TEST(test_HaveKeyCorrect, 90); + RUN_TEST(test_HaveKeyIncorrect, 99); + RUN_TEST(test_AddWithAuthUseKey, 106); + RUN_TEST(test_EmptyKey, 113); return (UnityEnd()); } diff --git a/tests/libntp/run-test-hextoint.c b/tests/libntp/run-test-hextoint.c index a5ef71f72..a69792177 100644 --- a/tests/libntp/run-test-hextoint.c +++ b/tests/libntp/run-test-hextoint.c @@ -49,11 +49,11 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "hextoint.c"; UnityBegin("hextoint.c"); - RUN_TEST(test_SingleDigit, 8); - RUN_TEST(test_MultipleDigits, 16); - RUN_TEST(test_MaxUnsigned, 24); - RUN_TEST(test_Overflow, 32); - RUN_TEST(test_IllegalChar, 39); + RUN_TEST(test_SingleDigit, 10); + RUN_TEST(test_MultipleDigits, 18); + RUN_TEST(test_MaxUnsigned, 26); + RUN_TEST(test_Overflow, 34); + RUN_TEST(test_IllegalChar, 41); return (UnityEnd()); } diff --git a/tests/libntp/run-test-lfpfunc.c b/tests/libntp/run-test-lfpfunc.c index ed867c06e..62a7a902d 100644 --- a/tests/libntp/run-test-lfpfunc.c +++ b/tests/libntp/run-test-lfpfunc.c @@ -53,15 +53,15 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "lfpfunc.c"; UnityBegin("lfpfunc.c"); - RUN_TEST(test_AdditionLR, 327); - RUN_TEST(test_AdditionRL, 345); - RUN_TEST(test_SubtractionLR, 363); - RUN_TEST(test_SubtractionRL, 377); - RUN_TEST(test_Negation, 394); - RUN_TEST(test_Absolute, 413); - RUN_TEST(test_FDF_RoundTrip, 444); - RUN_TEST(test_SignedRelOps, 475); - RUN_TEST(test_UnsignedRelOps, 518); + RUN_TEST(test_AdditionLR, 318); + RUN_TEST(test_AdditionRL, 336); + RUN_TEST(test_SubtractionLR, 354); + RUN_TEST(test_SubtractionRL, 368); + RUN_TEST(test_Negation, 385); + RUN_TEST(test_Absolute, 404); + RUN_TEST(test_FDF_RoundTrip, 435); + RUN_TEST(test_SignedRelOps, 466); + RUN_TEST(test_UnsignedRelOps, 509); return (UnityEnd()); } diff --git a/tests/libntp/run-test-numtoa.c b/tests/libntp/run-test-numtoa.c index 4f8dd126d..5468b72e9 100644 --- a/tests/libntp/run-test-numtoa.c +++ b/tests/libntp/run-test-numtoa.c @@ -46,8 +46,8 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "numtoa.c"; UnityBegin("numtoa.c"); - RUN_TEST(test_Address, 15); - RUN_TEST(test_Netmask, 21); + RUN_TEST(test_Address, 18); + RUN_TEST(test_Netmask, 24); return (UnityEnd()); } diff --git a/tests/libntp/run-test-numtohost.c b/tests/libntp/run-test-numtohost.c index a87e5e3ff..3ec4fdff0 100644 --- a/tests/libntp/run-test-numtohost.c +++ b/tests/libntp/run-test-numtohost.c @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "numtohost.c"; UnityBegin("numtohost.c"); - RUN_TEST(test_LoopbackNetNonResolve, 7); + RUN_TEST(test_LoopbackNetNonResolve, 9); return (UnityEnd()); } diff --git a/tests/libntp/run-test-statestr.c b/tests/libntp/run-test-statestr.c index f25b7491b..6083eee0f 100644 --- a/tests/libntp/run-test-statestr.c +++ b/tests/libntp/run-test-statestr.c @@ -48,10 +48,10 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "statestr.c"; UnityBegin("statestr.c"); - RUN_TEST(test_PeerRestart, 19); - RUN_TEST(test_SysUnspecified, 23); - RUN_TEST(test_ClockCodeExists, 28); - RUN_TEST(test_ClockCodeUnknown, 32); + RUN_TEST(test_PeerRestart, 20); + RUN_TEST(test_SysUnspecified, 24); + RUN_TEST(test_ClockCodeExists, 29); + RUN_TEST(test_ClockCodeUnknown, 33); return (UnityEnd()); } diff --git a/tests/libntp/run-test-ymd2yd.c b/tests/libntp/run-test-ymd2yd.c index ede360034..faf2fcb68 100644 --- a/tests/libntp/run-test-ymd2yd.c +++ b/tests/libntp/run-test-ymd2yd.c @@ -48,10 +48,10 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "ymd2yd.c"; UnityBegin("ymd2yd.c"); - RUN_TEST(test_NonLeapYearFebruary, 13); - RUN_TEST(test_NonLeapYearJune, 17); - RUN_TEST(test_LeapYearFebruary, 22); - RUN_TEST(test_LeapYearDecember, 26); + RUN_TEST(test_NonLeapYearFebruary, 17); + RUN_TEST(test_NonLeapYearJune, 21); + RUN_TEST(test_LeapYearFebruary, 26); + RUN_TEST(test_LeapYearDecember, 30); return (UnityEnd()); } diff --git a/tests/libntp/statestr.c b/tests/libntp/statestr.c index a5c647d50..5f7babe45 100644 --- a/tests/libntp/statestr.c +++ b/tests/libntp/statestr.c @@ -1,11 +1,12 @@ -//#include "config.h" -#include "testcalshims.h" -//#include "libntptest.h" +#include "config.h" -#include "unity.h" -#include "ntp.h" // Needed for MAX_MAC_LEN used in ntp_control.h +#include "ntp_stdlib.h" +#include "ntp_calendar.h" +#include "ntp.h" // Needed for MAX_MAC_LEN used in ntp_control.h #include "ntp_control.h" +#include "unity.h" + void setUp(void) { } diff --git a/tests/libntp/testcalshims.c b/tests/libntp/testcalshims.c index da59ecb34..6e77a70bb 100644 --- a/tests/libntp/testcalshims.c +++ b/tests/libntp/testcalshims.c @@ -1,4 +1,7 @@ -#include "testcalshims.h" +#include "config.h" + +#include "ntp_stdlib.h" +#include "ntp_calendar.h" /* This file contains various constants that libntp needs to be set * and that is normally defined in ntpd/ntpq/... diff --git a/tests/libntp/uglydate.c b/tests/libntp/uglydate.c index 047ce4f93..a087da601 100644 --- a/tests/libntp/uglydate.c +++ b/tests/libntp/uglydate.c @@ -1,10 +1,10 @@ -//#include "config.h" -#include "testcalshims.h" +#include "config.h" + +#include "ntp_stdlib.h" +#include "ntp_calendar.h" #include "ntp_fp.h" #include "unity.h" -//#include "ntp_stdlib.h" -//#include "libntptest.h" void test_ConstantDateTime(void) { diff --git a/tests/libntp/ymd2yd.c b/tests/libntp/ymd2yd.c index 16e508809..8e0725c13 100644 --- a/tests/libntp/ymd2yd.c +++ b/tests/libntp/ymd2yd.c @@ -1,4 +1,8 @@ -#include "testcalshims.h" +#include "config.h" + +#include "ntp_stdlib.h" +#include "ntp_calendar.h" + #include "unity.h" void setUp(void)