Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
a6f9cb85
Commit
a6f9cb85
authored
Apr 16, 2016
by
Milo Yip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Third trial on writer coverage
parent
3da4afd2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
39 deletions
+42
-39
simdtest.cpp
test/unittest/simdtest.cpp
+42
-39
No files found.
test/unittest/simdtest.cpp
View file @
a6f9cb85
...
...
@@ -136,47 +136,50 @@ TEST(SIMD, SIMD_SUFFIX(ScanCopyUnescapedString)) {
}
TEST
(
SIMD
,
SIMD_SUFFIX
(
ScanWriteUnescapedString
))
{
for
(
size_t
step
=
0
;
step
<
1024
;
step
++
)
{
char
s
[
2048
+
1
];
char
*
p
=
s
;
for
(
size_t
i
=
0
;
i
<
step
;
i
++
)
*
p
++=
"ABCD"
[
i
%
4
];
char
escape
=
"
\0\n\\\"
"
[
step
%
4
];
*
p
++
=
escape
;
for
(
size_t
i
=
0
;
i
<
step
;
i
++
)
*
p
++=
"ABCD"
[
i
%
4
];
StringBuffer
sb
;
Writer
<
StringBuffer
>
writer
(
sb
);
writer
.
String
(
s
,
SizeType
(
step
*
2
+
1
));
const
char
*
q
=
sb
.
GetString
();
EXPECT_EQ
(
'\"'
,
*
q
++
);
for
(
size_t
i
=
0
;
i
<
step
;
i
++
)
EXPECT_EQ
(
"ABCD"
[
i
%
4
],
*
q
++
);
if
(
escape
==
'\0'
)
{
EXPECT_EQ
(
'\\'
,
*
q
++
);
EXPECT_EQ
(
'u'
,
*
q
++
);
EXPECT_EQ
(
'0'
,
*
q
++
);
EXPECT_EQ
(
'0'
,
*
q
++
);
EXPECT_EQ
(
'0'
,
*
q
++
);
EXPECT_EQ
(
'0'
,
*
q
++
);
}
else
if
(
escape
==
'\n'
)
{
EXPECT_EQ
(
'\\'
,
*
q
++
);
EXPECT_EQ
(
'n'
,
*
q
++
);
}
else
if
(
escape
==
'\\'
)
{
EXPECT_EQ
(
'\\'
,
*
q
++
);
EXPECT_EQ
(
'\\'
,
*
q
++
);
}
else
if
(
escape
==
'\"'
)
{
EXPECT_EQ
(
'\\'
,
*
q
++
);
char
buffer
[
2048
+
1
+
32
];
for
(
size_t
offset
=
0
;
offset
<
32
;
offset
++
)
{
for
(
size_t
step
=
0
;
step
<
1024
;
step
++
)
{
char
*
s
=
buffer
+
offset
;
char
*
p
=
s
;
for
(
size_t
i
=
0
;
i
<
step
;
i
++
)
*
p
++
=
"ABCD"
[
i
%
4
];
char
escape
=
"
\0\n\\\"
"
[
step
%
4
];
*
p
++
=
escape
;
for
(
size_t
i
=
0
;
i
<
step
;
i
++
)
*
p
++
=
"ABCD"
[
i
%
4
];
StringBuffer
sb
;
Writer
<
StringBuffer
>
writer
(
sb
);
writer
.
String
(
s
,
SizeType
(
step
*
2
+
1
));
const
char
*
q
=
sb
.
GetString
();
EXPECT_EQ
(
'\"'
,
*
q
++
);
for
(
size_t
i
=
0
;
i
<
step
;
i
++
)
EXPECT_EQ
(
"ABCD"
[
i
%
4
],
*
q
++
);
if
(
escape
==
'\0'
)
{
EXPECT_EQ
(
'\\'
,
*
q
++
);
EXPECT_EQ
(
'u'
,
*
q
++
);
EXPECT_EQ
(
'0'
,
*
q
++
);
EXPECT_EQ
(
'0'
,
*
q
++
);
EXPECT_EQ
(
'0'
,
*
q
++
);
EXPECT_EQ
(
'0'
,
*
q
++
);
}
else
if
(
escape
==
'\n'
)
{
EXPECT_EQ
(
'\\'
,
*
q
++
);
EXPECT_EQ
(
'n'
,
*
q
++
);
}
else
if
(
escape
==
'\\'
)
{
EXPECT_EQ
(
'\\'
,
*
q
++
);
EXPECT_EQ
(
'\\'
,
*
q
++
);
}
else
if
(
escape
==
'\"'
)
{
EXPECT_EQ
(
'\\'
,
*
q
++
);
EXPECT_EQ
(
'\"'
,
*
q
++
);
}
for
(
size_t
i
=
0
;
i
<
step
;
i
++
)
EXPECT_EQ
(
"ABCD"
[
i
%
4
],
*
q
++
);
EXPECT_EQ
(
'\"'
,
*
q
++
);
EXPECT_EQ
(
'\0'
,
*
q
++
);
}
for
(
size_t
i
=
0
;
i
<
step
;
i
++
)
EXPECT_EQ
(
"ABCD"
[
i
%
4
],
*
q
++
);
EXPECT_EQ
(
'\"'
,
*
q
++
);
EXPECT_EQ
(
'\0'
,
*
q
++
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment