add test for sso optimized string
This commit is contained in:
parent
805d7ed5df
commit
815e6e7e7e
@ -1857,6 +1857,14 @@ TEST(Value, MergeDuplicateKey) {
|
||||
EXPECT_EQ(d2, d);
|
||||
}
|
||||
|
||||
TEST(Value, SSOMemoryOverlapTest) {
|
||||
Document d;
|
||||
d.Parse("{\"project\":\"rapidjson\",\"stars\":\"ssovalue\"}");
|
||||
Value &s = d["stars"];
|
||||
s.SetString(GenericStringRef<char>(&(s.GetString()[1]), 5), d.GetAllocator());
|
||||
EXPECT_TRUE(strcmp(s.GetString(),"soval") == 0);
|
||||
}
|
||||
|
||||
#ifdef __clang__
|
||||
RAPIDJSON_DIAG_POP
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user