]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
calendar.c:
authorDamir Tomic <viperus@ntp.org>
Sun, 14 Jun 2015 09:34:05 +0000 (11:34 +0200)
committerDamir Tomic <viperus@ntp.org>
Sun, 14 Jun 2015 09:34:05 +0000 (11:34 +0200)
  forgot to return 2 functions

bk: 557d4a8dNY03raQWDp8wGf-zCuDN5A

tests/libntp/calendar.c
tests/libntp/run-test-calendar.c

index 04aae8a407bf72de24b0bfb439ee0ef0acc5152e..4ac1df469c7050e28800e991ab73bb00bbbd8749 100644 (file)
@@ -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;
        
 }
index f6d4e7e289a17accfc15e0b2f394c06129c26958..07a5092f3faef59f896f9c6582675ab41a992ac1 100644 (file)
@@ -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());
 }