From 45ee4775719be238c6484f8eab72bb45de416163 Mon Sep 17 00:00:00 2001 From: agessaman Date: Fri, 14 Aug 2026 09:05:05 -0700 Subject: [PATCH] test(native): declare stdlib in the Arduino mock so ConfigSerializer builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- test/mocks/Arduino.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/mocks/Arduino.h b/test/mocks/Arduino.h index 77499fe41..a3d5b2765 100644 --- a/test/mocks/Arduino.h +++ b/test/mocks/Arduino.h @@ -2,8 +2,15 @@ #include #include +// 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 #include "Stream.h" +using std::atof; +using std::atoi; +using std::atol; + inline uint32_t g_mock_millis = 0; using std::isnan;