cxxtest: Add static string test.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
This commit is contained in:
cuiziwei 2024-11-13 10:24:06 +08:00 committed by Xiang Xiao
parent bb03ef0ce3
commit 2a76d17e10

View file

@ -172,6 +172,10 @@ static void test_stl()
std::printf("v1=%d %d %d\n", v1[0], v1[1], v1[2]);
assert(v1[2] == 3);
static const std::string s1 = "Hello, World!";
std::printf("s1=%s\n", s1.c_str());
assert(s1 == "Hello, World!");
std::vector<int> v2 = v1;
assert(v2 == v1);