[Git][NTPsec/ntpsec][master] 3 commits: Convert numtohost.c

Amar Takhar gitlab at mg.gitlab.com
Wed Nov 25 01:35:31 UTC 2015


Amar Takhar pushed to branch master at NTPsec / ntpsec


Commits:
929e670e by Amar Takhar at 2015-11-24T20:16:18Z
Convert numtohost.c

- - - - -
b5d09e5d by Amar Takhar at 2015-11-24T20:17:54Z
Fix prettydate test.

- - - - -
a4a649fa by Amar Takhar at 2015-11-24T20:35:04Z
Convert modetoa.c

- - - - -


6 changed files:

- tests/common/tests_main.c
- tests/libntp/modetoa.c
- tests/libntp/numtohost.c
- tests/libntp/prettydate.c
- tests/wscript
- wscript


Changes:

=====================================
tests/common/tests_main.c
=====================================
--- a/tests/common/tests_main.c
+++ b/tests/common/tests_main.c
@@ -49,11 +49,11 @@ static void RunAllTests(void)
 //	RUN_TEST_GROUP(humandate);
 //	RUN_TEST_GROUP(lfp);
 //	RUN_TEST_GROUP(lfptostr);
-//	RUN_TEST_GROUP(modetoa);
+	RUN_TEST_GROUP(modetoa);
 //	RUN_TEST_GROUP(msyslog);
 //	RUN_TEST_GROUP(netof);
 	RUN_TEST_GROUP(numtoa);
-//	RUN_TEST_GROUP(numtohost);
+	RUN_TEST_GROUP(numtohost);
 	RUN_TEST_GROUP(prettydate);
 //	RUN_TEST_GROUP(recvbuff);
 //	RUN_TEST_GROUP(refnumtoa);


=====================================
tests/libntp/modetoa.c
=====================================
--- a/tests/libntp/modetoa.c
+++ b/tests/libntp/modetoa.c
@@ -1,7 +1,5 @@
-extern "C" {
 #include "unity.h"
 #include "unity_fixture.h"
-}
 
 TEST_GROUP(modetoa);
 
@@ -11,8 +9,6 @@ TEST_TEAR_DOWN(modetoa) {}
 
 #include "libntptest.h"
 
-class modetoaTest : public libntptest {
-};
 
 TEST(modetoa, KnownMode) {
 	const int MODE = 3; // Should be "client"


=====================================
tests/libntp/numtohost.c
=====================================
--- a/tests/libntp/numtohost.c
+++ b/tests/libntp/numtohost.c
@@ -1,7 +1,6 @@
-extern "C" {
 #include "unity.h"
 #include "unity_fixture.h"
-}
+
 
 TEST_GROUP(numtohost);
 
@@ -11,8 +10,6 @@ TEST_TEAR_DOWN(numtohost) {}
 
 #include "libntptest.h"
 
-class numtohostTest : public libntptest {
-};
 
 TEST(numtohost, LoopbackNetNonResolve) {
 	/* A loopback address in 127.0.0.0/8 is chosen, and
@@ -20,7 +17,7 @@ TEST(numtohost, LoopbackNetNonResolve) {
 	 * it is 127.0.0.1
 	 */
 
-	u_int32 input = 127*256*256*256 + 1*256 + 1; // 127.0.1.1
+	u_int32_t input = 127*256*256*256 + 1*256 + 1; // 127.0.1.1
 
 	TEST_ASSERT_EQUAL_STRING("127.0.1.1", numtohost(htonl(input)));
 }


=====================================
tests/libntp/prettydate.c
=====================================
--- a/tests/libntp/prettydate.c
+++ b/tests/libntp/prettydate.c
@@ -16,7 +16,7 @@ static const u_int32_t HALF = 2147483648UL;
 TEST(prettydate, ConstantDate) {
 	l_fp time = {{3485080800UL}, HALF}; // 2010-06-09 14:00:00.5
 
-	TEST_ASSERT_EQUAL_STRING("cfba1ce0.80000000  2010-06-09T14:00:00.500", gmprettydate(&time));
+	TEST_ASSERT_EQUAL_STRING("cfba1ce0.80000000 2010-06-09T14:00:00.500Z", gmprettydate(&time));
 }
 
 TEST_GROUP_RUNNER(prettydate) {


=====================================
tests/wscript
=====================================
--- a/tests/wscript
+++ b/tests/wscript
@@ -62,11 +62,11 @@ def build(ctx):
 #		"libntp/humandate.c",
 #		"libntp/lfpfunc.c",
 #		"libntp/lfptostr.c",
-#		"libntp/modetoa.c",
+		"libntp/modetoa.c",
 #		"libntp/msyslog.c",
 #		"libntp/netof.c",
 		"libntp/numtoa.c",
-#		"libntp/numtohost.c",
+		"libntp/numtohost.c",
 		"libntp/prettydate.c",
 #		"libntp/recvbuff.c",
 #		"libntp/refnumtoa.c",


=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -107,12 +107,12 @@ def test_print_log(ctx):
 		print("")
 
 		if retval or error:
-			pprint("RED", "****** ERROR ******")
+			pprint("RED", "****** ERROR ******\n")
 
 			print error or lines
 
 		if (not retval) and (not error):
-			pprint("GREEN", "****** LOG ******", lines)
+			pprint("GREEN", "****** LOG ******\n", lines)
 
 		print
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/8c989ef735e2e3a20b14ef39804ae0f91e1025db...a4a649fa3ec630993f397f0cccd19eb77a2055e9
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20151125/56735d2d/attachment.html>


More information about the vc mailing list