Skip to content

Commit bd46dc6

Browse files
committed
Add test that used to fail
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 27d10a5 commit bd46dc6

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-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+

spec/cpp_library_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def get_relative_dir(sampleprojects_tests_dir)
4545
dosomething_test_files = [
4646
"DoSomething/test/good-null.cpp",
4747
"DoSomething/test/good-library.cpp",
48+
"DoSomething/test/good-find-something.cpp",
4849
"DoSomething/test/bad-null.cpp",
4950
].map { |f| Pathname.new(f) }
5051
relative_paths = cpp_library.test_files.map { |f| get_relative_dir(f) }

0 commit comments

Comments
 (0)