// Roundtrip testing on calweekstart void test_RoundTripWeekStart() { static const time_t pivot = 0; u_int32 ntp, expws, truws; struct isodate date; for (ntp = 0; ntp < 0xFFFFFFFFu - 600000u; ntp += 600000u) { truws = calweekstart(ntp, &pivot); isocal_ntp_to_date(&date, ntp, &pivot); date.hour = date.minute = date.second = 0; date.weekday = 1; expws = isocal_date_to_ntp(&date); TEST_ASSERT_EQUAL(expws, truws); } }
// Roundtrip testing on calweekstart TEST_F(calendarTest, RoundTripWeekStart) { static const time_t pivot = 0; u_int32 ntp, expws, truws; isodate date; for (ntp = 0; ntp < 0xFFFFFFFFu - 600000u; ntp += 600000u) { truws = calweekstart(ntp, &pivot); isocal_ntp_to_date(&date, ntp, &pivot); date.hour = date.minute = date.second = 0; date.weekday = 1; expws = isocal_date_to_ntp(&date); EXPECT_EQ(expws, truws); } }