Skip to content

Commit faaafbf

Browse files
committed
Added test case for preprocessor bug reported in arduino#68
Signed-off-by: Cristian Maglie <[email protected]>
1 parent 9c94c0b commit faaafbf

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// See: https://github.com/arduino/arduino-builder/issues/68
2+
3+
// The following avoid duplicate definitions of min and max
4+
#undef min
5+
#undef max
6+
7+
#include <memory>
8+
9+
void setup() {
10+
test();
11+
}
12+
13+
void loop() {}
14+
15+
void test() {}
16+

src/arduino.cc/builder/test/try_build_of_problematic_sketch_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ func TestTryBuild038(t *testing.T) {
199199
tryBuild(t, "sketch_with_multiline_prototypes", "sketch_with_multiline_prototypes.ino")
200200
}
201201

202+
func TestTryBuild039(t *testing.T) {
203+
ctx := makeDefaultContext(t)
204+
ctx.FQBN = "arduino:samd:arduino_zero_native"
205+
tryBuildWithContext(t, ctx, "sketch12", "sketch12.ino")
206+
}
207+
202208
func makeDefaultContext(t *testing.T) *types.Context {
203209
DownloadCoresAndToolsAndLibraries(t)
204210

0 commit comments

Comments
 (0)