From: Damir Tomic Date: Sun, 14 Jun 2015 09:34:05 +0000 (+0200) Subject: calendar.c: X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=347ce880fe18505a0f2b0c0de148c05c8c7fafcc;p=thirdparty%2Fntp.git calendar.c: forgot to return 2 functions bk: 557d4a8dNY03raQWDp8wGf-zCuDN5A --- diff --git a/tests/libntp/calendar.c b/tests/libntp/calendar.c index 04aae8a40..4ac1df469 100644 --- a/tests/libntp/calendar.c +++ b/tests/libntp/calendar.c @@ -79,8 +79,6 @@ char * CalendarFromCalToString(const struct calendar cal) { //& strcat(ss,":"); sprintf(buffer, "%u", (u_int)cal.second); strcat(ss,buffer); - //printf("AAA %s ",ss); - //ss << cal.year << "-" << (u_int)cal.month << "-" << (u_int)cal.monthday << " (" << cal.yearday << ") " << (u_int)cal.hour << ":" << (u_int)cal.minute << ":" << (u_int)cal.second; return ss; @@ -99,7 +97,6 @@ char * CalendarFromIsoToString(const struct isodate iso) { //& strcat(ss,"-"); sprintf(buffer, "%u", (u_int)iso.weekday); strcat(ss,buffer); - //strcat(ss,":"); sprintf(buffer, "%u", (u_int)iso.hour); strcat(ss,buffer); strcat(ss,":"); @@ -108,11 +105,6 @@ char * CalendarFromIsoToString(const struct isodate iso) { //& strcat(ss,":"); sprintf(buffer, "%u", (u_int)iso.second); strcat(ss,buffer); - //strcat(ss,":"); - //sprintf(buffer, "%u", (u_int)cal.second); - //strcat(ss,buffer); - //printf("AAA %s ",ss); - //ss << cal.year << "-" << (u_int)cal.month << "-" << (u_int)cal.monthday << " (" << cal.yearday << ") " << (u_int)cal.hour << ":" << (u_int)cal.minute << ":" << (u_int)cal.second; //ss << iso.year << "-" << (u_int)iso.week << "-" << (u_int)iso.weekday << (u_int)iso.hour << ":" << (u_int)iso.minute << ":" << (u_int)iso.second; return ss; @@ -164,16 +156,8 @@ char * DateFromCalToString(const struct calendar cal) { //& sprintf(buffer, "%u", cal.yearday); strcat(ss,buffer); strcat(ss,")"); -/* - sprintf(buffer, "%u", (u_int)cal.hour); - strcat(ss,buffer); - strcat(ss,":"); - sprintf(buffer, "%u", (u_int)cal.minute); - strcat(ss,buffer); - strcat(ss,":"); - sprintf(buffer, "%u", (u_int)cal.second); - strcat(ss,buffer); -*/ + + return ss; //ss << cal.year << "-" << (u_int)cal.month << "-" << (u_int)cal.monthday << " (" << cal.yearday << ")"; } @@ -191,6 +175,7 @@ char * DateFromIsoToString(const struct isodate iso) { //& sprintf(buffer, "%u", (u_int)iso.weekday); strcat(ss,buffer); + return ss; //ss << iso.year << "-" << (u_int)iso.week << "-" << (u_int)iso.weekday; } diff --git a/tests/libntp/run-test-calendar.c b/tests/libntp/run-test-calendar.c index f6d4e7e28..07a5092f3 100644 --- a/tests/libntp/run-test-calendar.c +++ b/tests/libntp/run-test-calendar.c @@ -55,17 +55,17 @@ int main(int argc, char *argv[]) progname = argv[0]; Unity.TestFile = "calendar.c"; UnityBegin("calendar.c"); - RUN_TEST(test_DaySplitMerge, 245); - RUN_TEST(test_SplitYearDays1, 269); - RUN_TEST(test_SplitYearDays2, 283); - RUN_TEST(test_RataDie1, 298); - RUN_TEST(test_LeapYears1, 308); - RUN_TEST(test_LeapYears2, 323); - RUN_TEST(test_RoundTripDate, 341); - RUN_TEST(test_RoundTripYearStart, 370); - RUN_TEST(test_RoundTripMonthStart, 386); - RUN_TEST(test_RoundTripWeekStart, 402); - RUN_TEST(test_RoundTripDayStart, 418); + 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); return (UnityEnd()); }