Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rapidjson
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pirvi-public
rapidjson
Commits
778dc8b0
Commit
778dc8b0
authored
Dec 1, 2022
by
Steve Hanson
Committed by
Milo Yip
Jan 5, 2023
Browse files
Options
Downloads
Patches
Plain Diff
fix #1
parent
76281ff3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/unittest/simdtest.cpp
+7
-5
7 additions, 5 deletions
test/unittest/simdtest.cpp
test/unittest/uritest.cpp
+1
-1
1 addition, 1 deletion
test/unittest/uritest.cpp
with
8 additions
and
6 deletions
test/unittest/simdtest.cpp
+
7
−
5
View file @
778dc8b0
...
...
@@ -49,10 +49,12 @@ using namespace rapidjson_simd;
#define SIMD_SUFFIX(name) name
#endif
#define SIMD_SIZE_ALIGN(n) ((size_t(n) + 15) & ~size_t(15))
template
<
typename
StreamType
>
void
TestSkipWhitespace
()
{
for
(
size_t
step
=
1
;
step
<
32
;
step
++
)
{
char
buffer
[
1025
];
char
buffer
[
SIMD_SIZE_ALIGN
(
1025
)
];
for
(
size_t
i
=
0
;
i
<
1024
;
i
++
)
buffer
[
i
]
=
"
\t\r\n
"
[
i
%
4
];
for
(
size_t
i
=
0
;
i
<
1024
;
i
+=
step
)
...
...
@@ -79,7 +81,7 @@ TEST(SIMD, SIMD_SUFFIX(SkipWhitespace)) {
TEST
(
SIMD
,
SIMD_SUFFIX
(
SkipWhitespace_EncodedMemoryStream
))
{
for
(
size_t
step
=
1
;
step
<
32
;
step
++
)
{
char
buffer
[
1024
];
char
buffer
[
SIMD_SIZE_ALIGN
(
1024
)
];
for
(
size_t
i
=
0
;
i
<
1024
;
i
++
)
buffer
[
i
]
=
"
\t\r\n
"
[
i
%
4
];
for
(
size_t
i
=
0
;
i
<
1024
;
i
+=
step
)
...
...
@@ -107,8 +109,8 @@ struct ScanCopyUnescapedStringHandler : BaseReaderHandler<UTF8<>, ScanCopyUnesca
template
<
unsigned
parseFlags
,
typename
StreamType
>
void
TestScanCopyUnescapedString
()
{
char
buffer
[
1024u
+
5
+
32
];
char
backup
[
1024u
+
5
+
32
];
char
buffer
[
SIMD_SIZE_ALIGN
(
1024u
+
5
+
32
)
];
char
backup
[
SIMD_SIZE_ALIGN
(
1024u
+
5
+
32
)
];
// Test "ABCDABCD...\\"
for
(
size_t
offset
=
0
;
offset
<
32
;
offset
++
)
{
...
...
@@ -165,7 +167,7 @@ TEST(SIMD, SIMD_SUFFIX(ScanCopyUnescapedString)) {
}
TEST
(
SIMD
,
SIMD_SUFFIX
(
ScanWriteUnescapedString
))
{
char
buffer
[
2048
+
1
+
32
];
char
buffer
[
SIMD_SIZE_ALIGN
(
2048
+
1
+
32
)
];
for
(
size_t
offset
=
0
;
offset
<
32
;
offset
++
)
{
for
(
size_t
step
=
0
;
step
<
1024
;
step
++
)
{
char
*
s
=
buffer
+
offset
;
...
...
This diff is collapsed.
Click to expand it.
test/unittest/uritest.cpp
+
1
−
1
View file @
778dc8b0
...
...
@@ -69,7 +69,7 @@ TEST(Uri, Parse) {
#if RAPIDJSON_HAS_STDSTRING
typedef
std
::
basic_string
<
Value
::
Ch
>
String
;
String
str
=
"http://auth/path/xxx?query#frag"
;
const
UriType
uri
=
UriType
(
str
);
const
UriType
uri
=
UriType
(
str
,
&
allocator
);
EXPECT_TRUE
(
UriType
::
GetScheme
(
uri
)
==
"http:"
);
EXPECT_TRUE
(
UriType
::
GetAuth
(
uri
)
==
"//auth"
);
EXPECT_TRUE
(
UriType
::
GetPath
(
uri
)
==
"/path/xxx"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment