Add schedule sync and schedule-aware playback
This commit is contained in:
@@ -26,6 +26,24 @@ TEST(TimeZoneTest, UtcTimestampFormat) {
|
||||
EXPECT_NE(iso.find("UTC"), std::string::npos);
|
||||
}
|
||||
|
||||
TEST(TimeZoneTest, CurrentLocalMinutesInRangeAndMatchesUtc) {
|
||||
int minutes = currentLocalMinutes("UTC");
|
||||
EXPECT_GE(minutes, 0);
|
||||
EXPECT_LT(minutes, 1440);
|
||||
|
||||
// Cross-check against the UTC wall clock. The two calls happen within the
|
||||
// same second, so a minute-boundary rollover is vanishingly unlikely.
|
||||
time_t now = std::time(nullptr);
|
||||
struct tm gmt_buf;
|
||||
gmtime_r(&now, &gmt_buf);
|
||||
EXPECT_EQ(minutes, gmt_buf.tm_hour * 60 + gmt_buf.tm_min);
|
||||
|
||||
// A timezone that is known to differ from UTC must still be in range.
|
||||
int ny = currentLocalMinutes("America/New_York");
|
||||
EXPECT_GE(ny, 0);
|
||||
EXPECT_LT(ny, 1440);
|
||||
}
|
||||
|
||||
TEST(TimeZoneTest, FormatUtcToTimezone) {
|
||||
// 2026-07-24 12:00:00 UTC
|
||||
// Fixed epoch timestamp: 1784808000
|
||||
|
||||
Reference in New Issue
Block a user