SmingHub / Sming

Sming - powerful open source framework simplifying the creation of embedded C++ applications.
https://sming.readthedocs.io
GNU Lesser General Public License v3.0
1.45k stars 349 forks source link

DateTime checks failing on esp32 #2834

Closed mikee47 closed 1 week ago

mikee47 commented 1 week ago

Running HostTests on esp32 I'm getting a very odd failure in DateTime checks. No problems with esp8266 or host builds (32/64-bit). Something is going on with int32 / int64 values. It's almost like there's a bug in the 64-bit routines somewhere. But that's jumping to conclusions.

RefDate 31/01/2024 00:00:00
Check 24/02/1903 17:31:44 (0s, 0m 0h, 5540d)
Got   24/02/1903 17:31:44, diff 4294967296
FAIL: refTime == calcTime (2185315200, -2109652096)
FAIL in `DateTimeTest::checkSetTime(const FSTR::Array<{anonymous}::TestDate>&, bool)::<lambda(int, int, int, int)>`

Converting to hex we have:

refTime: 0x82414380 calcTime: 0xffffffff82414380

mikee47 commented 1 week ago

Yep, was linking in ROM functions which are 32-bit-only so get truncated values.