[Git][NTPsec/ntpsec][working] Replaced many indentation spaces with tabs.

Ian Bruene gitlab at mg.gitlab.com
Wed Jul 4 18:31:20 UTC 2018


Ian Bruene pushed to branch working at NTPsec / ntpsec


Commits:
91df0a9b by Ian Bruene at 2018-07-04T18:31:13Z
Replaced many indentation spaces with tabs.

- - - - -


1 changed file:

- tests/libntp/ntp_calendar.c


Changes:

=====================================
tests/libntp/ntp_calendar.c
=====================================
--- a/tests/libntp/ntp_calendar.c
+++ b/tests/libntp/ntp_calendar.c
@@ -26,18 +26,18 @@ static const char *DateToString(char *str, const struct calendar *cal) {
 
 
 static bool IsEqualDate(const struct calendar *expected,
-                        const struct calendar *actual) {
+						const struct calendar *actual) {
 	char str[255];
 	char str1[255];
 	if (expected->year == actual->year &&
-	    (!expected->yearday || expected->yearday == actual->yearday) &&
-	    expected->month == actual->month &&
-	    expected->monthday == actual->monthday) {
+		(!expected->yearday || expected->yearday == actual->yearday) &&
+		expected->month == actual->month &&
+		expected->monthday == actual->monthday) {
 			return true;
 	} else {
 		printf("Expected: %s but was %s\n",
-                       DateToString(str, expected),
-                       DateToString(str1, actual));
+						DateToString(str, expected),
+						DateToString(str1, actual));
 		return false;
 	}
 }
