fix, macos and linux disagree on ambig time

This commit is contained in:
J. Nick Koston
2026-01-30 01:18:16 -06:00
parent cfea3472bd
commit d31a860bf2
2 changed files with 7 additions and 6 deletions

View File

@@ -1098,10 +1098,11 @@ TEST(RecalcTimestampLocal, FallBackRepeatedHour) {
EXPECT_EQ(esp_result, libc_result);
// Test the repeated hour (1:30 AM occurs twice)
// Both implementations should resolve this the same way (typically standard time)
libc_result = libc_mktime(2026, 11, 1, 1, 30, 0);
// libc behavior varies by platform for this edge case, so we verify our
// consistent behavior: prefer standard time (later UTC timestamp)
esp_result = esptime_recalc_local(2026, 11, 1, 1, 30, 0);
EXPECT_EQ(esp_result, libc_result);
time_t std_interpretation = esptime_recalc_local(2026, 11, 1, 2, 30, 0) - 3600; // 2:30 CST - 1 hour
EXPECT_EQ(esp_result, std_interpretation);
}
TEST(RecalcTimestampLocal, SouthernHemisphereDST) {