Skip to content

Commit d3b3a43

Browse files
authored
(test) WString: c_str() returns null pointer
target = std::move(source) does not reset buffer pointer back to the sso
1 parent a3281fe commit d3b3a43

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/host/core/test_string.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@
1919
#include <limits.h>
2020
#include <StreamString.h>
2121

22+
TEST_CASE("String::move", "[core][String]")
23+
{
24+
const char buffer[] = "this string goes over the sso limit";
25+
26+
String copy;
27+
String origin(buffer);
28+
29+
copy = std::move(origin);
30+
REQUIRE(origin.c_str() != nullptr);
31+
REQUIRE(copy == buffer);
32+
}
33+
2234
TEST_CASE("String::trim", "[core][String]")
2335
{
2436
String str;

0 commit comments

Comments
 (0)