Skip to content

Commit 9165d1b

Browse files
committed
Add test for fake function pointers
1 parent 3282535 commit 9165d1b

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
template< uint16_t nBuffSize >
2+
class Foo{
3+
public:
4+
5+
template< uint16_t N >
6+
Foo &operator +=( const Foo<N> &ref ){
7+
//...
8+
return *this;
9+
}
10+
};
11+
12+
Foo<64> a;
13+
Foo<32> b;
14+
15+
void setup(){
16+
a += b;
17+
}
18+
19+
void loop(){}

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

+4
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ func TestTryBuild039(t *testing.T) {
205205
tryBuildWithContext(t, ctx, "sketch12", "sketch12.ino")
206206
}
207207

208+
func TestTryBuild040(t *testing.T) {
209+
tryBuild(t, "sketch_with_fake_function_pointer", "sketch_with_fake_function_pointer.ino")
210+
}
211+
208212
func makeDefaultContext(t *testing.T) *types.Context {
209213
DownloadCoresAndToolsAndLibraries(t)
210214

0 commit comments

Comments
 (0)