Skip to content

Commit 1360a97

Browse files
committed
Add test that currently fails
In file included from /usr/include/stdio.h:33, from /usr/include/c++/8/cstdio:42, from /usr/include/c++/8/ext/string_conversions.h:43, from /usr/include/c++/8/bits/basic_string.h:6400, from /usr/include/c++/8/string:52, from /usr/include/c++/8/stdexcept:39, from .../arduino_ci/cpp/arduino/WString.h:4, from .../arduino_ci/cpp/arduino/Arduino.h:13, from .../arduino_ci/SampleProjects/DoSomething/do-something.cpp:1: .../arduino_ci/SampleProjects/DoSomething/do-something.cpp: In function ‘const something* findSomething(int)’: .../arduino_ci/cpp/arduino/Nullptr.h:5:31: error: invalid conversion from ‘my_nullptr_t’ {aka ‘void*’} to ‘const something*’ [-fpermissive] #define nullptr (my_nullptr_t)NULL ^~~~ .../arduino_ci/SampleProjects/DoSomething/do-something.cpp:20:9: note: in expansion of macro ‘nullptr’ return nullptr; ^~~~~~~
1 parent c62cb8b commit 1360a97

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <ArduinoUnitTests.h>
2+
3+
#include "do-something.h"
4+
5+
unittest(find_something_that_exists)
6+
{
7+
const struct something *result;
8+
result = findSomething(1);
9+
assertNotNull(result);
10+
assertEqual("abc", result->text);
11+
}
12+
13+
unittest(find_something_that_does_not_exists)
14+
{
15+
const struct something *result;
16+
result = findSomething(1000);
17+
assertNull(result);
18+
}
19+
20+
unittest_main()
21+

0 commit comments

Comments
 (0)