[Git][NTPsec/ntpsec][working] Whitespace fixes.
Ian Bruene
gitlab at mg.gitlab.com
Thu Jul 12 14:33:16 UTC 2018
Ian Bruene pushed to branch working at NTPsec / ntpsec
Commits:
24f1f03d by Ian Bruene at 2018-07-12T14:32:43Z
Whitespace fixes.
- - - - -
1 changed file:
- tests/libntp/ntp_calendar.c
Changes:
=====================================
tests/libntp/ntp_calendar.c
=====================================
@@ -141,12 +141,12 @@ TEST(calendar, PeriodicExtend1) {
// 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
@@ -180,33 +180,33 @@ TEST(calendar, DaySplitMerge) {
TEST(calendar, SplitEraDays1) {
ntpcal_split res;
- int32_t isleapyear = 42;
-
- // Test no flag, no-leap, positive
- res = ntpcal_split_eradays(4, NULL);
- TEST_ASSERT_EQUAL(0, res.hi);
- TEST_ASSERT_EQUAL(4, res.lo);
- TEST_ASSERT_EQUAL(42, isleapyear);
-
- // Test flag, no-leap, positive
- res = ntpcal_split_eradays(4, &isleapyear);
- TEST_ASSERT_EQUAL(0, res.hi);
- TEST_ASSERT_EQUAL(4, res.lo);
- TEST_ASSERT_EQUAL(0, isleapyear);
-
- // Test flag, leap, positive
- res = ntpcal_split_eradays(1400, &isleapyear);
- TEST_ASSERT_EQUAL(3, res.hi);
- TEST_ASSERT_EQUAL(305, res.lo);
- TEST_ASSERT_EQUAL(1, isleapyear);
-
- isleapyear = 0;
-
- // Test flag, leap, negative
- res = ntpcal_split_eradays(-100, &isleapyear);
- TEST_ASSERT_EQUAL(-1, res.hi);
- TEST_ASSERT_EQUAL(266, res.lo);
- TEST_ASSERT_EQUAL(1, isleapyear);
+ int32_t isleapyear = 42;
+
+ // Test no flag, no-leap, positive
+ res = ntpcal_split_eradays(4, NULL);
+ TEST_ASSERT_EQUAL(0, res.hi);
+ TEST_ASSERT_EQUAL(4, res.lo);
+ TEST_ASSERT_EQUAL(42, isleapyear);
+
+ // Test flag, no-leap, positive
+ res = ntpcal_split_eradays(4, &isleapyear);
+ TEST_ASSERT_EQUAL(0, res.hi);
+ TEST_ASSERT_EQUAL(4, res.lo);
+ TEST_ASSERT_EQUAL(0, isleapyear);
+
+ // Test flag, leap, positive
+ res = ntpcal_split_eradays(1400, &isleapyear);
+ TEST_ASSERT_EQUAL(3, res.hi);
+ TEST_ASSERT_EQUAL(305, res.lo);
+ TEST_ASSERT_EQUAL(1, isleapyear);
+
+ isleapyear = 0;
+
+ // Test flag, leap, negative
+ res = ntpcal_split_eradays(-100, &isleapyear);
+ TEST_ASSERT_EQUAL(-1, res.hi);
+ TEST_ASSERT_EQUAL(266, res.lo);
+ TEST_ASSERT_EQUAL(1, isleapyear);
}
TEST(calendar, SplitYearDays1) {
@@ -250,41 +250,41 @@ TEST(calendar, RataDie1) {
TEST(calendar, DaysecToDate1) {
struct calendar cal;
- int32_t days;
-
- // Test normal date
- days = ntpcal_daysec_to_date(&cal, 100000);
- TEST_ASSERT_EQUAL(days, 1);
- TEST_ASSERT_EQUAL(cal.hour, 3);
- TEST_ASSERT_EQUAL(cal.minute, 46);
- TEST_ASSERT_EQUAL(cal.second, 40);
-
- // Test negative date
- days = ntpcal_daysec_to_date(&cal, -100000);
- TEST_ASSERT_EQUAL(-2, days);
- TEST_ASSERT_EQUAL(20, cal.hour);
- TEST_ASSERT_EQUAL(13, cal.minute);
- TEST_ASSERT_EQUAL(20, cal.second);
+ int32_t days;
+
+ // Test normal date
+ days = ntpcal_daysec_to_date(&cal, 100000);
+ TEST_ASSERT_EQUAL(days, 1);
+ TEST_ASSERT_EQUAL(cal.hour, 3);
+ TEST_ASSERT_EQUAL(cal.minute, 46);
+ TEST_ASSERT_EQUAL(cal.second, 40);
+
+ // Test negative date
+ days = ntpcal_daysec_to_date(&cal, -100000);
+ TEST_ASSERT_EQUAL(-2, days);
+ TEST_ASSERT_EQUAL(20, cal.hour);
+ TEST_ASSERT_EQUAL(13, cal.minute);
+ TEST_ASSERT_EQUAL(20, cal.second);
}
TEST(calendar, TimeToDate1) {
struct calendar jd = {0, 0, 0, 0, 0, 0, 0, 0};
- int res;
-
- res = ntpcal_time_to_date(&jd, 1000000);
- TEST_ASSERT_EQUAL(0, res);
- TEST_ASSERT_EQUAL(1970, jd.year);
- TEST_ASSERT_EQUAL(12, jd.yearday);
- TEST_ASSERT_EQUAL(1, jd.month);
- TEST_ASSERT_EQUAL(12, jd.monthday);
- TEST_ASSERT_EQUAL(13, jd.hour);
- TEST_ASSERT_EQUAL(46, jd.minute);
- TEST_ASSERT_EQUAL(40, jd.second);
- TEST_ASSERT_EQUAL(1, jd.weekday);
+ int res;
+
+ res = ntpcal_time_to_date(&jd, 1000000);
+ TEST_ASSERT_EQUAL(0, res);
+ TEST_ASSERT_EQUAL(1970, jd.year);
+ TEST_ASSERT_EQUAL(12, jd.yearday);
+ TEST_ASSERT_EQUAL(1, jd.month);
+ TEST_ASSERT_EQUAL(12, jd.monthday);
+ TEST_ASSERT_EQUAL(13, jd.hour);
+ TEST_ASSERT_EQUAL(46, jd.minute);
+ TEST_ASSERT_EQUAL(40, jd.second);
+ TEST_ASSERT_EQUAL(1, jd.weekday);
}
TEST(calendar, DayJoin1) {
- TEST_ASSERT_EQUAL(4323600, ntpcal_dayjoin(50, 3600));
+ TEST_ASSERT_EQUAL(4323600, ntpcal_dayjoin(50, 3600));
}
TEST(calendar, DaysInYears1) {
@@ -391,55 +391,55 @@ TEST(calendar, RoundTripDate) {
TEST(calendar, DateToDaysec1) {
struct calendar jd;
- jd.hour = 18;
- jd.minute = 45;
- jd.second = 15;
- TEST_ASSERT_EQUAL(67515, ntpcal_date_to_daysec(&jd));
+ jd.hour = 18;
+ jd.minute = 45;
+ jd.second = 15;
+ TEST_ASSERT_EQUAL(67515, ntpcal_date_to_daysec(&jd));
}
TEST(calendar, TmToDaysec1) {
struct tm utm;
- utm.tm_hour = 18;
- utm.tm_min = 45;
- utm.tm_sec = 15;
- TEST_ASSERT_EQUAL(67515, ntpcal_tm_to_daysec(&utm));
+ utm.tm_hour = 18;
+ utm.tm_min = 45;
+ utm.tm_sec = 15;
+ TEST_ASSERT_EQUAL(67515, ntpcal_tm_to_daysec(&utm));
}
TEST(calendar, DateToTime1) {
struct calendar jd;
- jd.year = 2000;
- jd.month = 2;
- jd.monthday = 4;
- jd.hour = 8;
- jd.minute = 16;
- jd.second = 32;
- TEST_ASSERT_EQUAL(949652192, ntpcal_date_to_time(&jd));
+ jd.year = 2000;
+ jd.month = 2;
+ jd.monthday = 4;
+ jd.hour = 8;
+ jd.minute = 16;
+ jd.second = 32;
+ TEST_ASSERT_EQUAL(949652192, ntpcal_date_to_time(&jd));
}
TEST(calendar, Ntp64ToDate1) {
struct calendar jd;
- TEST_ASSERT_EQUAL(0, ntpcal_ntp64_to_date(&jd, 10000000));
- TEST_ASSERT_EQUAL(1900, jd.year);
- TEST_ASSERT_EQUAL(4, jd.month);
- TEST_ASSERT_EQUAL(26, jd.monthday);
- TEST_ASSERT_EQUAL(17, jd.hour);
- TEST_ASSERT_EQUAL(46, jd.minute);
- TEST_ASSERT_EQUAL(40, jd.second);
+ TEST_ASSERT_EQUAL(0, ntpcal_ntp64_to_date(&jd, 10000000));
+ TEST_ASSERT_EQUAL(1900, jd.year);
+ TEST_ASSERT_EQUAL(4, jd.month);
+ TEST_ASSERT_EQUAL(26, jd.monthday);
+ TEST_ASSERT_EQUAL(17, jd.hour);
+ TEST_ASSERT_EQUAL(46, jd.minute);
+ TEST_ASSERT_EQUAL(40, jd.second);
}
TEST(calendar, NtpToDate1) {
struct calendar jd;
- TEST_ASSERT_EQUAL(1, ntpcal_ntp_to_date(&jd, 86400, 1000000));
- TEST_ASSERT_EQUAL(2036, jd.year);
- TEST_ASSERT_EQUAL(2, jd.month);
- TEST_ASSERT_EQUAL(8, jd.monthday);
- TEST_ASSERT_EQUAL(6, jd.hour);
- TEST_ASSERT_EQUAL(28, jd.minute);
- TEST_ASSERT_EQUAL(16, jd.second);
+ TEST_ASSERT_EQUAL(1, ntpcal_ntp_to_date(&jd, 86400, 1000000));
+ TEST_ASSERT_EQUAL(2036, jd.year);
+ TEST_ASSERT_EQUAL(2, jd.month);
+ TEST_ASSERT_EQUAL(8, jd.monthday);
+ TEST_ASSERT_EQUAL(6, jd.hour);
+ TEST_ASSERT_EQUAL(28, jd.minute);
+ TEST_ASSERT_EQUAL(16, jd.second);
}
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/24f1f03d315f13d543c541c410c3d4057f266a47
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/24f1f03d315f13d543c541c410c3d4057f266a47
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/20180712/613e967c/attachment.html>
More information about the vc
mailing list