Пример #1
0
// Roundtrip testing on caldaystart
void test_RoundTripDayStart() {
    static const time_t pivot = 0;
    u_int32 ntp, expds, truds;
    struct calendar date;

    for (ntp = 0; ntp < 0xFFFFFFFFu - 80000u; ntp += 80000u) {
        truds = caldaystart(ntp, &pivot);
        ntpcal_ntp_to_date(&date, ntp, &pivot);
        date.hour = date.minute = date.second = 0;
        expds = ntpcal_date_to_ntp(&date);
        TEST_ASSERT_EQUAL(expds, truds);
    }
}
Пример #2
0
// Roundtrip testing on caldaystart
TEST_F(calendarTest, RoundTripDayStart) {
	static const time_t pivot = 0;
	u_int32 ntp, expds, truds;
	calendar date;

	for (ntp = 0; ntp < 0xFFFFFFFFu - 80000u; ntp += 80000u) {
		truds = caldaystart(ntp, &pivot);
		ntpcal_ntp_to_date(&date, ntp, &pivot);
		date.hour = date.minute = date.second = 0;
		expds = ntpcal_date_to_ntp(&date);
		EXPECT_EQ(expds, truds);
	}
}