Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb2ef348

Browse files
committed
NOT WORKING - Add test case for & String::operator = (const String &) with invalid buffer of first string
1 parent0eaaf5e commitb2ef348

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

‎test/src/String/test_operators.cpp‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,11 @@ TEST_CASE ("Testing & String::operator = (StringSumHelper &&rval)", "[String-ope
114114
*/
115115
}
116116

117-
TEST_CASE ("Testing & String::operator = (const String &)","[String-operator+-13]")
117+
TEST_CASE ("Testing & String::operator = (const String &) with invalid buffer of second string","[String-operator+-13]")
118118
{
119119
arduino::Stringstr1("Hello");
120120

121121
char *buffer2 =NULL;
122-
123122
arduino::Stringstr2(buffer2);
124123

125124
str1 = str2;
@@ -132,4 +131,15 @@ TEST_CASE ("Testing & String::operator = (const char *)", "[String-operator+-14]
132131
arduino::Stringstr("Hello");
133132
str = buffer;
134133
REQUIRE(str.compareTo("Hello") ==0);
134+
}
135+
136+
TEST_CASE ("Testing & String::operator = (const String &) with invalid buffer of first string","[String-operator+-15]")
137+
{
138+
char *buffer1 =NULL;
139+
arduino::Stringstr1(buffer1);
140+
141+
arduino::Stringstr2("Hello");
142+
143+
str1 = str2;
144+
REQUIRE(str1.compareTo(str2) ==0);
135145
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp