Commit 32295665 authored by Milo Yip's avatar Milo Yip

Add multiple SkipWhitespace perftest

parent 302d1b73
......@@ -298,10 +298,27 @@ TEST_F(RapidJson, internal_Pow10) {
EXPECT_GT(sum, 0.0);
}
TEST_F(RapidJson, SIMD_SUFFIX(Whitespace)) {
TEST_F(RapidJson, SkipWhitespace_Basic) {
for (size_t i = 0; i < kTrialCount; i++) {
Document doc;
ASSERT_TRUE(doc.Parse(whitespace_).IsArray());
rapidjson::StringStream s(whitespace_);
while (s.Peek() == ' ' || s.Peek() == '\n' || s.Peek() == '\r' || s.Peek() == '\t')
s.Take();
ASSERT_EQ('[', s.Peek());
}
}
TEST_F(RapidJson, SIMD_SUFFIX(SkipWhitespace)) {
for (size_t i = 0; i < kTrialCount; i++) {
rapidjson::StringStream s(whitespace_);
rapidjson::SkipWhitespace(s);
ASSERT_EQ('[', s.Peek());
}
}
TEST_F(RapidJson, SkipWhitespace_strspn) {
for (size_t i = 0; i < kTrialCount; i++) {
const char* s = whitespace_ + std::strspn(whitespace_, " \t\r\n");
ASSERT_EQ('[', *s);
}
}
......
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