mirror of
https://github.com/esphome/esphome.git
synced 2026-02-18 15:35:59 -07:00
fix, macos and linux disagree on ambig time
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user