File tree 1 file changed +21
-2
lines changed
1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -121,15 +121,23 @@ TEST_CASE ("Testing & String::operator = (const String &) with invalid buffer of
121
121
REQUIRE (str1.compareTo (str2) == 0 );
122
122
}
123
123
124
- TEST_CASE (" Testing & String::operator = (const char *)" , " [String-operator+-14]" )
124
+ TEST_CASE (" Testing & String::operator = (const char *) with NULL does not leave string unchanged " , " [String-operator+-14]" )
125
125
{
126
126
char *buffer = NULL ;
127
127
arduino::String str (" Hello" );
128
128
str = buffer;
129
129
REQUIRE (str.compareTo (" Hello" ) != 0 );
130
130
}
131
131
132
- TEST_CASE (" Testing & String::operator = (const String &) with invalid buffer of first string" , " [String-operator+-15]" )
132
+ TEST_CASE (" Testing & String::operator = (const char *) with NULL produces invalid string" , " [String-operator+-14]" )
133
+ {
134
+ char *buffer = NULL ;
135
+ arduino::String str (" Hello" );
136
+ str = buffer;
137
+ REQUIRE_FALSE (str);
138
+ }
139
+
140
+ TEST_CASE (" Testing & String::operator = (const String &) on invalid String updates it" , " [String-operator+-15]" )
133
141
{
134
142
char *buffer1 = NULL ;
135
143
arduino::String str1 (buffer1);
@@ -140,6 +148,17 @@ TEST_CASE ("Testing & String::operator = (const String &) with invalid buffer of
140
148
REQUIRE (str1.compareTo (str2) == 0 );
141
149
}
142
150
151
+ TEST_CASE (" Testing & String::operator = (const String &) on invalid String makes it valid" , " [String-operator+-15]" )
152
+ {
153
+ char *buffer1 = NULL ;
154
+ arduino::String str1 (buffer1);
155
+
156
+ arduino::String str2 (" Hello" );
157
+
158
+ str1 = str2;
159
+ REQUIRE (str1);
160
+ }
161
+
143
162
TEST_CASE (" Testing & String::operator = (String &&)" , " [String-operator+-16]" )
144
163
{
145
164
arduino::String str (" Hello" );
You can’t perform that action at this time.
0 commit comments