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) {
const int len = (int)strlen(str);
rapidjson::Document doc;
rapidjson::Document::AllocatorType& allocator = doc.GetAllocator();
rapidjson::Value objVal(rapidjson::kObjectType);
objVal.AddMember(str, len, allocator);
EXPECT_TRUE(objVal.HasMember(str));
rapidjson::Value val;
val.SetString(str, len, doc.GetAllocator());
const rapidjson::Value& member = objVal[str];
EXPECT_EQ(member.GetStringLength(), strlen(str));
EXPECT_EQ(val.GetStringLength(), len);
EXPECT_STREQ(val.GetString(), str);
}
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