diff options
author | 2016-03-08 11:39:25 +0100 | |
---|---|---|
committer | 2016-03-08 12:58:10 +0100 | |
commit | 1f352c6af853e5cb0dc06ea6596be77db953a9fd (patch) | |
tree | 361bae19c8e605572cafc4a656c19c748c27a9d3 /3rdparty/rapidjson/test/unittest/simdtest.cpp | |
parent | dfad813239c6c4259040892616f44fbbe260ab73 (diff) |
update rapidjson library (nw)
Diffstat (limited to '3rdparty/rapidjson/test/unittest/simdtest.cpp')
-rw-r--r-- | 3rdparty/rapidjson/test/unittest/simdtest.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/3rdparty/rapidjson/test/unittest/simdtest.cpp b/3rdparty/rapidjson/test/unittest/simdtest.cpp index 6ded7402fbf..1b6fcef3a48 100644 --- a/3rdparty/rapidjson/test/unittest/simdtest.cpp +++ b/3rdparty/rapidjson/test/unittest/simdtest.cpp @@ -73,6 +73,28 @@ TEST(SIMD, SIMD_SUFFIX(SkipWhitespace)) { TestSkipWhitespace<InsituStringStream>(); } +TEST(SIMD, SIMD_SUFFIX(SkipWhitespace_EncodedMemoryStream)) { + for (size_t step = 1; step < 32; step++) { + char buffer[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) + buffer[i] = 'X'; + + MemoryStream ms(buffer, 1024); + EncodedInputStream<UTF8<>, MemoryStream> s(ms); + size_t i = 0; + for (;;) { + SkipWhitespace(s); + if (s.Peek() == '\0') + break; + //EXPECT_EQ(i, s.Tell()); + EXPECT_EQ('X', s.Take()); + i += step; + } + } +} + struct ScanCopyUnescapedStringHandler : BaseReaderHandler<UTF8<>, ScanCopyUnescapedStringHandler> { bool String(const char* str, size_t length, bool) { memcpy(buffer, str, length + 1); |