Skip to content

Commit

Permalink
(test) WString: c_str() returns null pointer
Browse files Browse the repository at this point in the history
target = std::move(source) does not reset buffer pointer back to the sso
  • Loading branch information
mcspr authored Sep 25, 2020
1 parent a3281fe commit d3b3a43
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/host/core/test_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@
#include <limits.h>
#include <StreamString.h>

TEST_CASE("String::move", "[core][String]")
{
const char buffer[] = "this string goes over the sso limit";

String copy;
String origin(buffer);

copy = std::move(origin);
REQUIRE(origin.c_str() != nullptr);
REQUIRE(copy == buffer);
}

TEST_CASE("String::trim", "[core][String]")
{
String str;
Expand Down

0 comments on commit d3b3a43

Please sign in to comment.