File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ set(TEST_SRCS
42
42
src/Ringbuffer/test_peek.cpp
43
43
src/Ringbuffer/test_read_char.cpp
44
44
src/Ringbuffer/test_store_char.cpp
45
+ src/String/test_length.cpp
45
46
src/String/test_String.cpp
46
47
src/WCharacter/test_isControl.cpp
47
48
src/WCharacter/test_isDigit.cpp
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2020 Arduino. All rights reserved.
3
+ */
4
+
5
+ /* *************************************************************************************
6
+ * INCLUDE
7
+ **************************************************************************************/
8
+
9
+ #include < catch.hpp>
10
+
11
+ #include < String.h>
12
+
13
+ /* *************************************************************************************
14
+ * TEST CODE
15
+ **************************************************************************************/
16
+
17
+ TEST_CASE (" Testing String::length when string is empty" , " [String-length-01]" )
18
+ {
19
+ arduino::String str;
20
+ REQUIRE (str.length () == 0 );
21
+ }
22
+
23
+ TEST_CASE (" Testing String::length when string contains characters" , " [String-length-02]" )
24
+ {
25
+ arduino::String str (" Testing String::length" );
26
+ REQUIRE (str.length () == strlen (" Testing String::length" ));
27
+ }
You can’t perform that action at this time.
0 commit comments