Skip to content

Commit 760e397

Browse files
committed
Add test code that implies move(String &rhs) from larger to smaller buffer
1 parent 1dd2db6 commit 760e397

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/src/String/test_String.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,18 @@ TEST_CASE ("Testing String(String &&) constructor()", "[String-Ctor-14]")
117117
REQUIRE(str1.compareTo("Hello") == 0);
118118
}
119119

120-
TEST_CASE ("Testing String(String &&) with move(String &rhs) to a valid buffer", "[String-Ctor-15]")
120+
TEST_CASE ("Testing String(String &&) with move(String &rhs) from smaller to larger buffer", "[String-Ctor-15]")
121121
{
122122
arduino::String str("Hello");
123123
arduino::String str1("Arduino");
124124
str1 = static_cast<arduino::String&&>(str);
125125
REQUIRE(str1.compareTo("Hello") == 0);
126+
}
127+
128+
TEST_CASE ("Testing String(String &&) with move(String &rhs) from larger to smaller buffer", "[String-Ctor-16]")
129+
{
130+
arduino::String str("Hello");
131+
arduino::String str1("Arduino");
132+
str = static_cast<arduino::String&&>(str1);
133+
REQUIRE(str1.compareTo("Arduino") == 0);
126134
}

0 commit comments

Comments
 (0)