Commit 60999756 authored by Kosta's avatar Kosta

unit test simplification for `short string optimization`

parent 88debcf0
...@@ -1089,14 +1089,11 @@ static void TestShortStringOptimization(const char* str) { ...@@ -1089,14 +1089,11 @@ static void TestShortStringOptimization(const char* str) {
const int len = (int)strlen(str); const int len = (int)strlen(str);
rapidjson::Document doc; rapidjson::Document doc;
rapidjson::Document::AllocatorType& allocator = doc.GetAllocator(); rapidjson::Value val;
rapidjson::Value objVal(rapidjson::kObjectType); val.SetString(str, len, doc.GetAllocator());
objVal.AddMember(str, len, allocator);
EXPECT_TRUE(objVal.HasMember(str));
const rapidjson::Value& member = objVal[str]; EXPECT_EQ(val.GetStringLength(), len);
EXPECT_EQ(member.GetStringLength(), strlen(str)); EXPECT_STREQ(val.GetString(), str);
} }
TEST(Value, AllocateShortString) { TEST(Value, AllocateShortString) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment