Commit a6f9cb85 authored by Milo Yip's avatar Milo Yip

Third trial on writer coverage

parent 3da4afd2
...@@ -136,15 +136,17 @@ TEST(SIMD, SIMD_SUFFIX(ScanCopyUnescapedString)) { ...@@ -136,15 +136,17 @@ TEST(SIMD, SIMD_SUFFIX(ScanCopyUnescapedString)) {
} }
TEST(SIMD, SIMD_SUFFIX(ScanWriteUnescapedString)) { TEST(SIMD, SIMD_SUFFIX(ScanWriteUnescapedString)) {
char buffer[2048 + 1 + 32];
for (size_t offset = 0; offset < 32; offset++) {
for (size_t step = 0; step < 1024; step++) { for (size_t step = 0; step < 1024; step++) {
char s[2048 + 1]; char* s = buffer + offset;
char *p = s; char* p = s;
for (size_t i = 0; i < step; i++) for (size_t i = 0; i < step; i++)
*p++= "ABCD"[i % 4]; *p++ = "ABCD"[i % 4];
char escape = "\0\n\\\""[step % 4]; char escape = "\0\n\\\""[step % 4];
*p++ = escape; *p++ = escape;
for (size_t i = 0; i < step; i++) for (size_t i = 0; i < step; i++)
*p++= "ABCD"[i % 4]; *p++ = "ABCD"[i % 4];
StringBuffer sb; StringBuffer sb;
Writer<StringBuffer> writer(sb); Writer<StringBuffer> writer(sb);
...@@ -178,6 +180,7 @@ TEST(SIMD, SIMD_SUFFIX(ScanWriteUnescapedString)) { ...@@ -178,6 +180,7 @@ TEST(SIMD, SIMD_SUFFIX(ScanWriteUnescapedString)) {
EXPECT_EQ('\"', *q++); EXPECT_EQ('\"', *q++);
EXPECT_EQ('\0', *q++); EXPECT_EQ('\0', *q++);
} }
}
} }
#ifdef __GNUC__ #ifdef __GNUC__
......
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