mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-10-24 19:42:22 +00:00
test(native): declare stdlib in the Arduino mock so ConfigSerializer builds
The real Arduino.h includes stdlib.h, so ConfigSerializer.cpp reaches atoi, atol and atof through it and compiles on device. The mock supplied only cstdint, cmath and Stream.h, leaving those undeclared — and since the native env compiles ConfigSerializer.cpp into every suite via build_src_filter, all 21 suites errored rather than just its own. Fixing the mock keeps src/ identical to upstream and covers any other source relying on the same transitive include. pio test -e native: 297 test cases, 297 succeeded.
This commit is contained in:
1 parent
535b512fa9
commit
45ee477571
1 file changed
+7
@@ -2,8 +2,15 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <cmath>
|
||||
// The real Arduino.h pulls in stdlib.h, so device code reaches atoi/atol/atof/strtoul
|
||||
// without including it. Mirror that here or those sources fail only on the native build.
|
||||
#include <cstdlib>
|
||||
#include "Stream.h"
|
||||
|
||||
using std::atof;
|
||||
using std::atoi;
|
||||
using std::atol;
|
||||
|
||||
inline uint32_t g_mock_millis = 0;
|
||||
|
||||
using std::isnan;
|
||||
|
||||
Reference in new issue
Block a user