@@ -62,7 +62,7 @@ static const unsigned short real_month_days[2][14] = {
 };
 
 TEST(calendar, is_leapyear) {
-        /* check is_leapyear() */
+		/* check is_leapyear() */
 	TEST_ASSERT_EQUAL(false, is_leapyear(1900));
 	TEST_ASSERT_EQUAL(false, is_leapyear(1970));
 	TEST_ASSERT_EQUAL(false, is_leapyear(1999));
@@ -73,7 +73,7 @@ TEST(calendar, is_leapyear) {
 }
 
 TEST(calendar, julian0) {
-        /* check julian0() */
+		/* check julian0() */
 	TEST_ASSERT_EQUAL(693961, julian0(1900));
 	TEST_ASSERT_EQUAL(719528, julian0(1970));
 	TEST_ASSERT_EQUAL(730120, julian0(1999));
@@ -83,7 +83,7 @@ TEST(calendar, julian0) {
 }
 
 TEST(calendar, days_per_year) {
-        /* check is_leapyear() */
+		/* check is_leapyear() */
 	TEST_ASSERT_EQUAL(365, days_per_year(1900));
 	TEST_ASSERT_EQUAL(365, days_per_year(1970));
 	TEST_ASSERT_EQUAL(365, days_per_year(1999));
@@ -95,58 +95,57 @@ TEST(calendar, days_per_year) {
 
 #ifdef CLOCK_GENERIC
 TEST(calendar, parse_to_unixtime) {
-        /* check is_leapyear() */
-        clocktime_t  	ct;
-        time_t       	result;
-        unsigned long       Flag;
-
-        ct.day = 1;
-        ct.month = 1;
-        ct.year = 1970;
-        ct.hour = ct.minute = ct.second = ct.usecond = 0;
-        ct.utcoffset = 0;
-        ct.utctime = 0;
-        ct.flags = 0;
-
-        Flag = 0;
-        result = parse_to_unixtime( &ct, &Flag );
+		/* check is_leapyear() */
+	clocktime_t  	ct;
+	time_t       	result;
+	unsigned long       Flag;
+
+	ct.day = 1;
+	ct.month = 1;
+	ct.year = 1970;
+	ct.hour = ct.minute = ct.second = ct.usecond = 0;
+	ct.utcoffset = 0;
+	ct.utctime = 0;
+	ct.flags = 0;
+
+	Flag = 0;
+	result = parse_to_unixtime( &ct, &Flag );
 
 	TEST_ASSERT_EQUAL(0, result);
 
-        ct.year = 2000;
-        ct.hour = 2;
-        ct.utctime = 0;
-        result = parse_to_unixtime( &ct, &Flag );
+	ct.year = 2000;
+	ct.hour = 2;
+	ct.utctime = 0;
+	result = parse_to_unixtime( &ct, &Flag );
 	TEST_ASSERT_EQUAL(946692000L, result);
 
-        ct.year = 2037;
-        ct.minute = 2;
-        ct.second = 3;
-        ct.utctime = 0;
-        result = parse_to_unixtime( &ct, &Flag );
+	ct.year = 2037;
+	ct.minute = 2;
+	ct.second = 3;
+	ct.utctime = 0;
+	result = parse_to_unixtime( &ct, &Flag );
 	TEST_ASSERT_EQUAL(2114388123L, result);
 }
 #endif
-
 TEST(calendar, PeriodicExtend1) {
-  // Test positive cycle, pivot > value
-  TEST_ASSERT_EQUAL(1001, ntpcal_periodic_extend(1000, 5, 2));
-  // Test positive cycle, pivot < value
-  TEST_ASSERT_EQUAL(6, ntpcal_periodic_extend(5, 1000, 2));
-  // Test negative cycle, pivot > value
-  TEST_ASSERT_EQUAL(999, ntpcal_periodic_extend(1000, 5, -2));
-  // Test negative cycle, pivot < value
-  TEST_ASSERT_EQUAL(4, ntpcal_periodic_extend(5, 1000, -2));
+	// Test positive cycle, pivot > value
+	TEST_ASSERT_EQUAL(1001, ntpcal_periodic_extend(1000, 5, 2));
+	// Test positive cycle, pivot < value
+	TEST_ASSERT_EQUAL(6, ntpcal_periodic_extend(5, 1000, 2));
+	// Test negative cycle, pivot > value
+	TEST_ASSERT_EQUAL(999, ntpcal_periodic_extend(1000, 5, -2));
+	// Test negative cycle, pivot < value
+	TEST_ASSERT_EQUAL(4, ntpcal_periodic_extend(5, 1000, -2));
 }
 
 // test the NTP to 64-bit Unix scale time conversion
 TEST(calendar, NtpToTime1) {
-    TEST_ASSERT_EQUAL(2085978538, ntpcal_ntp_to_time(42, 23));
+	TEST_ASSERT_EQUAL(2085978538, ntpcal_ntp_to_time(42, 23));
 }
 
 // test the NTP to 64-bit NTP scale time conversion
 TEST(calendar, NtpToNtp1) {
-    TEST_ASSERT_EQUAL(4294967338, ntpcal_ntp_to_ntp(42, 23));
+	TEST_ASSERT_EQUAL(4294967338, ntpcal_ntp_to_ntp(42, 23));
 }
 
 // test the day/sec join & split ops, making sure that 32bit
@@ -179,7 +178,7 @@ TEST(calendar, DaySplitMerge) {
 }
 
 TEST(calendar, SplitEraDays1) {
-    ntpcal_split res;
+	ntpcal_split res;
 	int32_t isleapyear = 42;
 
 	// Test no flag, no-leap, positive
@@ -249,7 +248,7 @@ TEST(calendar, RataDie1) {
 }
 
 TEST(calendar, DaysecToDate1) {
-    struct calendar cal;
+	struct calendar cal;
 	int32_t days;
 
 	// Test normal date
@@ -268,7 +267,7 @@ TEST(calendar, DaysecToDate1) {
 }
 
 TEST(calendar, TimeToDate1) {
-    struct calendar jd = {0, 0, 0, 0, 0, 0, 0, 0};
+	struct calendar jd = {0, 0, 0, 0, 0, 0, 0, 0};
 	int res;
 
 	res = ntpcal_time_to_date(&jd, 1000000);
@@ -288,42 +287,42 @@ TEST(calendar, DayJoin1) {
 }
 
 TEST(calendar, DaysInYears1) {
-    // Test positive less than one gregorian cycle of years
-    TEST_ASSERT_EQUAL(109572, ntpcal_days_in_years(300));
-    // Test positive one gregorian cycle of years
-    TEST_ASSERT_EQUAL(146097, ntpcal_days_in_years(400));
-    // Test positive greater than one gregorian cycle of years
-    TEST_ASSERT_EQUAL(182621, ntpcal_days_in_years(500));
-    // Test negative less than one gregorian cycle of years
-    TEST_ASSERT_EQUAL(-109573, ntpcal_days_in_years(-300));
-    // Test negative one gregorian cycle of years
-    TEST_ASSERT_EQUAL(-146097, ntpcal_days_in_years(-400));
-    // Test negative greater than one gregorian cycle of years
-    TEST_ASSERT_EQUAL(-182622, ntpcal_days_in_years(-500));
+	// Test positive less than one gregorian cycle of years
+	TEST_ASSERT_EQUAL(109572, ntpcal_days_in_years(300));
+	// Test positive one gregorian cycle of years
+	TEST_ASSERT_EQUAL(146097, ntpcal_days_in_years(400));
+	// Test positive greater than one gregorian cycle of years
+	TEST_ASSERT_EQUAL(182621, ntpcal_days_in_years(500));
+	// Test negative less than one gregorian cycle of years
+	TEST_ASSERT_EQUAL(-109573, ntpcal_days_in_years(-300));
+	// Test negative one gregorian cycle of years
+	TEST_ASSERT_EQUAL(-146097, ntpcal_days_in_years(-400));
+	// Test negative greater than one gregorian cycle of years
+	TEST_ASSERT_EQUAL(-182622, ntpcal_days_in_years(-500));
 }
 
 TEST(calendar, EdateToEradays1) {
-    // Test positive, no months
-    TEST_ASSERT_EQUAL(1827, ntpcal_edate_to_eradays(5, 0, 1));
-    // Test positive, with months
-    TEST_ASSERT_EQUAL(1917, ntpcal_edate_to_eradays(5, 3, 1));
-    // Test negative, no months
-    TEST_ASSERT_EQUAL(-1828, ntpcal_edate_to_eradays(-5, 0, -1));
-    // Test negative, with months
-    TEST_ASSERT_EQUAL(-1920, ntpcal_edate_to_eradays(-5, -3, -1));
+	// Test positive, no months
+	TEST_ASSERT_EQUAL(1827, ntpcal_edate_to_eradays(5, 0, 1));
+	// Test positive, with months
+	TEST_ASSERT_EQUAL(1917, ntpcal_edate_to_eradays(5, 3, 1));
+	// Test negative, no months
+	TEST_ASSERT_EQUAL(-1828, ntpcal_edate_to_eradays(-5, 0, -1));
+	// Test negative, with months
+	TEST_ASSERT_EQUAL(-1920, ntpcal_edate_to_eradays(-5, -3, -1));
 }
 
 TEST(calendar, EtimeToSeconds1) {
-    TEST_ASSERT_EQUAL(18181, ntpcal_etime_to_seconds(5, 3, 1));
+	TEST_ASSERT_EQUAL(18181, ntpcal_etime_to_seconds(5, 3, 1));
 }
 
 TEST(calendar, TmToRd1) {
-    struct tm utm;
+	struct tm utm;
 
-    utm.tm_year = 10;
-    utm.tm_mon = 5;
-    utm.tm_mday = 1;
-    TEST_ASSERT_EQUAL(697399, ntpcal_tm_to_rd(&utm));
+	utm.tm_year = 10;
+	utm.tm_mon = 5;
+	utm.tm_mday = 1;
+	TEST_ASSERT_EQUAL(697399, ntpcal_tm_to_rd(&utm));
 }
 
 // check last day of february for first 10000 years
@@ -389,7 +388,7 @@ TEST(calendar, RoundTripDate) {
 }
 
 TEST(calendar, DateToDaysec1) {
-    struct calendar jd;
+	struct calendar jd;
 
 	jd.hour = 18;
 	jd.minute = 45;
@@ -398,7 +397,7 @@ TEST(calendar, DateToDaysec1) {
 }
 
 TEST(calendar, TmToDaysec1) {
-    struct tm utm;
+	struct tm utm;
 
 	utm.tm_hour = 18;
 	utm.tm_min = 45;
@@ -407,7 +406,7 @@ TEST(calendar, TmToDaysec1) {
 }
 
 TEST(calendar, DateToTime1) {
-    struct calendar jd;
+	struct calendar jd;
 
 	jd.year = 2000;
 	jd.month = 2;
@@ -419,7 +418,7 @@ TEST(calendar, DateToTime1) {
 }
 
 TEST(calendar, Ntp64ToDate1) {
-    struct calendar jd;
+	struct calendar jd;
 
 	TEST_ASSERT_EQUAL(0, ntpcal_ntp64_to_date(&jd, 10000000));
 	TEST_ASSERT_EQUAL(1900, jd.year);
@@ -431,7 +430,7 @@ TEST(calendar, Ntp64ToDate1) {
 }
 
 TEST(calendar, NtpToDate1) {
-    struct calendar jd;
+	struct calendar jd;
 
 	TEST_ASSERT_EQUAL(1, ntpcal_ntp_to_date(&jd, 86400, 1000000));
 	TEST_ASSERT_EQUAL(2036, jd.year);



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/91df0a9b6ac2490a426507a4c044e7a4c63415ff

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/91df0a9b6ac2490a426507a4c044e7a4c63415ff
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20180704/2aac276c/attachment.html>


More information about the vc mailing list