Skip to content

Commit 2a76d17

Browse files
cuiziweizwxiaoxiang781216
authored andcommittedNov 13, 2024
cxxtest: Add static string test.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
1 parent bb03ef0 commit 2a76d17

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎testing/cxxtest/cxxtest_main.cxx

+4
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ static void test_stl()
172172
std::printf("v1=%d %d %d\n", v1[0], v1[1], v1[2]);
173173
assert(v1[2] == 3);
174174

175+
static const std::string s1 = "Hello, World!";
176+
std::printf("s1=%s\n", s1.c_str());
177+
assert(s1 == "Hello, World!");
178+
175179
std::vector<int> v2 = v1;
176180
assert(v2 == v1);
177181

0 commit comments

Comments
 (0)