Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WString: c_str() returns null pointer after move #7611

Merged
merged 3 commits into from
Sep 27, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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