rj_schema 0.2.4 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rj_schema/rapidjson/CHANGELOG.md +158 -0
- data/ext/rj_schema/rapidjson/CMakeLists.txt +248 -0
- data/ext/rj_schema/rapidjson/CMakeModules/FindGTestSrc.cmake +30 -0
- data/ext/rj_schema/rapidjson/RapidJSON.pc.in +7 -0
- data/ext/rj_schema/rapidjson/RapidJSONConfig.cmake.in +25 -0
- data/ext/rj_schema/rapidjson/RapidJSONConfigVersion.cmake.in +10 -0
- data/ext/rj_schema/rapidjson/appveyor.yml +102 -0
- data/ext/rj_schema/rapidjson/bin/data/abcde.txt +1 -0
- data/ext/rj_schema/rapidjson/bin/data/glossary.json +22 -0
- data/ext/rj_schema/rapidjson/bin/data/menu.json +27 -0
- data/ext/rj_schema/rapidjson/bin/data/readme.txt +1 -0
- data/ext/rj_schema/rapidjson/bin/data/sample.json +3315 -0
- data/ext/rj_schema/rapidjson/bin/data/webapp.json +88 -0
- data/ext/rj_schema/rapidjson/bin/data/widget.json +26 -0
- data/ext/rj_schema/rapidjson/bin/draft-04/schema +150 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16be.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16bebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16le.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16lebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32be.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32bebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32le.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32lebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf8.json +7 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf8bom.json +7 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail1.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail10.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail11.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail12.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail13.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail14.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail15.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail16.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail17.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail18.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail19.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail2.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail20.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail21.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail22.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail23.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail24.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail25.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail26.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail27.json +2 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail28.json +2 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail29.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail3.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail30.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail31.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail32.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail33.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail4.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail5.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail6.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail7.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail8.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail9.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass1.json +58 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass2.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass3.json +6 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/readme.txt +3 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/LICENSE +19 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/README.md +148 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/bin/jsonschema_suite +283 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json +3 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/integer.json +3 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/subSchemas.json +8 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json +82 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json +88 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/default.json +49 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/dependencies.json +108 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/disallow.json +80 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json +60 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/enum.json +71 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/extends.json +94 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/items.json +46 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maximum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minimum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json +107 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/format.json +222 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json +18 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json +15 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/pattern.json +34 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json +110 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/properties.json +92 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/ref.json +159 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/refRemote.json +74 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/required.json +53 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/type.json +474 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json +79 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json +82 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json +88 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/allOf.json +112 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/anyOf.json +68 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/default.json +49 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/definitions.json +32 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/dependencies.json +113 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/enum.json +72 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/items.json +46 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maximum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minProperties.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minimum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json +60 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/not.json +96 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/oneOf.json +68 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json +107 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/format.json +148 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json +15 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/pattern.json +34 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json +110 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/properties.json +92 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/ref.json +159 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/refRemote.json +74 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/required.json +39 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/type.json +330 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json +79 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tox.ini +8 -0
- data/ext/rj_schema/rapidjson/bin/types/alotofkeys.json +502 -0
- data/ext/rj_schema/rapidjson/bin/types/booleans.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/floats.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/guids.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/integers.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/mixed.json +592 -0
- data/ext/rj_schema/rapidjson/bin/types/nulls.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/paragraphs.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/readme.txt +1 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/address.json +139 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/allOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/anyOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/idandref.json +69 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/oneOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/contrib/natvis/LICENSE +45 -0
- data/ext/rj_schema/rapidjson/contrib/natvis/README.md +7 -0
- data/ext/rj_schema/rapidjson/contrib/natvis/rapidjson.natvis +38 -0
- data/ext/rj_schema/rapidjson/doc/CMakeLists.txt +27 -0
- data/ext/rj_schema/rapidjson/doc/Doxyfile.in +2369 -0
- data/ext/rj_schema/rapidjson/doc/Doxyfile.zh-cn.in +2369 -0
- data/ext/rj_schema/rapidjson/doc/diagram/architecture.dot +50 -0
- data/ext/rj_schema/rapidjson/doc/diagram/architecture.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.dot +65 -0
- data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.dot +62 -0
- data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/makefile +8 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move1.dot +47 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move1.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move2.dot +62 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move2.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move3.dot +60 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move3.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.dot +56 -0
- data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/simpledom.dot +54 -0
- data/ext/rj_schema/rapidjson/doc/diagram/simpledom.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/tutorial.dot +58 -0
- data/ext/rj_schema/rapidjson/doc/diagram/tutorial.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.dot +73 -0
- data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.png +0 -0
- data/ext/rj_schema/rapidjson/doc/dom.md +281 -0
- data/ext/rj_schema/rapidjson/doc/dom.zh-cn.md +285 -0
- data/ext/rj_schema/rapidjson/doc/encoding.md +146 -0
- data/ext/rj_schema/rapidjson/doc/encoding.zh-cn.md +152 -0
- data/ext/rj_schema/rapidjson/doc/faq.md +289 -0
- data/ext/rj_schema/rapidjson/doc/faq.zh-cn.md +290 -0
- data/ext/rj_schema/rapidjson/doc/features.md +104 -0
- data/ext/rj_schema/rapidjson/doc/features.zh-cn.md +103 -0
- data/ext/rj_schema/rapidjson/doc/internals.md +368 -0
- data/ext/rj_schema/rapidjson/doc/internals.zh-cn.md +363 -0
- data/ext/rj_schema/rapidjson/doc/logo/rapidjson.png +0 -0
- data/ext/rj_schema/rapidjson/doc/logo/rapidjson.svg +119 -0
- data/ext/rj_schema/rapidjson/doc/misc/DoxygenLayout.xml +194 -0
- data/ext/rj_schema/rapidjson/doc/misc/doxygenextra.css +274 -0
- data/ext/rj_schema/rapidjson/doc/misc/footer.html +11 -0
- data/ext/rj_schema/rapidjson/doc/misc/header.html +24 -0
- data/ext/rj_schema/rapidjson/doc/npm.md +31 -0
- data/ext/rj_schema/rapidjson/doc/performance.md +26 -0
- data/ext/rj_schema/rapidjson/doc/performance.zh-cn.md +26 -0
- data/ext/rj_schema/rapidjson/doc/pointer.md +234 -0
- data/ext/rj_schema/rapidjson/doc/pointer.zh-cn.md +234 -0
- data/ext/rj_schema/rapidjson/doc/sax.md +509 -0
- data/ext/rj_schema/rapidjson/doc/sax.zh-cn.md +487 -0
- data/ext/rj_schema/rapidjson/doc/schema.md +505 -0
- data/ext/rj_schema/rapidjson/doc/schema.zh-cn.md +237 -0
- data/ext/rj_schema/rapidjson/doc/stream.md +429 -0
- data/ext/rj_schema/rapidjson/doc/stream.zh-cn.md +429 -0
- data/ext/rj_schema/rapidjson/doc/tutorial.md +536 -0
- data/ext/rj_schema/rapidjson/doc/tutorial.zh-cn.md +535 -0
- data/ext/rj_schema/rapidjson/docker/debian/Dockerfile +8 -0
- data/ext/rj_schema/rapidjson/example/CMakeLists.txt +46 -0
- data/ext/rj_schema/rapidjson/example/archiver/archiver.cpp +292 -0
- data/ext/rj_schema/rapidjson/example/archiver/archiver.h +145 -0
- data/ext/rj_schema/rapidjson/example/archiver/archivertest.cpp +287 -0
- data/ext/rj_schema/rapidjson/example/capitalize/capitalize.cpp +67 -0
- data/ext/rj_schema/rapidjson/example/condense/condense.cpp +32 -0
- data/ext/rj_schema/rapidjson/example/filterkey/filterkey.cpp +135 -0
- data/ext/rj_schema/rapidjson/example/filterkeydom/filterkeydom.cpp +170 -0
- data/ext/rj_schema/rapidjson/example/jsonx/jsonx.cpp +207 -0
- data/ext/rj_schema/rapidjson/example/lookaheadparser/lookaheadparser.cpp +350 -0
- data/ext/rj_schema/rapidjson/example/messagereader/messagereader.cpp +105 -0
- data/ext/rj_schema/rapidjson/example/parsebyparts/parsebyparts.cpp +176 -0
- data/ext/rj_schema/rapidjson/example/pretty/pretty.cpp +30 -0
- data/ext/rj_schema/rapidjson/example/prettyauto/prettyauto.cpp +56 -0
- data/ext/rj_schema/rapidjson/example/schemavalidator/schemavalidator.cpp +198 -0
- data/ext/rj_schema/rapidjson/example/serialize/serialize.cpp +173 -0
- data/ext/rj_schema/rapidjson/example/simpledom/simpledom.cpp +29 -0
- data/ext/rj_schema/rapidjson/example/simplepullreader/simplepullreader.cpp +53 -0
- data/ext/rj_schema/rapidjson/example/simplereader/simplereader.cpp +42 -0
- data/ext/rj_schema/rapidjson/example/simplewriter/simplewriter.cpp +36 -0
- data/ext/rj_schema/rapidjson/example/sortkeys/sortkeys.cpp +62 -0
- data/ext/rj_schema/rapidjson/example/traverseaspointer.cpp +39 -0
- data/ext/rj_schema/rapidjson/example/tutorial/tutorial.cpp +151 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +692 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/cursorstreamwrapper.h +78 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/document.h +3027 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/encodedstream.h +299 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/encodings.h +716 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/error/en.h +122 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/error/error.h +216 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/filereadstream.h +99 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/filewritestream.h +104 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/fwd.h +151 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/biginteger.h +290 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/clzll.h +71 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/diyfp.h +257 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/dtoa.h +245 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/ieee754.h +78 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/itoa.h +308 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/meta.h +186 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/pow10.h +55 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/regex.h +739 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/stack.h +232 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strfunc.h +83 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strtod.h +290 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/swap.h +46 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/istreamwrapper.h +128 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/memorybuffer.h +70 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/memorystream.h +71 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/inttypes.h +316 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/stdint.h +300 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/ostreamwrapper.h +81 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/pointer.h +1482 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/prettywriter.h +277 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +741 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/reader.h +2244 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +2795 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/stream.h +223 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/stringbuffer.h +121 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/uri.h +466 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/writer.h +710 -0
- data/ext/rj_schema/rapidjson/include_dirs.js +2 -0
- data/ext/rj_schema/rapidjson/library.json +15 -0
- data/ext/rj_schema/rapidjson/license.txt +57 -0
- data/ext/rj_schema/rapidjson/package.json +24 -0
- data/ext/rj_schema/rapidjson/rapidjson.autopkg +77 -0
- data/ext/rj_schema/rapidjson/readme.md +210 -0
- data/ext/rj_schema/rapidjson/readme.zh-cn.md +152 -0
- data/ext/rj_schema/rapidjson/test/CMakeLists.txt +20 -0
- data/ext/rj_schema/rapidjson/test/perftest/CMakeLists.txt +28 -0
- data/ext/rj_schema/rapidjson/test/perftest/misctest.cpp +974 -0
- data/ext/rj_schema/rapidjson/test/perftest/perftest.cpp +24 -0
- data/ext/rj_schema/rapidjson/test/perftest/perftest.h +186 -0
- data/ext/rj_schema/rapidjson/test/perftest/platformtest.cpp +166 -0
- data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +564 -0
- data/ext/rj_schema/rapidjson/test/perftest/schematest.cpp +223 -0
- data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +95 -0
- data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +292 -0
- data/ext/rj_schema/rapidjson/test/unittest/bigintegertest.cpp +138 -0
- data/ext/rj_schema/rapidjson/test/unittest/clzlltest.cpp +34 -0
- data/ext/rj_schema/rapidjson/test/unittest/cursorstreamwrappertest.cpp +115 -0
- data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +674 -0
- data/ext/rj_schema/rapidjson/test/unittest/dtoatest.cpp +98 -0
- data/ext/rj_schema/rapidjson/test/unittest/encodedstreamtest.cpp +313 -0
- data/ext/rj_schema/rapidjson/test/unittest/encodingstest.cpp +451 -0
- data/ext/rj_schema/rapidjson/test/unittest/filestreamtest.cpp +155 -0
- data/ext/rj_schema/rapidjson/test/unittest/fwdtest.cpp +230 -0
- data/ext/rj_schema/rapidjson/test/unittest/istreamwrappertest.cpp +181 -0
- data/ext/rj_schema/rapidjson/test/unittest/itoatest.cpp +160 -0
- data/ext/rj_schema/rapidjson/test/unittest/jsoncheckertest.cpp +143 -0
- data/ext/rj_schema/rapidjson/test/unittest/namespacetest.cpp +70 -0
- data/ext/rj_schema/rapidjson/test/unittest/ostreamwrappertest.cpp +92 -0
- data/ext/rj_schema/rapidjson/test/unittest/platformtest.cpp +40 -0
- data/ext/rj_schema/rapidjson/test/unittest/pointertest.cpp +1730 -0
- data/ext/rj_schema/rapidjson/test/unittest/prettywritertest.cpp +373 -0
- data/ext/rj_schema/rapidjson/test/unittest/readertest.cpp +2228 -0
- data/ext/rj_schema/rapidjson/test/unittest/regextest.cpp +639 -0
- data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +2952 -0
- data/ext/rj_schema/rapidjson/test/unittest/simdtest.cpp +219 -0
- data/ext/rj_schema/rapidjson/test/unittest/strfunctest.cpp +30 -0
- data/ext/rj_schema/rapidjson/test/unittest/stringbuffertest.cpp +192 -0
- data/ext/rj_schema/rapidjson/test/unittest/strtodtest.cpp +132 -0
- data/ext/rj_schema/rapidjson/test/unittest/unittest.cpp +51 -0
- data/ext/rj_schema/rapidjson/test/unittest/unittest.h +143 -0
- data/ext/rj_schema/rapidjson/test/unittest/uritest.cpp +718 -0
- data/ext/rj_schema/rapidjson/test/unittest/valuetest.cpp +1861 -0
- data/ext/rj_schema/rapidjson/test/unittest/writertest.cpp +598 -0
- data/ext/rj_schema/rapidjson/test/valgrind.supp +17 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/BUILD.bazel +175 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/CMakeLists.txt +33 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/CONTRIBUTING.md +160 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/Makefile.am +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/README.md +122 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/WORKSPACE +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/appveyor.yml +104 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-autotools.sh +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-bazel.sh +36 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-linux.sh +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-osx.sh +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/get-nprocessors.sh +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-linux.sh +49 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-osx.sh +39 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/log-config.sh +51 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/travis.sh +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/configure.ac +16 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CHANGES +126 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +242 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CONTRIBUTORS +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/Makefile.am +224 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/README.md +344 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock_main.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/configure.ac +146 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +564 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +3660 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DesignDoc.md +280 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +15 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +447 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +627 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/KnownIssues.md +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +1262 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-cardinalities.h +147 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +2571 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +833 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +1379 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +347 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +2258 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +675 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +458 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +178 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +5255 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-actions.h +246 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +91 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +1918 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +95 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +10 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +38 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-port.h +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +286 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +136 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +574 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +87 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/make/Makefile +101 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.sln +32 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.vcproj +191 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_config.vsprops +15 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_main.vcproj +187 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_test.vcproj +201 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +145 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +151 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +176 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +145 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_config.props +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +151 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +176 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +240 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/LICENSE +203 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +34 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README.cppclean +115 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/__init__.py +0 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +1733 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class.py +227 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py +448 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/keywords.py +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/tokenize.py +287 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/utils.py +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/gmock_gen.py +31 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock-config.in +303 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock_doctor.py +640 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload.py +1387 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload_gmock.py +78 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-all.cc +47 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +156 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +204 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +573 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +883 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +205 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock_main.cc +54 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/BUILD.bazel +123 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +1575 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +428 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +1230 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +647 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +129 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +1341 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +718 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +6767 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +710 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +511 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-port_test.cc +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +2771 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_all_test.cc +51 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_ex_test.cc +81 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test.py +108 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test_.cc +100 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +691 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +183 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +310 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +317 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +323 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +262 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +110 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CHANGES +157 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +312 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CONTRIBUTORS +37 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/Makefile.am +339 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/README.md +341 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest_main.pc.in +10 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +280 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.cbproj +138 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.groupproj +54 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_all.cc +38 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_link.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_main.cbproj +82 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_unittest.cbproj +88 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/configure.ac +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Pkgconfig.md +146 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +177 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +93 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/advanced.md +2416 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/faq.md +1092 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/primer.md +536 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/samples.md +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +342 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +249 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +1438 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +501 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +1082 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +231 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-test-part.h +179 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +264 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +2332 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +357 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +61 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +70 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +275 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +205 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +1277 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-linked_ptr.h +243 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +5139 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +279 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +723 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +100 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +2687 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +167 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h +1020 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h.pump +347 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +3347 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +313 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/acx_pthread.m4 +363 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/gtest.m4 +74 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/make/Makefile +82 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.sln +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj +149 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.sln +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj +149 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj +154 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj +162 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj +199 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj.filters +26 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj +191 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj.filters +26 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj +188 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj +180 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +127 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.h +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +140 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +154 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.cc +56 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.h +85 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +110 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3-inl.h +172 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +152 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.cc +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.h +53 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +49 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +199 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +225 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +118 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +174 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +157 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/common.py +83 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +253 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +730 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gtest-config.in +274 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/pump.py +855 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/release_docs.py +158 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/test/Makefile +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +1387 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload_gtest.py +78 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +1536 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +385 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +1175 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +1277 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +458 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +102 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +119 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +5846 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +38 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/BUILD.bazel +396 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_ex_test.cc +93 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +1424 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +652 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-linked_ptr_test.cc +154 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +311 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-message_test.cc +159 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +213 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +61 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +1110 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +53 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +1303 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +1737 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-test-part_test.cc +208 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-tuple_test.cc +320 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +380 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.h +66 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +341 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +47 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_assert_by_exception_test.cc +119 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +210 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +87 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +235 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +311 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +129 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +63 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +119 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +124 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +189 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +638 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +138 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +172 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test_.cc +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_outfiles_test.py +162 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_output_unittest.py +611 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_test_utils.py +60 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +207 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest_.cc +157 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_no_test_unittest.cc +56 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +344 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +1067 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +781 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +2427 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_premature_exit_test.cc +127 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +57 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +236 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test.py +325 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test_.cc +103 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_sole_header_test.cc +57 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +250 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +318 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test.py +65 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test_.cc +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc +92 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +171 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test_.cc +72 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +69 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +7797 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +140 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +378 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +179 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +196 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.cc +36 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.h +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/DebugProject.xcconfig +30 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/FrameworkTarget.xcconfig +17 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/General.xcconfig +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/ReleaseProject.xcconfig +32 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/StaticLibraryTarget.xcconfig +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/TestTarget.xcconfig +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Resources/Info.plist +30 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/Info.plist +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj +457 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/runtests.sh +62 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.cc +63 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.h +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget_test.cc +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/runtests.sh +65 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +100 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +1182 -0
- data/ext/rj_schema/rapidjson/travis-doxygen.sh +128 -0
- data/ext/rj_schema/rj_schema.cpp +162 -18
- data/lib/rj_schema.rb +1 -1
- metadata +626 -3
@@ -0,0 +1,51 @@
|
|
1
|
+
// Tencent is pleased to support the open source community by making RapidJSON available.
|
2
|
+
//
|
3
|
+
// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
|
4
|
+
//
|
5
|
+
// Licensed under the MIT License (the "License"); you may not use this file except
|
6
|
+
// in compliance with the License. You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://opensource.org/licenses/MIT
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software distributed
|
11
|
+
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
12
|
+
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
13
|
+
// specific language governing permissions and limitations under the License.
|
14
|
+
|
15
|
+
#include "unittest.h"
|
16
|
+
#include "rapidjson/rapidjson.h"
|
17
|
+
|
18
|
+
#ifdef __clang__
|
19
|
+
#pragma GCC diagnostic push
|
20
|
+
#if __has_warning("-Wdeprecated")
|
21
|
+
#pragma GCC diagnostic ignored "-Wdeprecated"
|
22
|
+
#endif
|
23
|
+
#endif
|
24
|
+
|
25
|
+
AssertException::~AssertException() throw() {}
|
26
|
+
|
27
|
+
#ifdef __clang__
|
28
|
+
#pragma GCC diagnostic pop
|
29
|
+
#endif
|
30
|
+
|
31
|
+
int main(int argc, char **argv) {
|
32
|
+
::testing::InitGoogleTest(&argc, argv);
|
33
|
+
|
34
|
+
std::cout << "RapidJSON v" << RAPIDJSON_VERSION_STRING << std::endl;
|
35
|
+
|
36
|
+
#ifdef _MSC_VER
|
37
|
+
_CrtMemState memoryState = { 0 };
|
38
|
+
(void)memoryState;
|
39
|
+
_CrtMemCheckpoint(&memoryState);
|
40
|
+
//_CrtSetBreakAlloc(X);
|
41
|
+
//void *testWhetherMemoryLeakDetectionWorks = malloc(1);
|
42
|
+
#endif
|
43
|
+
|
44
|
+
int ret = RUN_ALL_TESTS();
|
45
|
+
|
46
|
+
#ifdef _MSC_VER
|
47
|
+
// Current gtest constantly leak 2 blocks at exit
|
48
|
+
_CrtMemDumpAllObjectsSince(&memoryState);
|
49
|
+
#endif
|
50
|
+
return ret;
|
51
|
+
}
|
@@ -0,0 +1,143 @@
|
|
1
|
+
// Tencent is pleased to support the open source community by making RapidJSON available.
|
2
|
+
//
|
3
|
+
// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
|
4
|
+
//
|
5
|
+
// Licensed under the MIT License (the "License"); you may not use this file except
|
6
|
+
// in compliance with the License. You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://opensource.org/licenses/MIT
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software distributed
|
11
|
+
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
12
|
+
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
13
|
+
// specific language governing permissions and limitations under the License.
|
14
|
+
|
15
|
+
#ifndef UNITTEST_H_
|
16
|
+
#define UNITTEST_H_
|
17
|
+
|
18
|
+
// gtest indirectly included inttypes.h, without __STDC_CONSTANT_MACROS.
|
19
|
+
#ifndef __STDC_CONSTANT_MACROS
|
20
|
+
#ifdef __clang__
|
21
|
+
#pragma GCC diagnostic push
|
22
|
+
#if __has_warning("-Wreserved-id-macro")
|
23
|
+
#pragma GCC diagnostic ignored "-Wreserved-id-macro"
|
24
|
+
#endif
|
25
|
+
#endif
|
26
|
+
|
27
|
+
# define __STDC_CONSTANT_MACROS 1 // required by C++ standard
|
28
|
+
|
29
|
+
#ifdef __clang__
|
30
|
+
#pragma GCC diagnostic pop
|
31
|
+
#endif
|
32
|
+
#endif
|
33
|
+
|
34
|
+
#ifdef _MSC_VER
|
35
|
+
#define _CRTDBG_MAP_ALLOC
|
36
|
+
#include <crtdbg.h>
|
37
|
+
#pragma warning(disable : 4996) // 'function': was declared deprecated
|
38
|
+
#endif
|
39
|
+
|
40
|
+
#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
|
41
|
+
#if defined(__clang__) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
|
42
|
+
#pragma GCC diagnostic push
|
43
|
+
#endif
|
44
|
+
#pragma GCC diagnostic ignored "-Weffc++"
|
45
|
+
#endif
|
46
|
+
|
47
|
+
#include "gtest/gtest.h"
|
48
|
+
#include <stdexcept>
|
49
|
+
|
50
|
+
#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
|
51
|
+
#pragma GCC diagnostic pop
|
52
|
+
#endif
|
53
|
+
|
54
|
+
#ifdef __clang__
|
55
|
+
// All TEST() macro generated this warning, disable globally
|
56
|
+
#pragma GCC diagnostic ignored "-Wglobal-constructors"
|
57
|
+
#endif
|
58
|
+
|
59
|
+
template <typename Ch>
|
60
|
+
inline unsigned StrLen(const Ch* s) {
|
61
|
+
const Ch* p = s;
|
62
|
+
while (*p) p++;
|
63
|
+
return unsigned(p - s);
|
64
|
+
}
|
65
|
+
|
66
|
+
template<typename Ch>
|
67
|
+
inline int StrCmp(const Ch* s1, const Ch* s2) {
|
68
|
+
while(*s1 && (*s1 == *s2)) { s1++; s2++; }
|
69
|
+
return static_cast<unsigned>(*s1) < static_cast<unsigned>(*s2) ? -1 : static_cast<unsigned>(*s1) > static_cast<unsigned>(*s2);
|
70
|
+
}
|
71
|
+
|
72
|
+
template <typename Ch>
|
73
|
+
inline Ch* StrDup(const Ch* str) {
|
74
|
+
size_t bufferSize = sizeof(Ch) * (StrLen(str) + 1);
|
75
|
+
Ch* buffer = static_cast<Ch*>(malloc(bufferSize));
|
76
|
+
memcpy(buffer, str, bufferSize);
|
77
|
+
return buffer;
|
78
|
+
}
|
79
|
+
|
80
|
+
inline FILE* TempFile(char *filename) {
|
81
|
+
#if defined(__WIN32__) || defined(_MSC_VER)
|
82
|
+
filename = tmpnam(filename);
|
83
|
+
|
84
|
+
// For Visual Studio, tmpnam() adds a backslash in front. Remove it.
|
85
|
+
if (filename[0] == '\\')
|
86
|
+
for (int i = 0; filename[i] != '\0'; i++)
|
87
|
+
filename[i] = filename[i + 1];
|
88
|
+
|
89
|
+
return fopen(filename, "wb");
|
90
|
+
#else
|
91
|
+
strcpy(filename, "/tmp/fileXXXXXX");
|
92
|
+
int fd = mkstemp(filename);
|
93
|
+
return fdopen(fd, "w");
|
94
|
+
#endif
|
95
|
+
}
|
96
|
+
|
97
|
+
// Use exception for catching assert
|
98
|
+
#ifdef _MSC_VER
|
99
|
+
#pragma warning(disable : 4127)
|
100
|
+
#endif
|
101
|
+
|
102
|
+
#ifdef __clang__
|
103
|
+
#pragma GCC diagnostic push
|
104
|
+
#if __has_warning("-Wdeprecated")
|
105
|
+
#pragma GCC diagnostic ignored "-Wdeprecated"
|
106
|
+
#endif
|
107
|
+
#endif
|
108
|
+
|
109
|
+
class AssertException : public std::logic_error {
|
110
|
+
public:
|
111
|
+
AssertException(const char* w) : std::logic_error(w) {}
|
112
|
+
AssertException(const AssertException& rhs) : std::logic_error(rhs) {}
|
113
|
+
virtual ~AssertException() throw();
|
114
|
+
};
|
115
|
+
|
116
|
+
#ifdef __clang__
|
117
|
+
#pragma GCC diagnostic pop
|
118
|
+
#endif
|
119
|
+
|
120
|
+
// Not using noexcept for testing RAPIDJSON_ASSERT()
|
121
|
+
#define RAPIDJSON_HAS_CXX11_NOEXCEPT 0
|
122
|
+
|
123
|
+
#ifndef RAPIDJSON_ASSERT
|
124
|
+
#define RAPIDJSON_ASSERT(x) (!(x) ? throw AssertException(RAPIDJSON_STRINGIFY(x)) : (void)0u)
|
125
|
+
#ifndef RAPIDJSON_ASSERT_THROWS
|
126
|
+
#define RAPIDJSON_ASSERT_THROWS
|
127
|
+
#endif
|
128
|
+
#endif
|
129
|
+
|
130
|
+
class Random {
|
131
|
+
public:
|
132
|
+
Random(unsigned seed = 0) : mSeed(seed) {}
|
133
|
+
|
134
|
+
unsigned operator()() {
|
135
|
+
mSeed = 214013 * mSeed + 2531011;
|
136
|
+
return mSeed;
|
137
|
+
}
|
138
|
+
|
139
|
+
private:
|
140
|
+
unsigned mSeed;
|
141
|
+
};
|
142
|
+
|
143
|
+
#endif // UNITTEST_H_
|
@@ -0,0 +1,718 @@
|
|
1
|
+
// Tencent is pleased to support the open source community by making RapidJSON available.
|
2
|
+
//
|
3
|
+
// (C) Copyright IBM Corporation 2021
|
4
|
+
//
|
5
|
+
// Licensed under the MIT License (the "License"); you may not use this file except
|
6
|
+
// in compliance with the License. You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://opensource.org/licenses/MIT
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software distributed
|
11
|
+
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
12
|
+
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
13
|
+
// specific language governing permissions and limitations under the License.
|
14
|
+
|
15
|
+
#define RAPIDJSON_SCHEMA_VERBOSE 0
|
16
|
+
#define RAPIDJSON_HAS_STDSTRING 1
|
17
|
+
|
18
|
+
#include "unittest.h"
|
19
|
+
#include "rapidjson/document.h"
|
20
|
+
#include "rapidjson/uri.h"
|
21
|
+
|
22
|
+
#ifdef __clang__
|
23
|
+
RAPIDJSON_DIAG_PUSH
|
24
|
+
RAPIDJSON_DIAG_OFF(variadic-macros)
|
25
|
+
#elif defined(_MSC_VER)
|
26
|
+
RAPIDJSON_DIAG_PUSH
|
27
|
+
RAPIDJSON_DIAG_OFF(4822) // local class member function does not have a body
|
28
|
+
#endif
|
29
|
+
|
30
|
+
using namespace rapidjson;
|
31
|
+
|
32
|
+
TEST(Uri, DefaultConstructor) {
|
33
|
+
typedef GenericUri<Value> UriType;
|
34
|
+
UriType u;
|
35
|
+
EXPECT_TRUE(u.GetSchemeString() == 0);
|
36
|
+
EXPECT_TRUE(u.GetAuthString() == 0);
|
37
|
+
EXPECT_TRUE(u.GetPathString() == 0);
|
38
|
+
EXPECT_TRUE(u.GetBaseString() == 0);
|
39
|
+
EXPECT_TRUE(u.GetQueryString() == 0);
|
40
|
+
EXPECT_TRUE(u.GetFragString() == 0);
|
41
|
+
EXPECT_TRUE(u.GetString() == 0);
|
42
|
+
EXPECT_TRUE(u.GetSchemeStringLength() == 0);
|
43
|
+
EXPECT_TRUE(u.GetAuthStringLength() == 0);
|
44
|
+
EXPECT_TRUE(u.GetPathStringLength() == 0);
|
45
|
+
EXPECT_TRUE(u.GetBaseStringLength() == 0);
|
46
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
47
|
+
EXPECT_TRUE(u.GetFragStringLength() == 0);
|
48
|
+
EXPECT_TRUE(u.GetStringLength() == 0);
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
TEST(Uri, Parse) {
|
53
|
+
typedef GenericUri<Value, MemoryPoolAllocator<> > UriType;
|
54
|
+
MemoryPoolAllocator<CrtAllocator> allocator;
|
55
|
+
Value v;
|
56
|
+
Value w;
|
57
|
+
|
58
|
+
v.SetString("http://auth/path/xxx?query#frag", allocator);
|
59
|
+
UriType u = UriType(v, &allocator);
|
60
|
+
EXPECT_TRUE(StrCmp(u.GetSchemeString(), "http:") == 0);
|
61
|
+
EXPECT_TRUE(StrCmp(u.GetAuthString(), "//auth") == 0);
|
62
|
+
EXPECT_TRUE(StrCmp(u.GetPathString(), "/path/xxx") == 0);
|
63
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), "http://auth/path/xxx?query") == 0);
|
64
|
+
EXPECT_TRUE(StrCmp(u.GetQueryString(), "?query") == 0);
|
65
|
+
EXPECT_TRUE(StrCmp(u.GetFragString(), "#frag") == 0);
|
66
|
+
u.Get(w, allocator);
|
67
|
+
EXPECT_TRUE(*w.GetString() == *v.GetString());
|
68
|
+
|
69
|
+
#if RAPIDJSON_HAS_STDSTRING
|
70
|
+
typedef std::basic_string<Value::Ch> String;
|
71
|
+
String str = "http://auth/path/xxx?query#frag";
|
72
|
+
const UriType uri = UriType(str);
|
73
|
+
EXPECT_TRUE(UriType::GetScheme(uri) == "http:");
|
74
|
+
EXPECT_TRUE(UriType::GetAuth(uri) == "//auth");
|
75
|
+
EXPECT_TRUE(UriType::GetPath(uri) == "/path/xxx");
|
76
|
+
EXPECT_TRUE(UriType::GetBase(uri) == "http://auth/path/xxx?query");
|
77
|
+
EXPECT_TRUE(UriType::GetQuery(uri) == "?query");
|
78
|
+
EXPECT_TRUE(UriType::GetFrag(uri) == "#frag");
|
79
|
+
EXPECT_TRUE(UriType::Get(uri) == str);
|
80
|
+
#endif
|
81
|
+
|
82
|
+
v.SetString("urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f", allocator);
|
83
|
+
u = UriType(v);
|
84
|
+
EXPECT_TRUE(StrCmp(u.GetSchemeString(), "urn:") == 0);
|
85
|
+
EXPECT_TRUE(u.GetAuthStringLength() == 0);
|
86
|
+
EXPECT_TRUE(StrCmp(u.GetPathString(), "uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f") == 0);
|
87
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), "urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f") == 0);
|
88
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
89
|
+
EXPECT_TRUE(u.GetFragStringLength() == 0);
|
90
|
+
u.Get(w, allocator);
|
91
|
+
EXPECT_TRUE(*w.GetString() == *v.GetString());
|
92
|
+
|
93
|
+
v.SetString("", allocator);
|
94
|
+
u = UriType(v);
|
95
|
+
EXPECT_TRUE(u.GetSchemeStringLength() == 0);
|
96
|
+
EXPECT_TRUE(u.GetAuthStringLength() == 0);
|
97
|
+
EXPECT_TRUE(u.GetPathStringLength() == 0);
|
98
|
+
EXPECT_TRUE(u.GetBaseStringLength() == 0);
|
99
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
100
|
+
EXPECT_TRUE(u.GetFragStringLength() == 0);
|
101
|
+
|
102
|
+
v.SetString("http://auth/", allocator);
|
103
|
+
u = UriType(v);
|
104
|
+
EXPECT_TRUE(StrCmp(u.GetSchemeString(), "http:") == 0);
|
105
|
+
EXPECT_TRUE(StrCmp(u.GetAuthString(), "//auth") == 0);
|
106
|
+
EXPECT_TRUE(StrCmp(u.GetPathString(), "/") == 0);
|
107
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), "http://auth/") == 0);
|
108
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
109
|
+
EXPECT_TRUE(u.GetFragStringLength() == 0);
|
110
|
+
|
111
|
+
u = UriType("/path/sub");
|
112
|
+
EXPECT_TRUE(u.GetSchemeStringLength() == 0);
|
113
|
+
EXPECT_TRUE(u.GetAuthStringLength() == 0);
|
114
|
+
EXPECT_TRUE(StrCmp(u.GetPathString(), "/path/sub") == 0);
|
115
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), "/path/sub") == 0);
|
116
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
117
|
+
EXPECT_TRUE(u.GetFragStringLength() == 0);
|
118
|
+
|
119
|
+
// absolute path gets normalized
|
120
|
+
u = UriType("/path/../sub/");
|
121
|
+
EXPECT_TRUE(u.GetSchemeStringLength() == 0);
|
122
|
+
EXPECT_TRUE(u.GetAuthStringLength() == 0);
|
123
|
+
EXPECT_TRUE(StrCmp(u.GetPathString(), "/sub/") == 0);
|
124
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), "/sub/") == 0);
|
125
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
126
|
+
EXPECT_TRUE(u.GetFragStringLength() == 0);
|
127
|
+
|
128
|
+
// relative path does not
|
129
|
+
u = UriType("path/../sub");
|
130
|
+
EXPECT_TRUE(u.GetSchemeStringLength() == 0);
|
131
|
+
EXPECT_TRUE(u.GetAuthStringLength() == 0);
|
132
|
+
EXPECT_TRUE(StrCmp(u.GetPathString(), "path/../sub") == 0);
|
133
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), "path/../sub") == 0);
|
134
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
135
|
+
EXPECT_TRUE(u.GetFragStringLength() == 0);
|
136
|
+
|
137
|
+
u = UriType("http://auth#frag/stuff");
|
138
|
+
EXPECT_TRUE(StrCmp(u.GetSchemeString(), "http:") == 0);
|
139
|
+
EXPECT_TRUE(StrCmp(u.GetAuthString(), "//auth") == 0);
|
140
|
+
EXPECT_TRUE(u.GetPathStringLength() == 0);
|
141
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), "http://auth") == 0);
|
142
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
143
|
+
EXPECT_TRUE(StrCmp(u.GetFragString(), "#frag/stuff") == 0);
|
144
|
+
EXPECT_TRUE(StrCmp(u.GetString(), "http://auth#frag/stuff") == 0);
|
145
|
+
|
146
|
+
const Value::Ch c[] = { '#', 'f', 'r', 'a', 'g', '/', 's', 't', 'u', 'f', 'f', '\0'};
|
147
|
+
SizeType len = internal::StrLen<Value::Ch>(c);
|
148
|
+
u = UriType(c, len);
|
149
|
+
EXPECT_TRUE(StrCmp(u.GetString(), "#frag/stuff") == 0);
|
150
|
+
EXPECT_TRUE(u.GetStringLength() == len);
|
151
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), "") == 0);
|
152
|
+
EXPECT_TRUE(u.GetBaseStringLength() == 0);
|
153
|
+
EXPECT_TRUE(StrCmp(u.GetFragString(), "#frag/stuff") == 0);
|
154
|
+
EXPECT_TRUE(u.GetFragStringLength() == len);
|
155
|
+
|
156
|
+
u = UriType(c);
|
157
|
+
EXPECT_TRUE(StrCmp(u.GetString(), "#frag/stuff") == 0);
|
158
|
+
EXPECT_TRUE(u.GetStringLength() == len);
|
159
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), "") == 0);
|
160
|
+
EXPECT_TRUE(u.GetBaseStringLength() == 0);
|
161
|
+
EXPECT_TRUE(StrCmp(u.GetFragString(), "#frag/stuff") == 0);
|
162
|
+
EXPECT_TRUE(u.GetFragStringLength() == len);
|
163
|
+
|
164
|
+
// Incomplete auth treated as path
|
165
|
+
str = "http:/";
|
166
|
+
const UriType u2 = UriType(str);
|
167
|
+
EXPECT_TRUE(StrCmp(u2.GetSchemeString(), "http:") == 0);
|
168
|
+
EXPECT_TRUE(u2.GetAuthStringLength() == 0);
|
169
|
+
EXPECT_TRUE(StrCmp(u2.GetPathString(), "/") == 0);
|
170
|
+
EXPECT_TRUE(StrCmp(u2.GetBaseString(), "http:/") == 0);
|
171
|
+
}
|
172
|
+
|
173
|
+
TEST(Uri, Parse_UTF16) {
|
174
|
+
typedef GenericValue<UTF16<> > Value16;
|
175
|
+
typedef GenericUri<Value16, MemoryPoolAllocator<> > UriType;
|
176
|
+
MemoryPoolAllocator<CrtAllocator> allocator;
|
177
|
+
Value16 v;
|
178
|
+
Value16 w;
|
179
|
+
|
180
|
+
v.SetString(L"http://auth/path/xxx?query#frag", allocator);
|
181
|
+
UriType u = UriType(v, &allocator);
|
182
|
+
EXPECT_TRUE(StrCmp(u.GetSchemeString(), L"http:") == 0);
|
183
|
+
EXPECT_TRUE(StrCmp(u.GetAuthString(), L"//auth") == 0);
|
184
|
+
EXPECT_TRUE(StrCmp(u.GetPathString(), L"/path/xxx") == 0);
|
185
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), L"http://auth/path/xxx?query") == 0);
|
186
|
+
EXPECT_TRUE(StrCmp(u.GetQueryString(), L"?query") == 0);
|
187
|
+
EXPECT_TRUE(StrCmp(u.GetFragString(), L"#frag") == 0);
|
188
|
+
u.Get(w, allocator);
|
189
|
+
EXPECT_TRUE(*w.GetString() == *v.GetString());
|
190
|
+
|
191
|
+
#if RAPIDJSON_HAS_STDSTRING
|
192
|
+
typedef std::basic_string<Value16::Ch> String;
|
193
|
+
String str = L"http://auth/path/xxx?query#frag";
|
194
|
+
const UriType uri = UriType(str);
|
195
|
+
EXPECT_TRUE(UriType::GetScheme(uri) == L"http:");
|
196
|
+
EXPECT_TRUE(UriType::GetAuth(uri) == L"//auth");
|
197
|
+
EXPECT_TRUE(UriType::GetPath(uri) == L"/path/xxx");
|
198
|
+
EXPECT_TRUE(UriType::GetBase(uri) == L"http://auth/path/xxx?query");
|
199
|
+
EXPECT_TRUE(UriType::GetQuery(uri) == L"?query");
|
200
|
+
EXPECT_TRUE(UriType::GetFrag(uri) == L"#frag");
|
201
|
+
EXPECT_TRUE(UriType::Get(uri) == str);
|
202
|
+
#endif
|
203
|
+
|
204
|
+
v.SetString(L"urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f", allocator);
|
205
|
+
u = UriType(v);
|
206
|
+
EXPECT_TRUE(StrCmp(u.GetSchemeString(), L"urn:") == 0);
|
207
|
+
EXPECT_TRUE(u.GetAuthStringLength() == 0);
|
208
|
+
EXPECT_TRUE(StrCmp(u.GetPathString(), L"uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f") == 0);
|
209
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), L"urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f") == 0);
|
210
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
211
|
+
EXPECT_TRUE(u.GetFragStringLength() == 0);
|
212
|
+
u.Get(w, allocator);
|
213
|
+
EXPECT_TRUE(*w.GetString() == *v.GetString());
|
214
|
+
|
215
|
+
v.SetString(L"", allocator);
|
216
|
+
u = UriType(v);
|
217
|
+
EXPECT_TRUE(u.GetSchemeStringLength() == 0);
|
218
|
+
EXPECT_TRUE(u.GetAuthStringLength() == 0);
|
219
|
+
EXPECT_TRUE(u.GetPathStringLength() == 0);
|
220
|
+
EXPECT_TRUE(u.GetBaseStringLength() == 0);
|
221
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
222
|
+
EXPECT_TRUE(u.GetFragStringLength() == 0);
|
223
|
+
|
224
|
+
v.SetString(L"http://auth/", allocator);
|
225
|
+
u = UriType(v);
|
226
|
+
EXPECT_TRUE(StrCmp(u.GetSchemeString(), L"http:") == 0);
|
227
|
+
EXPECT_TRUE(StrCmp(u.GetAuthString(), L"//auth") == 0);
|
228
|
+
EXPECT_TRUE(StrCmp(u.GetPathString(), L"/") == 0);
|
229
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), L"http://auth/") == 0);
|
230
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
231
|
+
EXPECT_TRUE(u.GetFragStringLength() == 0);
|
232
|
+
|
233
|
+
u = UriType(L"/path/sub");
|
234
|
+
EXPECT_TRUE(u.GetSchemeStringLength() == 0);
|
235
|
+
EXPECT_TRUE(u.GetAuthStringLength() == 0);
|
236
|
+
EXPECT_TRUE(StrCmp(u.GetPathString(), L"/path/sub") == 0);
|
237
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), L"/path/sub") == 0);
|
238
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
239
|
+
EXPECT_TRUE(u.GetFragStringLength() == 0);
|
240
|
+
|
241
|
+
// absolute path gets normalized
|
242
|
+
u = UriType(L"/path/../sub/");
|
243
|
+
EXPECT_TRUE(u.GetSchemeStringLength() == 0);
|
244
|
+
EXPECT_TRUE(u.GetAuthStringLength() == 0);
|
245
|
+
EXPECT_TRUE(StrCmp(u.GetPathString(), L"/sub/") == 0);
|
246
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), L"/sub/") == 0);
|
247
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
248
|
+
EXPECT_TRUE(u.GetFragStringLength() == 0);
|
249
|
+
|
250
|
+
// relative path does not
|
251
|
+
u = UriType(L"path/../sub");
|
252
|
+
EXPECT_TRUE(u.GetSchemeStringLength() == 0);
|
253
|
+
EXPECT_TRUE(u.GetAuthStringLength() == 0);
|
254
|
+
EXPECT_TRUE(StrCmp(u.GetPathString(), L"path/../sub") == 0);
|
255
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), L"path/../sub") == 0);
|
256
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
257
|
+
EXPECT_TRUE(u.GetFragStringLength() == 0);
|
258
|
+
|
259
|
+
u = UriType(L"http://auth#frag/stuff");
|
260
|
+
EXPECT_TRUE(StrCmp(u.GetSchemeString(), L"http:") == 0);
|
261
|
+
EXPECT_TRUE(StrCmp(u.GetAuthString(), L"//auth") == 0);
|
262
|
+
EXPECT_TRUE(u.GetPathStringLength() == 0);
|
263
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), L"http://auth") == 0);
|
264
|
+
EXPECT_TRUE(u.GetQueryStringLength() == 0);
|
265
|
+
EXPECT_TRUE(StrCmp(u.GetFragString(), L"#frag/stuff") == 0);
|
266
|
+
EXPECT_TRUE(StrCmp(u.GetString(), L"http://auth#frag/stuff") == 0);
|
267
|
+
|
268
|
+
const Value16::Ch c[] = { '#', 'f', 'r', 'a', 'g', '/', 's', 't', 'u', 'f', 'f', '\0'};
|
269
|
+
SizeType len = internal::StrLen<Value16::Ch>(c);
|
270
|
+
u = UriType(c, len);
|
271
|
+
EXPECT_TRUE(StrCmp(u.GetString(), L"#frag/stuff") == 0);
|
272
|
+
EXPECT_TRUE(u.GetStringLength() == len);
|
273
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), L"") == 0);
|
274
|
+
EXPECT_TRUE(u.GetBaseStringLength() == 0);
|
275
|
+
EXPECT_TRUE(StrCmp(u.GetFragString(), L"#frag/stuff") == 0);
|
276
|
+
EXPECT_TRUE(u.GetFragStringLength() == len);
|
277
|
+
|
278
|
+
u = UriType(c);
|
279
|
+
EXPECT_TRUE(StrCmp(u.GetString(), L"#frag/stuff") == 0);
|
280
|
+
EXPECT_TRUE(u.GetStringLength() == len);
|
281
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), L"") == 0);
|
282
|
+
EXPECT_TRUE(u.GetBaseStringLength() == 0);
|
283
|
+
EXPECT_TRUE(StrCmp(u.GetFragString(), L"#frag/stuff") == 0);
|
284
|
+
EXPECT_TRUE(u.GetFragStringLength() == len);
|
285
|
+
|
286
|
+
// Incomplete auth treated as path
|
287
|
+
u = UriType(L"http:/");
|
288
|
+
EXPECT_TRUE(StrCmp(u.GetSchemeString(), L"http:") == 0);
|
289
|
+
EXPECT_TRUE(u.GetAuthStringLength() == 0);
|
290
|
+
EXPECT_TRUE(StrCmp(u.GetPathString(), L"/") == 0);
|
291
|
+
EXPECT_TRUE(StrCmp(u.GetBaseString(), L"http:/") == 0);
|
292
|
+
}
|
293
|
+
|
294
|
+
TEST(Uri, CopyConstructor) {
|
295
|
+
typedef GenericUri<Value> UriType;
|
296
|
+
CrtAllocator allocator;
|
297
|
+
|
298
|
+
UriType u("http://auth/path/xxx?query#frag", &allocator);
|
299
|
+
UriType u2(u);
|
300
|
+
EXPECT_TRUE(u == u2);
|
301
|
+
EXPECT_NE(&u.GetAllocator(), &u2.GetAllocator());
|
302
|
+
}
|
303
|
+
|
304
|
+
TEST(Uri, Assignment) {
|
305
|
+
typedef GenericUri<Value> UriType;
|
306
|
+
CrtAllocator allocator;
|
307
|
+
|
308
|
+
UriType u("http://auth/path/xxx?query#frag", &allocator);
|
309
|
+
UriType u2;
|
310
|
+
u2 = u;
|
311
|
+
EXPECT_TRUE(u == u2);
|
312
|
+
EXPECT_NE(&u.GetAllocator(), &u2.GetAllocator());
|
313
|
+
}
|
314
|
+
|
315
|
+
TEST(Uri, Resolve) {
|
316
|
+
typedef GenericUri<Value> UriType;
|
317
|
+
CrtAllocator allocator;
|
318
|
+
|
319
|
+
// ref is full uri
|
320
|
+
UriType base = UriType("http://auth/path/#frag");
|
321
|
+
UriType ref = UriType("http://newauth/newpath#newfrag");
|
322
|
+
UriType res = ref.Resolve(base);
|
323
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://newauth/newpath#newfrag") == 0);
|
324
|
+
|
325
|
+
base = UriType("/path/#frag", &allocator);
|
326
|
+
ref = UriType("http://newauth/newpath#newfrag", &allocator);
|
327
|
+
res = ref.Resolve(base, &allocator);
|
328
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://newauth/newpath#newfrag") == 0);
|
329
|
+
|
330
|
+
// ref is alternate uri
|
331
|
+
base = UriType("http://auth/path/#frag");
|
332
|
+
ref = UriType("urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f");
|
333
|
+
res = ref.Resolve(base);
|
334
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f") == 0);
|
335
|
+
|
336
|
+
// ref is absolute path
|
337
|
+
base = UriType("http://auth/path/#");
|
338
|
+
ref = UriType("/newpath#newfrag");
|
339
|
+
res = ref.Resolve(base);
|
340
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://auth/newpath#newfrag") == 0);
|
341
|
+
|
342
|
+
// ref is relative path
|
343
|
+
base = UriType("http://auth/path/file.json#frag");
|
344
|
+
ref = UriType("newfile.json#");
|
345
|
+
res = ref.Resolve(base);
|
346
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://auth/path/newfile.json#") == 0);
|
347
|
+
|
348
|
+
base = UriType("http://auth/path/file.json#frag/stuff");
|
349
|
+
ref = UriType("newfile.json#newfrag/newstuff");
|
350
|
+
res = ref.Resolve(base);
|
351
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://auth/path/newfile.json#newfrag/newstuff") == 0);
|
352
|
+
|
353
|
+
base = UriType("file.json", &allocator);
|
354
|
+
ref = UriType("newfile.json", &base.GetAllocator());
|
355
|
+
res = ref.Resolve(base, &ref.GetAllocator());
|
356
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "newfile.json") == 0);
|
357
|
+
|
358
|
+
base = UriType("file.json", &allocator);
|
359
|
+
ref = UriType("./newfile.json", &allocator);
|
360
|
+
res = ref.Resolve(base, &allocator);
|
361
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "newfile.json") == 0);
|
362
|
+
|
363
|
+
base = UriType("file.json");
|
364
|
+
ref = UriType("parent/../newfile.json");
|
365
|
+
res = ref.Resolve(base);
|
366
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "newfile.json") == 0);
|
367
|
+
|
368
|
+
base = UriType("file.json");
|
369
|
+
ref = UriType("parent/./newfile.json");
|
370
|
+
res = ref.Resolve(base);
|
371
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "parent/newfile.json") == 0);
|
372
|
+
|
373
|
+
base = UriType("file.json");
|
374
|
+
ref = UriType("../../parent/.././newfile.json");
|
375
|
+
res = ref.Resolve(base);
|
376
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "newfile.json") == 0);
|
377
|
+
|
378
|
+
// This adds a joining slash so resolved length is base length + ref length + 1
|
379
|
+
base = UriType("http://auth");
|
380
|
+
ref = UriType("newfile.json");
|
381
|
+
res = ref.Resolve(base);
|
382
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://auth/newfile.json") == 0);
|
383
|
+
|
384
|
+
// ref is fragment
|
385
|
+
base = UriType("#frag/stuff");
|
386
|
+
ref = UriType("#newfrag/newstuff");
|
387
|
+
res = ref.Resolve(base);
|
388
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "#newfrag/newstuff") == 0);
|
389
|
+
|
390
|
+
// test ref fragment always wins
|
391
|
+
base = UriType("/path#frag");
|
392
|
+
ref = UriType("");
|
393
|
+
res = ref.Resolve(base);
|
394
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "/path") == 0);
|
395
|
+
|
396
|
+
// Examples from RFC3896
|
397
|
+
base = UriType("http://a/b/c/d;p?q");
|
398
|
+
ref = UriType("g:h");
|
399
|
+
res = ref.Resolve(base);
|
400
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "g:h") == 0);
|
401
|
+
ref = UriType("g");
|
402
|
+
res = ref.Resolve(base);
|
403
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g") == 0);
|
404
|
+
ref = UriType("./g");
|
405
|
+
res = ref.Resolve(base);
|
406
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g") == 0);
|
407
|
+
ref = UriType("g/");
|
408
|
+
res = ref.Resolve(base);
|
409
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g/") == 0);
|
410
|
+
ref = UriType("/g");
|
411
|
+
res = ref.Resolve(base);
|
412
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/g") == 0);
|
413
|
+
ref = UriType("//g");
|
414
|
+
res = ref.Resolve(base);
|
415
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://g") == 0);
|
416
|
+
ref = UriType("?y");
|
417
|
+
res = ref.Resolve(base);
|
418
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/d;p?y") == 0);
|
419
|
+
ref = UriType("g?y");
|
420
|
+
res = ref.Resolve(base);
|
421
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g?y") == 0);
|
422
|
+
ref = UriType("#s");
|
423
|
+
res = ref.Resolve(base);
|
424
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/d;p?q#s") == 0);
|
425
|
+
ref = UriType("g#s");
|
426
|
+
res = ref.Resolve(base);
|
427
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g#s") == 0);
|
428
|
+
ref = UriType("g?y#s");
|
429
|
+
res = ref.Resolve(base);
|
430
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g?y#s") == 0);
|
431
|
+
ref = UriType(";x");
|
432
|
+
res = ref.Resolve(base);
|
433
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/;x") == 0);
|
434
|
+
ref = UriType("g;x");
|
435
|
+
res = ref.Resolve(base);
|
436
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g;x") == 0);
|
437
|
+
ref = UriType("g;x?y#s");
|
438
|
+
res = ref.Resolve(base);
|
439
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g;x?y#s") == 0);
|
440
|
+
ref = UriType("");
|
441
|
+
res = ref.Resolve(base);
|
442
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/d;p?q") == 0);
|
443
|
+
ref = UriType(".");
|
444
|
+
res = ref.Resolve(base);
|
445
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/") == 0);
|
446
|
+
ref = UriType("./");
|
447
|
+
res = ref.Resolve(base);
|
448
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/") == 0);
|
449
|
+
ref = UriType("..");
|
450
|
+
res = ref.Resolve(base);
|
451
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/") == 0);
|
452
|
+
ref = UriType("../");
|
453
|
+
res = ref.Resolve(base);
|
454
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/") == 0);
|
455
|
+
ref = UriType("../g");
|
456
|
+
res = ref.Resolve(base);
|
457
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/g") == 0);
|
458
|
+
ref = UriType("../..");
|
459
|
+
res = ref.Resolve(base);
|
460
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/") == 0);
|
461
|
+
ref = UriType("../../");
|
462
|
+
res = ref.Resolve(base);
|
463
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/") == 0);
|
464
|
+
ref = UriType("../../g");
|
465
|
+
res = ref.Resolve(base);
|
466
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/g") == 0);
|
467
|
+
ref = UriType("../../../g");
|
468
|
+
res = ref.Resolve(base);
|
469
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/g") == 0);
|
470
|
+
ref = UriType("../../../../g");
|
471
|
+
res = ref.Resolve(base);
|
472
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/g") == 0);
|
473
|
+
ref = UriType("/./g");
|
474
|
+
res = ref.Resolve(base);
|
475
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/g") == 0);
|
476
|
+
ref = UriType("/../g");
|
477
|
+
res = ref.Resolve(base);
|
478
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/g") == 0);
|
479
|
+
ref = UriType("g.");
|
480
|
+
res = ref.Resolve(base);
|
481
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g.") == 0);
|
482
|
+
ref = UriType(".g");
|
483
|
+
res = ref.Resolve(base);
|
484
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/.g") == 0);
|
485
|
+
ref = UriType("g..");
|
486
|
+
res = ref.Resolve(base);
|
487
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g..") == 0);
|
488
|
+
ref = UriType("..g");
|
489
|
+
res = ref.Resolve(base);
|
490
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/..g") == 0);
|
491
|
+
ref = UriType("g#s/../x");
|
492
|
+
res = ref.Resolve(base);
|
493
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g#s/../x") == 0);
|
494
|
+
}
|
495
|
+
|
496
|
+
TEST(Uri, Resolve_UTF16) {
|
497
|
+
typedef GenericValue<UTF16<> > Value16;
|
498
|
+
typedef GenericUri<Value16> UriType;
|
499
|
+
CrtAllocator allocator;
|
500
|
+
|
501
|
+
// ref is full uri
|
502
|
+
UriType base = UriType(L"http://auth/path/#frag");
|
503
|
+
UriType ref = UriType(L"http://newauth/newpath#newfrag");
|
504
|
+
UriType res = ref.Resolve(base);
|
505
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://newauth/newpath#newfrag") == 0);
|
506
|
+
|
507
|
+
base = UriType(L"/path/#frag");
|
508
|
+
ref = UriType(L"http://newauth/newpath#newfrag");
|
509
|
+
res = ref.Resolve(base);
|
510
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://newauth/newpath#newfrag") == 0);
|
511
|
+
|
512
|
+
// ref is alternate uri
|
513
|
+
base = UriType(L"http://auth/path/#frag");
|
514
|
+
ref = UriType(L"urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f");
|
515
|
+
res = ref.Resolve(base);
|
516
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f") == 0);
|
517
|
+
|
518
|
+
// ref is absolute path
|
519
|
+
base = UriType(L"http://auth/path/#");
|
520
|
+
ref = UriType(L"/newpath#newfrag");
|
521
|
+
res = ref.Resolve(base);
|
522
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://auth/newpath#newfrag") == 0);
|
523
|
+
|
524
|
+
// ref is relative path
|
525
|
+
base = UriType(L"http://auth/path/file.json#frag");
|
526
|
+
ref = UriType(L"newfile.json#");
|
527
|
+
res = ref.Resolve(base);
|
528
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://auth/path/newfile.json#") == 0);
|
529
|
+
|
530
|
+
base = UriType(L"http://auth/path/file.json#frag/stuff");
|
531
|
+
ref = UriType(L"newfile.json#newfrag/newstuff");
|
532
|
+
res = ref.Resolve(base);
|
533
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://auth/path/newfile.json#newfrag/newstuff") == 0);
|
534
|
+
|
535
|
+
base = UriType(L"file.json", &allocator);
|
536
|
+
ref = UriType(L"newfile.json", &base.GetAllocator());
|
537
|
+
res = ref.Resolve(base, &ref.GetAllocator());
|
538
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"newfile.json") == 0);
|
539
|
+
|
540
|
+
base = UriType(L"file.json", &allocator);
|
541
|
+
ref = UriType(L"./newfile.json", &allocator);
|
542
|
+
res = ref.Resolve(base, &allocator);
|
543
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"newfile.json") == 0);
|
544
|
+
|
545
|
+
base = UriType(L"file.json");
|
546
|
+
ref = UriType(L"parent/../newfile.json");
|
547
|
+
res = ref.Resolve(base);
|
548
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"newfile.json") == 0);
|
549
|
+
|
550
|
+
base = UriType(L"file.json");
|
551
|
+
ref = UriType(L"parent/./newfile.json");
|
552
|
+
res = ref.Resolve(base);
|
553
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"parent/newfile.json") == 0);
|
554
|
+
|
555
|
+
base = UriType(L"file.json");
|
556
|
+
ref = UriType(L"../../parent/.././newfile.json");
|
557
|
+
res = ref.Resolve(base);
|
558
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"newfile.json") == 0);
|
559
|
+
|
560
|
+
// This adds a joining slash so resolved length is base length + ref length + 1
|
561
|
+
base = UriType(L"http://auth");
|
562
|
+
ref = UriType(L"newfile.json");
|
563
|
+
res = ref.Resolve(base);
|
564
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://auth/newfile.json") == 0);
|
565
|
+
|
566
|
+
// ref is fragment
|
567
|
+
base = UriType(L"#frag/stuff");
|
568
|
+
ref = UriType(L"#newfrag/newstuff");
|
569
|
+
res = ref.Resolve(base);
|
570
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"#newfrag/newstuff") == 0);
|
571
|
+
|
572
|
+
// test ref fragment always wins
|
573
|
+
base = UriType(L"/path#frag");
|
574
|
+
ref = UriType(L"");
|
575
|
+
res = ref.Resolve(base);
|
576
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"/path") == 0);
|
577
|
+
|
578
|
+
// Examples from RFC3896
|
579
|
+
base = UriType(L"http://a/b/c/d;p?q");
|
580
|
+
ref = UriType(L"g:h");
|
581
|
+
res = ref.Resolve(base);
|
582
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"g:h") == 0);
|
583
|
+
ref = UriType(L"g");
|
584
|
+
res = ref.Resolve(base);
|
585
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g") == 0);
|
586
|
+
ref = UriType(L"./g");
|
587
|
+
res = ref.Resolve(base);
|
588
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g") == 0);
|
589
|
+
ref = UriType(L"g/");
|
590
|
+
res = ref.Resolve(base);
|
591
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g/") == 0);
|
592
|
+
ref = UriType(L"/g");
|
593
|
+
res = ref.Resolve(base);
|
594
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/g") == 0);
|
595
|
+
ref = UriType(L"//g");
|
596
|
+
res = ref.Resolve(base);
|
597
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://g") == 0);
|
598
|
+
ref = UriType(L"?y");
|
599
|
+
res = ref.Resolve(base);
|
600
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/d;p?y") == 0);
|
601
|
+
ref = UriType(L"g?y");
|
602
|
+
res = ref.Resolve(base);
|
603
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g?y") == 0);
|
604
|
+
ref = UriType(L"#s");
|
605
|
+
res = ref.Resolve(base);
|
606
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/d;p?q#s") == 0);
|
607
|
+
ref = UriType(L"g#s");
|
608
|
+
res = ref.Resolve(base);
|
609
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g#s") == 0);
|
610
|
+
ref = UriType(L"g?y#s");
|
611
|
+
res = ref.Resolve(base);
|
612
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g?y#s") == 0);
|
613
|
+
ref = UriType(L";x");
|
614
|
+
res = ref.Resolve(base);
|
615
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/;x") == 0);
|
616
|
+
ref = UriType(L"g;x");
|
617
|
+
res = ref.Resolve(base);
|
618
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g;x") == 0);
|
619
|
+
ref = UriType(L"g;x?y#s");
|
620
|
+
res = ref.Resolve(base);
|
621
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g;x?y#s") == 0);
|
622
|
+
ref = UriType(L"");
|
623
|
+
res = ref.Resolve(base);
|
624
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/d;p?q") == 0);
|
625
|
+
ref = UriType(L".");
|
626
|
+
res = ref.Resolve(base);
|
627
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/") == 0);
|
628
|
+
ref = UriType(L"./");
|
629
|
+
res = ref.Resolve(base);
|
630
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/") == 0);
|
631
|
+
ref = UriType(L"..");
|
632
|
+
res = ref.Resolve(base);
|
633
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/") == 0);
|
634
|
+
ref = UriType(L"../");
|
635
|
+
res = ref.Resolve(base);
|
636
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/") == 0);
|
637
|
+
ref = UriType(L"../g");
|
638
|
+
res = ref.Resolve(base);
|
639
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/g") == 0);
|
640
|
+
ref = UriType(L"../..");
|
641
|
+
res = ref.Resolve(base);
|
642
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/") == 0);
|
643
|
+
ref = UriType(L"../../");
|
644
|
+
res = ref.Resolve(base);
|
645
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/") == 0);
|
646
|
+
ref = UriType(L"../../g");
|
647
|
+
res = ref.Resolve(base);
|
648
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/g") == 0);
|
649
|
+
ref = UriType(L"../../../g");
|
650
|
+
res = ref.Resolve(base);
|
651
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/g") == 0);
|
652
|
+
ref = UriType(L"../../../../g");
|
653
|
+
res = ref.Resolve(base);
|
654
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/g") == 0);
|
655
|
+
ref = UriType(L"/./g");
|
656
|
+
res = ref.Resolve(base);
|
657
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/g") == 0);
|
658
|
+
ref = UriType(L"/../g");
|
659
|
+
res = ref.Resolve(base);
|
660
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/g") == 0);
|
661
|
+
ref = UriType(L"g.");
|
662
|
+
res = ref.Resolve(base);
|
663
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g.") == 0);
|
664
|
+
ref = UriType(L".g");
|
665
|
+
res = ref.Resolve(base);
|
666
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/.g") == 0);
|
667
|
+
ref = UriType(L"g..");
|
668
|
+
res = ref.Resolve(base);
|
669
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g..") == 0);
|
670
|
+
ref = UriType(L"..g");
|
671
|
+
res = ref.Resolve(base);
|
672
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/..g") == 0);
|
673
|
+
ref = UriType(L"g#s/../x");
|
674
|
+
res = ref.Resolve(base);
|
675
|
+
EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g#s/../x") == 0);
|
676
|
+
}
|
677
|
+
|
678
|
+
TEST(Uri, Equals) {
|
679
|
+
typedef GenericUri<Value> UriType;
|
680
|
+
|
681
|
+
UriType a = UriType("http://a/a#a");
|
682
|
+
UriType b = UriType("http://a/a#b");
|
683
|
+
UriType c = a;
|
684
|
+
|
685
|
+
EXPECT_TRUE(a == a);
|
686
|
+
EXPECT_TRUE(a == c);
|
687
|
+
EXPECT_TRUE(a != b);
|
688
|
+
}
|
689
|
+
|
690
|
+
TEST(Uri, Match) {
|
691
|
+
typedef GenericUri<Value> UriType;
|
692
|
+
|
693
|
+
UriType a = UriType("http://a/a#a");
|
694
|
+
UriType b = UriType("http://a/a#b");
|
695
|
+
UriType c = a;
|
696
|
+
UriType d;
|
697
|
+
|
698
|
+
EXPECT_TRUE(a.Match(a));
|
699
|
+
EXPECT_TRUE(a.Match(c));
|
700
|
+
EXPECT_FALSE(a.Match(b));
|
701
|
+
EXPECT_FALSE(a.Match(b, true));
|
702
|
+
EXPECT_TRUE(a.Match(b, false)); // Base Uri same
|
703
|
+
EXPECT_FALSE(a.Match(d));
|
704
|
+
EXPECT_FALSE(d.Match(a));
|
705
|
+
}
|
706
|
+
|
707
|
+
TEST(Uri, Issue1899) {
|
708
|
+
typedef GenericUri<Value, MemoryPoolAllocator<> > UriType;
|
709
|
+
|
710
|
+
UriType base = UriType("http://auth/path/#frag");
|
711
|
+
UriType ref = UriType("http://newauth/newpath#newfrag");
|
712
|
+
UriType res = ref.Resolve(base);
|
713
|
+
EXPECT_TRUE(StrCmp(res.GetString(), "http://newauth/newpath#newfrag") == 0);
|
714
|
+
}
|
715
|
+
|
716
|
+
#if defined(_MSC_VER) || defined(__clang__)
|
717
|
+
RAPIDJSON_DIAG_POP
|
718
|
+
#endif
|