rj_schema 0.2.4 → 0.2.5
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 +226 -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 +54 -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/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/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 +78 -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/tutorial/tutorial.cpp +151 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +284 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/cursorstreamwrapper.h +78 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/document.h +2732 -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 +74 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/error/error.h +161 -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 +69 -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 +1415 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/prettywriter.h +277 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +676 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/reader.h +2236 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +2496 -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/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 +185 -0
- data/ext/rj_schema/rapidjson/test/perftest/platformtest.cpp +166 -0
- data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +546 -0
- data/ext/rj_schema/rapidjson/test/perftest/schematest.cpp +223 -0
- data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +92 -0
- data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +100 -0
- data/ext/rj_schema/rapidjson/test/unittest/bigintegertest.cpp +138 -0
- data/ext/rj_schema/rapidjson/test/unittest/cursorstreamwrappertest.cpp +115 -0
- data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +672 -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/pointertest.cpp +1638 -0
- data/ext/rj_schema/rapidjson/test/unittest/prettywritertest.cpp +373 -0
- data/ext/rj_schema/rapidjson/test/unittest/readertest.cpp +2225 -0
- data/ext/rj_schema/rapidjson/test/unittest/regextest.cpp +639 -0
- data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +2072 -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/valuetest.cpp +1851 -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
- metadata +613 -1
@@ -0,0 +1,1082 @@
|
|
1
|
+
// Copyright 2007, Google Inc.
|
2
|
+
// All rights reserved.
|
3
|
+
//
|
4
|
+
// Redistribution and use in source and binary forms, with or without
|
5
|
+
// modification, are permitted provided that the following conditions are
|
6
|
+
// met:
|
7
|
+
//
|
8
|
+
// * Redistributions of source code must retain the above copyright
|
9
|
+
// notice, this list of conditions and the following disclaimer.
|
10
|
+
// * Redistributions in binary form must reproduce the above
|
11
|
+
// copyright notice, this list of conditions and the following disclaimer
|
12
|
+
// in the documentation and/or other materials provided with the
|
13
|
+
// distribution.
|
14
|
+
// * Neither the name of Google Inc. nor the names of its
|
15
|
+
// contributors may be used to endorse or promote products derived from
|
16
|
+
// this software without specific prior written permission.
|
17
|
+
//
|
18
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
20
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
21
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
22
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
23
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
24
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
25
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
26
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
27
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
+
//
|
30
|
+
// Author: wan@google.com (Zhanyong Wan)
|
31
|
+
|
32
|
+
// Google Test - The Google C++ Testing and Mocking Framework
|
33
|
+
//
|
34
|
+
// This file implements a universal value printer that can print a
|
35
|
+
// value of any type T:
|
36
|
+
//
|
37
|
+
// void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
|
38
|
+
//
|
39
|
+
// A user can teach this function how to print a class type T by
|
40
|
+
// defining either operator<<() or PrintTo() in the namespace that
|
41
|
+
// defines T. More specifically, the FIRST defined function in the
|
42
|
+
// following list will be used (assuming T is defined in namespace
|
43
|
+
// foo):
|
44
|
+
//
|
45
|
+
// 1. foo::PrintTo(const T&, ostream*)
|
46
|
+
// 2. operator<<(ostream&, const T&) defined in either foo or the
|
47
|
+
// global namespace.
|
48
|
+
//
|
49
|
+
// However if T is an STL-style container then it is printed element-wise
|
50
|
+
// unless foo::PrintTo(const T&, ostream*) is defined. Note that
|
51
|
+
// operator<<() is ignored for container types.
|
52
|
+
//
|
53
|
+
// If none of the above is defined, it will print the debug string of
|
54
|
+
// the value if it is a protocol buffer, or print the raw bytes in the
|
55
|
+
// value otherwise.
|
56
|
+
//
|
57
|
+
// To aid debugging: when T is a reference type, the address of the
|
58
|
+
// value is also printed; when T is a (const) char pointer, both the
|
59
|
+
// pointer value and the NUL-terminated string it points to are
|
60
|
+
// printed.
|
61
|
+
//
|
62
|
+
// We also provide some convenient wrappers:
|
63
|
+
//
|
64
|
+
// // Prints a value to a string. For a (const or not) char
|
65
|
+
// // pointer, the NUL-terminated string (but not the pointer) is
|
66
|
+
// // printed.
|
67
|
+
// std::string ::testing::PrintToString(const T& value);
|
68
|
+
//
|
69
|
+
// // Prints a value tersely: for a reference type, the referenced
|
70
|
+
// // value (but not the address) is printed; for a (const or not) char
|
71
|
+
// // pointer, the NUL-terminated string (but not the pointer) is
|
72
|
+
// // printed.
|
73
|
+
// void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
|
74
|
+
//
|
75
|
+
// // Prints value using the type inferred by the compiler. The difference
|
76
|
+
// // from UniversalTersePrint() is that this function prints both the
|
77
|
+
// // pointer and the NUL-terminated string for a (const or not) char pointer.
|
78
|
+
// void ::testing::internal::UniversalPrint(const T& value, ostream*);
|
79
|
+
//
|
80
|
+
// // Prints the fields of a tuple tersely to a string vector, one
|
81
|
+
// // element for each field. Tuple support must be enabled in
|
82
|
+
// // gtest-port.h.
|
83
|
+
// std::vector<string> UniversalTersePrintTupleFieldsToStrings(
|
84
|
+
// const Tuple& value);
|
85
|
+
//
|
86
|
+
// Known limitation:
|
87
|
+
//
|
88
|
+
// The print primitives print the elements of an STL-style container
|
89
|
+
// using the compiler-inferred type of *iter where iter is a
|
90
|
+
// const_iterator of the container. When const_iterator is an input
|
91
|
+
// iterator but not a forward iterator, this inferred type may not
|
92
|
+
// match value_type, and the print output may be incorrect. In
|
93
|
+
// practice, this is rarely a problem as for most containers
|
94
|
+
// const_iterator is a forward iterator. We'll fix this if there's an
|
95
|
+
// actual need for it. Note that this fix cannot rely on value_type
|
96
|
+
// being defined as many user-defined container types don't have
|
97
|
+
// value_type.
|
98
|
+
|
99
|
+
#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
|
100
|
+
#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
|
101
|
+
|
102
|
+
#include <ostream> // NOLINT
|
103
|
+
#include <sstream>
|
104
|
+
#include <string>
|
105
|
+
#include <utility>
|
106
|
+
#include <vector>
|
107
|
+
#include "gtest/internal/gtest-port.h"
|
108
|
+
#include "gtest/internal/gtest-internal.h"
|
109
|
+
|
110
|
+
#if GTEST_HAS_STD_TUPLE_
|
111
|
+
# include <tuple>
|
112
|
+
#endif
|
113
|
+
|
114
|
+
#if GTEST_HAS_ABSL
|
115
|
+
#include "absl/strings/string_view.h"
|
116
|
+
#include "absl/types/optional.h"
|
117
|
+
#endif // GTEST_HAS_ABSL
|
118
|
+
|
119
|
+
namespace testing {
|
120
|
+
|
121
|
+
// Definitions in the 'internal' and 'internal2' name spaces are
|
122
|
+
// subject to change without notice. DO NOT USE THEM IN USER CODE!
|
123
|
+
namespace internal2 {
|
124
|
+
|
125
|
+
// Prints the given number of bytes in the given object to the given
|
126
|
+
// ostream.
|
127
|
+
GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
|
128
|
+
size_t count,
|
129
|
+
::std::ostream* os);
|
130
|
+
|
131
|
+
// For selecting which printer to use when a given type has neither <<
|
132
|
+
// nor PrintTo().
|
133
|
+
enum TypeKind {
|
134
|
+
kProtobuf, // a protobuf type
|
135
|
+
kConvertibleToInteger, // a type implicitly convertible to BiggestInt
|
136
|
+
// (e.g. a named or unnamed enum type)
|
137
|
+
#if GTEST_HAS_ABSL
|
138
|
+
kConvertibleToStringView, // a type implicitly convertible to
|
139
|
+
// absl::string_view
|
140
|
+
#endif
|
141
|
+
kOtherType // anything else
|
142
|
+
};
|
143
|
+
|
144
|
+
// TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
|
145
|
+
// by the universal printer to print a value of type T when neither
|
146
|
+
// operator<< nor PrintTo() is defined for T, where kTypeKind is the
|
147
|
+
// "kind" of T as defined by enum TypeKind.
|
148
|
+
template <typename T, TypeKind kTypeKind>
|
149
|
+
class TypeWithoutFormatter {
|
150
|
+
public:
|
151
|
+
// This default version is called when kTypeKind is kOtherType.
|
152
|
+
static void PrintValue(const T& value, ::std::ostream* os) {
|
153
|
+
PrintBytesInObjectTo(static_cast<const unsigned char*>(
|
154
|
+
reinterpret_cast<const void*>(&value)),
|
155
|
+
sizeof(value), os);
|
156
|
+
}
|
157
|
+
};
|
158
|
+
|
159
|
+
// We print a protobuf using its ShortDebugString() when the string
|
160
|
+
// doesn't exceed this many characters; otherwise we print it using
|
161
|
+
// DebugString() for better readability.
|
162
|
+
const size_t kProtobufOneLinerMaxLength = 50;
|
163
|
+
|
164
|
+
template <typename T>
|
165
|
+
class TypeWithoutFormatter<T, kProtobuf> {
|
166
|
+
public:
|
167
|
+
static void PrintValue(const T& value, ::std::ostream* os) {
|
168
|
+
std::string pretty_str = value.ShortDebugString();
|
169
|
+
if (pretty_str.length() > kProtobufOneLinerMaxLength) {
|
170
|
+
pretty_str = "\n" + value.DebugString();
|
171
|
+
}
|
172
|
+
*os << ("<" + pretty_str + ">");
|
173
|
+
}
|
174
|
+
};
|
175
|
+
|
176
|
+
template <typename T>
|
177
|
+
class TypeWithoutFormatter<T, kConvertibleToInteger> {
|
178
|
+
public:
|
179
|
+
// Since T has no << operator or PrintTo() but can be implicitly
|
180
|
+
// converted to BiggestInt, we print it as a BiggestInt.
|
181
|
+
//
|
182
|
+
// Most likely T is an enum type (either named or unnamed), in which
|
183
|
+
// case printing it as an integer is the desired behavior. In case
|
184
|
+
// T is not an enum, printing it as an integer is the best we can do
|
185
|
+
// given that it has no user-defined printer.
|
186
|
+
static void PrintValue(const T& value, ::std::ostream* os) {
|
187
|
+
const internal::BiggestInt kBigInt = value;
|
188
|
+
*os << kBigInt;
|
189
|
+
}
|
190
|
+
};
|
191
|
+
|
192
|
+
#if GTEST_HAS_ABSL
|
193
|
+
template <typename T>
|
194
|
+
class TypeWithoutFormatter<T, kConvertibleToStringView> {
|
195
|
+
public:
|
196
|
+
// Since T has neither operator<< nor PrintTo() but can be implicitly
|
197
|
+
// converted to absl::string_view, we print it as a absl::string_view.
|
198
|
+
//
|
199
|
+
// Note: the implementation is further below, as it depends on
|
200
|
+
// internal::PrintTo symbol which is defined later in the file.
|
201
|
+
static void PrintValue(const T& value, ::std::ostream* os);
|
202
|
+
};
|
203
|
+
#endif
|
204
|
+
|
205
|
+
// Prints the given value to the given ostream. If the value is a
|
206
|
+
// protocol message, its debug string is printed; if it's an enum or
|
207
|
+
// of a type implicitly convertible to BiggestInt, it's printed as an
|
208
|
+
// integer; otherwise the bytes in the value are printed. This is
|
209
|
+
// what UniversalPrinter<T>::Print() does when it knows nothing about
|
210
|
+
// type T and T has neither << operator nor PrintTo().
|
211
|
+
//
|
212
|
+
// A user can override this behavior for a class type Foo by defining
|
213
|
+
// a << operator in the namespace where Foo is defined.
|
214
|
+
//
|
215
|
+
// We put this operator in namespace 'internal2' instead of 'internal'
|
216
|
+
// to simplify the implementation, as much code in 'internal' needs to
|
217
|
+
// use << in STL, which would conflict with our own << were it defined
|
218
|
+
// in 'internal'.
|
219
|
+
//
|
220
|
+
// Note that this operator<< takes a generic std::basic_ostream<Char,
|
221
|
+
// CharTraits> type instead of the more restricted std::ostream. If
|
222
|
+
// we define it to take an std::ostream instead, we'll get an
|
223
|
+
// "ambiguous overloads" compiler error when trying to print a type
|
224
|
+
// Foo that supports streaming to std::basic_ostream<Char,
|
225
|
+
// CharTraits>, as the compiler cannot tell whether
|
226
|
+
// operator<<(std::ostream&, const T&) or
|
227
|
+
// operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
|
228
|
+
// specific.
|
229
|
+
template <typename Char, typename CharTraits, typename T>
|
230
|
+
::std::basic_ostream<Char, CharTraits>& operator<<(
|
231
|
+
::std::basic_ostream<Char, CharTraits>& os, const T& x) {
|
232
|
+
TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value
|
233
|
+
? kProtobuf
|
234
|
+
: internal::ImplicitlyConvertible<
|
235
|
+
const T&, internal::BiggestInt>::value
|
236
|
+
? kConvertibleToInteger
|
237
|
+
:
|
238
|
+
#if GTEST_HAS_ABSL
|
239
|
+
internal::ImplicitlyConvertible<
|
240
|
+
const T&, absl::string_view>::value
|
241
|
+
? kConvertibleToStringView
|
242
|
+
:
|
243
|
+
#endif
|
244
|
+
kOtherType)>::PrintValue(x, &os);
|
245
|
+
return os;
|
246
|
+
}
|
247
|
+
|
248
|
+
} // namespace internal2
|
249
|
+
} // namespace testing
|
250
|
+
|
251
|
+
// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
|
252
|
+
// magic needed for implementing UniversalPrinter won't work.
|
253
|
+
namespace testing_internal {
|
254
|
+
|
255
|
+
// Used to print a value that is not an STL-style container when the
|
256
|
+
// user doesn't define PrintTo() for it.
|
257
|
+
template <typename T>
|
258
|
+
void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
|
259
|
+
// With the following statement, during unqualified name lookup,
|
260
|
+
// testing::internal2::operator<< appears as if it was declared in
|
261
|
+
// the nearest enclosing namespace that contains both
|
262
|
+
// ::testing_internal and ::testing::internal2, i.e. the global
|
263
|
+
// namespace. For more details, refer to the C++ Standard section
|
264
|
+
// 7.3.4-1 [namespace.udir]. This allows us to fall back onto
|
265
|
+
// testing::internal2::operator<< in case T doesn't come with a <<
|
266
|
+
// operator.
|
267
|
+
//
|
268
|
+
// We cannot write 'using ::testing::internal2::operator<<;', which
|
269
|
+
// gcc 3.3 fails to compile due to a compiler bug.
|
270
|
+
using namespace ::testing::internal2; // NOLINT
|
271
|
+
|
272
|
+
// Assuming T is defined in namespace foo, in the next statement,
|
273
|
+
// the compiler will consider all of:
|
274
|
+
//
|
275
|
+
// 1. foo::operator<< (thanks to Koenig look-up),
|
276
|
+
// 2. ::operator<< (as the current namespace is enclosed in ::),
|
277
|
+
// 3. testing::internal2::operator<< (thanks to the using statement above).
|
278
|
+
//
|
279
|
+
// The operator<< whose type matches T best will be picked.
|
280
|
+
//
|
281
|
+
// We deliberately allow #2 to be a candidate, as sometimes it's
|
282
|
+
// impossible to define #1 (e.g. when foo is ::std, defining
|
283
|
+
// anything in it is undefined behavior unless you are a compiler
|
284
|
+
// vendor.).
|
285
|
+
*os << value;
|
286
|
+
}
|
287
|
+
|
288
|
+
} // namespace testing_internal
|
289
|
+
|
290
|
+
namespace testing {
|
291
|
+
namespace internal {
|
292
|
+
|
293
|
+
// FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
|
294
|
+
// value of type ToPrint that is an operand of a comparison assertion
|
295
|
+
// (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in
|
296
|
+
// the comparison, and is used to help determine the best way to
|
297
|
+
// format the value. In particular, when the value is a C string
|
298
|
+
// (char pointer) and the other operand is an STL string object, we
|
299
|
+
// want to format the C string as a string, since we know it is
|
300
|
+
// compared by value with the string object. If the value is a char
|
301
|
+
// pointer but the other operand is not an STL string object, we don't
|
302
|
+
// know whether the pointer is supposed to point to a NUL-terminated
|
303
|
+
// string, and thus want to print it as a pointer to be safe.
|
304
|
+
//
|
305
|
+
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
|
306
|
+
|
307
|
+
// The default case.
|
308
|
+
template <typename ToPrint, typename OtherOperand>
|
309
|
+
class FormatForComparison {
|
310
|
+
public:
|
311
|
+
static ::std::string Format(const ToPrint& value) {
|
312
|
+
return ::testing::PrintToString(value);
|
313
|
+
}
|
314
|
+
};
|
315
|
+
|
316
|
+
// Array.
|
317
|
+
template <typename ToPrint, size_t N, typename OtherOperand>
|
318
|
+
class FormatForComparison<ToPrint[N], OtherOperand> {
|
319
|
+
public:
|
320
|
+
static ::std::string Format(const ToPrint* value) {
|
321
|
+
return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
|
322
|
+
}
|
323
|
+
};
|
324
|
+
|
325
|
+
// By default, print C string as pointers to be safe, as we don't know
|
326
|
+
// whether they actually point to a NUL-terminated string.
|
327
|
+
|
328
|
+
#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \
|
329
|
+
template <typename OtherOperand> \
|
330
|
+
class FormatForComparison<CharType*, OtherOperand> { \
|
331
|
+
public: \
|
332
|
+
static ::std::string Format(CharType* value) { \
|
333
|
+
return ::testing::PrintToString(static_cast<const void*>(value)); \
|
334
|
+
} \
|
335
|
+
}
|
336
|
+
|
337
|
+
GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
|
338
|
+
GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
|
339
|
+
GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
|
340
|
+
GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
|
341
|
+
|
342
|
+
#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
|
343
|
+
|
344
|
+
// If a C string is compared with an STL string object, we know it's meant
|
345
|
+
// to point to a NUL-terminated string, and thus can print it as a string.
|
346
|
+
|
347
|
+
#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
|
348
|
+
template <> \
|
349
|
+
class FormatForComparison<CharType*, OtherStringType> { \
|
350
|
+
public: \
|
351
|
+
static ::std::string Format(CharType* value) { \
|
352
|
+
return ::testing::PrintToString(value); \
|
353
|
+
} \
|
354
|
+
}
|
355
|
+
|
356
|
+
GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
|
357
|
+
GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
|
358
|
+
|
359
|
+
#if GTEST_HAS_GLOBAL_STRING
|
360
|
+
GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
|
361
|
+
GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
|
362
|
+
#endif
|
363
|
+
|
364
|
+
#if GTEST_HAS_GLOBAL_WSTRING
|
365
|
+
GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
|
366
|
+
GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
|
367
|
+
#endif
|
368
|
+
|
369
|
+
#if GTEST_HAS_STD_WSTRING
|
370
|
+
GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
|
371
|
+
GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
|
372
|
+
#endif
|
373
|
+
|
374
|
+
#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
|
375
|
+
|
376
|
+
// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
|
377
|
+
// operand to be used in a failure message. The type (but not value)
|
378
|
+
// of the other operand may affect the format. This allows us to
|
379
|
+
// print a char* as a raw pointer when it is compared against another
|
380
|
+
// char* or void*, and print it as a C string when it is compared
|
381
|
+
// against an std::string object, for example.
|
382
|
+
//
|
383
|
+
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
|
384
|
+
template <typename T1, typename T2>
|
385
|
+
std::string FormatForComparisonFailureMessage(
|
386
|
+
const T1& value, const T2& /* other_operand */) {
|
387
|
+
return FormatForComparison<T1, T2>::Format(value);
|
388
|
+
}
|
389
|
+
|
390
|
+
// UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
|
391
|
+
// value to the given ostream. The caller must ensure that
|
392
|
+
// 'ostream_ptr' is not NULL, or the behavior is undefined.
|
393
|
+
//
|
394
|
+
// We define UniversalPrinter as a class template (as opposed to a
|
395
|
+
// function template), as we need to partially specialize it for
|
396
|
+
// reference types, which cannot be done with function templates.
|
397
|
+
template <typename T>
|
398
|
+
class UniversalPrinter;
|
399
|
+
|
400
|
+
template <typename T>
|
401
|
+
void UniversalPrint(const T& value, ::std::ostream* os);
|
402
|
+
|
403
|
+
enum DefaultPrinterType {
|
404
|
+
kPrintContainer,
|
405
|
+
kPrintPointer,
|
406
|
+
kPrintFunctionPointer,
|
407
|
+
kPrintOther,
|
408
|
+
};
|
409
|
+
template <DefaultPrinterType type> struct WrapPrinterType {};
|
410
|
+
|
411
|
+
// Used to print an STL-style container when the user doesn't define
|
412
|
+
// a PrintTo() for it.
|
413
|
+
template <typename C>
|
414
|
+
void DefaultPrintTo(WrapPrinterType<kPrintContainer> /* dummy */,
|
415
|
+
const C& container, ::std::ostream* os) {
|
416
|
+
const size_t kMaxCount = 32; // The maximum number of elements to print.
|
417
|
+
*os << '{';
|
418
|
+
size_t count = 0;
|
419
|
+
for (typename C::const_iterator it = container.begin();
|
420
|
+
it != container.end(); ++it, ++count) {
|
421
|
+
if (count > 0) {
|
422
|
+
*os << ',';
|
423
|
+
if (count == kMaxCount) { // Enough has been printed.
|
424
|
+
*os << " ...";
|
425
|
+
break;
|
426
|
+
}
|
427
|
+
}
|
428
|
+
*os << ' ';
|
429
|
+
// We cannot call PrintTo(*it, os) here as PrintTo() doesn't
|
430
|
+
// handle *it being a native array.
|
431
|
+
internal::UniversalPrint(*it, os);
|
432
|
+
}
|
433
|
+
|
434
|
+
if (count > 0) {
|
435
|
+
*os << ' ';
|
436
|
+
}
|
437
|
+
*os << '}';
|
438
|
+
}
|
439
|
+
|
440
|
+
// Used to print a pointer that is neither a char pointer nor a member
|
441
|
+
// pointer, when the user doesn't define PrintTo() for it. (A member
|
442
|
+
// variable pointer or member function pointer doesn't really point to
|
443
|
+
// a location in the address space. Their representation is
|
444
|
+
// implementation-defined. Therefore they will be printed as raw
|
445
|
+
// bytes.)
|
446
|
+
template <typename T>
|
447
|
+
void DefaultPrintTo(WrapPrinterType<kPrintPointer> /* dummy */,
|
448
|
+
T* p, ::std::ostream* os) {
|
449
|
+
if (p == NULL) {
|
450
|
+
*os << "NULL";
|
451
|
+
} else {
|
452
|
+
// T is not a function type. We just call << to print p,
|
453
|
+
// relying on ADL to pick up user-defined << for their pointer
|
454
|
+
// types, if any.
|
455
|
+
*os << p;
|
456
|
+
}
|
457
|
+
}
|
458
|
+
template <typename T>
|
459
|
+
void DefaultPrintTo(WrapPrinterType<kPrintFunctionPointer> /* dummy */,
|
460
|
+
T* p, ::std::ostream* os) {
|
461
|
+
if (p == NULL) {
|
462
|
+
*os << "NULL";
|
463
|
+
} else {
|
464
|
+
// T is a function type, so '*os << p' doesn't do what we want
|
465
|
+
// (it just prints p as bool). We want to print p as a const
|
466
|
+
// void*.
|
467
|
+
*os << reinterpret_cast<const void*>(p);
|
468
|
+
}
|
469
|
+
}
|
470
|
+
|
471
|
+
// Used to print a non-container, non-pointer value when the user
|
472
|
+
// doesn't define PrintTo() for it.
|
473
|
+
template <typename T>
|
474
|
+
void DefaultPrintTo(WrapPrinterType<kPrintOther> /* dummy */,
|
475
|
+
const T& value, ::std::ostream* os) {
|
476
|
+
::testing_internal::DefaultPrintNonContainerTo(value, os);
|
477
|
+
}
|
478
|
+
|
479
|
+
// Prints the given value using the << operator if it has one;
|
480
|
+
// otherwise prints the bytes in it. This is what
|
481
|
+
// UniversalPrinter<T>::Print() does when PrintTo() is not specialized
|
482
|
+
// or overloaded for type T.
|
483
|
+
//
|
484
|
+
// A user can override this behavior for a class type Foo by defining
|
485
|
+
// an overload of PrintTo() in the namespace where Foo is defined. We
|
486
|
+
// give the user this option as sometimes defining a << operator for
|
487
|
+
// Foo is not desirable (e.g. the coding style may prevent doing it,
|
488
|
+
// or there is already a << operator but it doesn't do what the user
|
489
|
+
// wants).
|
490
|
+
template <typename T>
|
491
|
+
void PrintTo(const T& value, ::std::ostream* os) {
|
492
|
+
// DefaultPrintTo() is overloaded. The type of its first argument
|
493
|
+
// determines which version will be picked.
|
494
|
+
//
|
495
|
+
// Note that we check for container types here, prior to we check
|
496
|
+
// for protocol message types in our operator<<. The rationale is:
|
497
|
+
//
|
498
|
+
// For protocol messages, we want to give people a chance to
|
499
|
+
// override Google Mock's format by defining a PrintTo() or
|
500
|
+
// operator<<. For STL containers, other formats can be
|
501
|
+
// incompatible with Google Mock's format for the container
|
502
|
+
// elements; therefore we check for container types here to ensure
|
503
|
+
// that our format is used.
|
504
|
+
//
|
505
|
+
// Note that MSVC and clang-cl do allow an implicit conversion from
|
506
|
+
// pointer-to-function to pointer-to-object, but clang-cl warns on it.
|
507
|
+
// So don't use ImplicitlyConvertible if it can be helped since it will
|
508
|
+
// cause this warning, and use a separate overload of DefaultPrintTo for
|
509
|
+
// function pointers so that the `*os << p` in the object pointer overload
|
510
|
+
// doesn't cause that warning either.
|
511
|
+
DefaultPrintTo(
|
512
|
+
WrapPrinterType <
|
513
|
+
(sizeof(IsContainerTest<T>(0)) == sizeof(IsContainer)) &&
|
514
|
+
!IsRecursiveContainer<T>::value
|
515
|
+
? kPrintContainer
|
516
|
+
: !is_pointer<T>::value
|
517
|
+
? kPrintOther
|
518
|
+
#if GTEST_LANG_CXX11
|
519
|
+
: std::is_function<typename std::remove_pointer<T>::type>::value
|
520
|
+
#else
|
521
|
+
: !internal::ImplicitlyConvertible<T, const void*>::value
|
522
|
+
#endif
|
523
|
+
? kPrintFunctionPointer
|
524
|
+
: kPrintPointer > (),
|
525
|
+
value, os);
|
526
|
+
}
|
527
|
+
|
528
|
+
// The following list of PrintTo() overloads tells
|
529
|
+
// UniversalPrinter<T>::Print() how to print standard types (built-in
|
530
|
+
// types, strings, plain arrays, and pointers).
|
531
|
+
|
532
|
+
// Overloads for various char types.
|
533
|
+
GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
|
534
|
+
GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
|
535
|
+
inline void PrintTo(char c, ::std::ostream* os) {
|
536
|
+
// When printing a plain char, we always treat it as unsigned. This
|
537
|
+
// way, the output won't be affected by whether the compiler thinks
|
538
|
+
// char is signed or not.
|
539
|
+
PrintTo(static_cast<unsigned char>(c), os);
|
540
|
+
}
|
541
|
+
|
542
|
+
// Overloads for other simple built-in types.
|
543
|
+
inline void PrintTo(bool x, ::std::ostream* os) {
|
544
|
+
*os << (x ? "true" : "false");
|
545
|
+
}
|
546
|
+
|
547
|
+
// Overload for wchar_t type.
|
548
|
+
// Prints a wchar_t as a symbol if it is printable or as its internal
|
549
|
+
// code otherwise and also as its decimal code (except for L'\0').
|
550
|
+
// The L'\0' char is printed as "L'\\0'". The decimal code is printed
|
551
|
+
// as signed integer when wchar_t is implemented by the compiler
|
552
|
+
// as a signed type and is printed as an unsigned integer when wchar_t
|
553
|
+
// is implemented as an unsigned type.
|
554
|
+
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
|
555
|
+
|
556
|
+
// Overloads for C strings.
|
557
|
+
GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
|
558
|
+
inline void PrintTo(char* s, ::std::ostream* os) {
|
559
|
+
PrintTo(ImplicitCast_<const char*>(s), os);
|
560
|
+
}
|
561
|
+
|
562
|
+
// signed/unsigned char is often used for representing binary data, so
|
563
|
+
// we print pointers to it as void* to be safe.
|
564
|
+
inline void PrintTo(const signed char* s, ::std::ostream* os) {
|
565
|
+
PrintTo(ImplicitCast_<const void*>(s), os);
|
566
|
+
}
|
567
|
+
inline void PrintTo(signed char* s, ::std::ostream* os) {
|
568
|
+
PrintTo(ImplicitCast_<const void*>(s), os);
|
569
|
+
}
|
570
|
+
inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
|
571
|
+
PrintTo(ImplicitCast_<const void*>(s), os);
|
572
|
+
}
|
573
|
+
inline void PrintTo(unsigned char* s, ::std::ostream* os) {
|
574
|
+
PrintTo(ImplicitCast_<const void*>(s), os);
|
575
|
+
}
|
576
|
+
|
577
|
+
// MSVC can be configured to define wchar_t as a typedef of unsigned
|
578
|
+
// short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
|
579
|
+
// type. When wchar_t is a typedef, defining an overload for const
|
580
|
+
// wchar_t* would cause unsigned short* be printed as a wide string,
|
581
|
+
// possibly causing invalid memory accesses.
|
582
|
+
#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
|
583
|
+
// Overloads for wide C strings
|
584
|
+
GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
|
585
|
+
inline void PrintTo(wchar_t* s, ::std::ostream* os) {
|
586
|
+
PrintTo(ImplicitCast_<const wchar_t*>(s), os);
|
587
|
+
}
|
588
|
+
#endif
|
589
|
+
|
590
|
+
// Overload for C arrays. Multi-dimensional arrays are printed
|
591
|
+
// properly.
|
592
|
+
|
593
|
+
// Prints the given number of elements in an array, without printing
|
594
|
+
// the curly braces.
|
595
|
+
template <typename T>
|
596
|
+
void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
|
597
|
+
UniversalPrint(a[0], os);
|
598
|
+
for (size_t i = 1; i != count; i++) {
|
599
|
+
*os << ", ";
|
600
|
+
UniversalPrint(a[i], os);
|
601
|
+
}
|
602
|
+
}
|
603
|
+
|
604
|
+
// Overloads for ::string and ::std::string.
|
605
|
+
#if GTEST_HAS_GLOBAL_STRING
|
606
|
+
GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
|
607
|
+
inline void PrintTo(const ::string& s, ::std::ostream* os) {
|
608
|
+
PrintStringTo(s, os);
|
609
|
+
}
|
610
|
+
#endif // GTEST_HAS_GLOBAL_STRING
|
611
|
+
|
612
|
+
GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
|
613
|
+
inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
|
614
|
+
PrintStringTo(s, os);
|
615
|
+
}
|
616
|
+
|
617
|
+
// Overloads for ::wstring and ::std::wstring.
|
618
|
+
#if GTEST_HAS_GLOBAL_WSTRING
|
619
|
+
GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
|
620
|
+
inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
|
621
|
+
PrintWideStringTo(s, os);
|
622
|
+
}
|
623
|
+
#endif // GTEST_HAS_GLOBAL_WSTRING
|
624
|
+
|
625
|
+
#if GTEST_HAS_STD_WSTRING
|
626
|
+
GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
|
627
|
+
inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
|
628
|
+
PrintWideStringTo(s, os);
|
629
|
+
}
|
630
|
+
#endif // GTEST_HAS_STD_WSTRING
|
631
|
+
|
632
|
+
#if GTEST_HAS_ABSL
|
633
|
+
// Overload for absl::string_view.
|
634
|
+
inline void PrintTo(absl::string_view sp, ::std::ostream* os) {
|
635
|
+
PrintTo(::std::string(sp), os);
|
636
|
+
}
|
637
|
+
#endif // GTEST_HAS_ABSL
|
638
|
+
|
639
|
+
#if GTEST_LANG_CXX11
|
640
|
+
inline void PrintTo(std::nullptr_t, ::std::ostream* os) { *os << "(nullptr)"; }
|
641
|
+
#endif // GTEST_LANG_CXX11
|
642
|
+
|
643
|
+
#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
|
644
|
+
// Helper function for printing a tuple. T must be instantiated with
|
645
|
+
// a tuple type.
|
646
|
+
template <typename T>
|
647
|
+
void PrintTupleTo(const T& t, ::std::ostream* os);
|
648
|
+
#endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
|
649
|
+
|
650
|
+
#if GTEST_HAS_TR1_TUPLE
|
651
|
+
// Overload for ::std::tr1::tuple. Needed for printing function arguments,
|
652
|
+
// which are packed as tuples.
|
653
|
+
|
654
|
+
// Overloaded PrintTo() for tuples of various arities. We support
|
655
|
+
// tuples of up-to 10 fields. The following implementation works
|
656
|
+
// regardless of whether tr1::tuple is implemented using the
|
657
|
+
// non-standard variadic template feature or not.
|
658
|
+
|
659
|
+
inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
|
660
|
+
PrintTupleTo(t, os);
|
661
|
+
}
|
662
|
+
|
663
|
+
template <typename T1>
|
664
|
+
void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
|
665
|
+
PrintTupleTo(t, os);
|
666
|
+
}
|
667
|
+
|
668
|
+
template <typename T1, typename T2>
|
669
|
+
void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
|
670
|
+
PrintTupleTo(t, os);
|
671
|
+
}
|
672
|
+
|
673
|
+
template <typename T1, typename T2, typename T3>
|
674
|
+
void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
|
675
|
+
PrintTupleTo(t, os);
|
676
|
+
}
|
677
|
+
|
678
|
+
template <typename T1, typename T2, typename T3, typename T4>
|
679
|
+
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
|
680
|
+
PrintTupleTo(t, os);
|
681
|
+
}
|
682
|
+
|
683
|
+
template <typename T1, typename T2, typename T3, typename T4, typename T5>
|
684
|
+
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
|
685
|
+
::std::ostream* os) {
|
686
|
+
PrintTupleTo(t, os);
|
687
|
+
}
|
688
|
+
|
689
|
+
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
690
|
+
typename T6>
|
691
|
+
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
|
692
|
+
::std::ostream* os) {
|
693
|
+
PrintTupleTo(t, os);
|
694
|
+
}
|
695
|
+
|
696
|
+
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
697
|
+
typename T6, typename T7>
|
698
|
+
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
|
699
|
+
::std::ostream* os) {
|
700
|
+
PrintTupleTo(t, os);
|
701
|
+
}
|
702
|
+
|
703
|
+
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
704
|
+
typename T6, typename T7, typename T8>
|
705
|
+
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
|
706
|
+
::std::ostream* os) {
|
707
|
+
PrintTupleTo(t, os);
|
708
|
+
}
|
709
|
+
|
710
|
+
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
711
|
+
typename T6, typename T7, typename T8, typename T9>
|
712
|
+
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
|
713
|
+
::std::ostream* os) {
|
714
|
+
PrintTupleTo(t, os);
|
715
|
+
}
|
716
|
+
|
717
|
+
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
718
|
+
typename T6, typename T7, typename T8, typename T9, typename T10>
|
719
|
+
void PrintTo(
|
720
|
+
const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
|
721
|
+
::std::ostream* os) {
|
722
|
+
PrintTupleTo(t, os);
|
723
|
+
}
|
724
|
+
#endif // GTEST_HAS_TR1_TUPLE
|
725
|
+
|
726
|
+
#if GTEST_HAS_STD_TUPLE_
|
727
|
+
template <typename... Types>
|
728
|
+
void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
|
729
|
+
PrintTupleTo(t, os);
|
730
|
+
}
|
731
|
+
#endif // GTEST_HAS_STD_TUPLE_
|
732
|
+
|
733
|
+
// Overload for std::pair.
|
734
|
+
template <typename T1, typename T2>
|
735
|
+
void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
|
736
|
+
*os << '(';
|
737
|
+
// We cannot use UniversalPrint(value.first, os) here, as T1 may be
|
738
|
+
// a reference type. The same for printing value.second.
|
739
|
+
UniversalPrinter<T1>::Print(value.first, os);
|
740
|
+
*os << ", ";
|
741
|
+
UniversalPrinter<T2>::Print(value.second, os);
|
742
|
+
*os << ')';
|
743
|
+
}
|
744
|
+
|
745
|
+
// Implements printing a non-reference type T by letting the compiler
|
746
|
+
// pick the right overload of PrintTo() for T.
|
747
|
+
template <typename T>
|
748
|
+
class UniversalPrinter {
|
749
|
+
public:
|
750
|
+
// MSVC warns about adding const to a function type, so we want to
|
751
|
+
// disable the warning.
|
752
|
+
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
|
753
|
+
|
754
|
+
// Note: we deliberately don't call this PrintTo(), as that name
|
755
|
+
// conflicts with ::testing::internal::PrintTo in the body of the
|
756
|
+
// function.
|
757
|
+
static void Print(const T& value, ::std::ostream* os) {
|
758
|
+
// By default, ::testing::internal::PrintTo() is used for printing
|
759
|
+
// the value.
|
760
|
+
//
|
761
|
+
// Thanks to Koenig look-up, if T is a class and has its own
|
762
|
+
// PrintTo() function defined in its namespace, that function will
|
763
|
+
// be visible here. Since it is more specific than the generic ones
|
764
|
+
// in ::testing::internal, it will be picked by the compiler in the
|
765
|
+
// following statement - exactly what we want.
|
766
|
+
PrintTo(value, os);
|
767
|
+
}
|
768
|
+
|
769
|
+
GTEST_DISABLE_MSC_WARNINGS_POP_()
|
770
|
+
};
|
771
|
+
|
772
|
+
#if GTEST_HAS_ABSL
|
773
|
+
|
774
|
+
// Printer for absl::optional
|
775
|
+
|
776
|
+
template <typename T>
|
777
|
+
class UniversalPrinter<::absl::optional<T>> {
|
778
|
+
public:
|
779
|
+
static void Print(const ::absl::optional<T>& value, ::std::ostream* os) {
|
780
|
+
*os << '(';
|
781
|
+
if (!value) {
|
782
|
+
*os << "nullopt";
|
783
|
+
} else {
|
784
|
+
UniversalPrint(*value, os);
|
785
|
+
}
|
786
|
+
*os << ')';
|
787
|
+
}
|
788
|
+
};
|
789
|
+
|
790
|
+
#endif // GTEST_HAS_ABSL
|
791
|
+
|
792
|
+
// UniversalPrintArray(begin, len, os) prints an array of 'len'
|
793
|
+
// elements, starting at address 'begin'.
|
794
|
+
template <typename T>
|
795
|
+
void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
|
796
|
+
if (len == 0) {
|
797
|
+
*os << "{}";
|
798
|
+
} else {
|
799
|
+
*os << "{ ";
|
800
|
+
const size_t kThreshold = 18;
|
801
|
+
const size_t kChunkSize = 8;
|
802
|
+
// If the array has more than kThreshold elements, we'll have to
|
803
|
+
// omit some details by printing only the first and the last
|
804
|
+
// kChunkSize elements.
|
805
|
+
// TODO(wan@google.com): let the user control the threshold using a flag.
|
806
|
+
if (len <= kThreshold) {
|
807
|
+
PrintRawArrayTo(begin, len, os);
|
808
|
+
} else {
|
809
|
+
PrintRawArrayTo(begin, kChunkSize, os);
|
810
|
+
*os << ", ..., ";
|
811
|
+
PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
|
812
|
+
}
|
813
|
+
*os << " }";
|
814
|
+
}
|
815
|
+
}
|
816
|
+
// This overload prints a (const) char array compactly.
|
817
|
+
GTEST_API_ void UniversalPrintArray(
|
818
|
+
const char* begin, size_t len, ::std::ostream* os);
|
819
|
+
|
820
|
+
// This overload prints a (const) wchar_t array compactly.
|
821
|
+
GTEST_API_ void UniversalPrintArray(
|
822
|
+
const wchar_t* begin, size_t len, ::std::ostream* os);
|
823
|
+
|
824
|
+
// Implements printing an array type T[N].
|
825
|
+
template <typename T, size_t N>
|
826
|
+
class UniversalPrinter<T[N]> {
|
827
|
+
public:
|
828
|
+
// Prints the given array, omitting some elements when there are too
|
829
|
+
// many.
|
830
|
+
static void Print(const T (&a)[N], ::std::ostream* os) {
|
831
|
+
UniversalPrintArray(a, N, os);
|
832
|
+
}
|
833
|
+
};
|
834
|
+
|
835
|
+
// Implements printing a reference type T&.
|
836
|
+
template <typename T>
|
837
|
+
class UniversalPrinter<T&> {
|
838
|
+
public:
|
839
|
+
// MSVC warns about adding const to a function type, so we want to
|
840
|
+
// disable the warning.
|
841
|
+
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
|
842
|
+
|
843
|
+
static void Print(const T& value, ::std::ostream* os) {
|
844
|
+
// Prints the address of the value. We use reinterpret_cast here
|
845
|
+
// as static_cast doesn't compile when T is a function type.
|
846
|
+
*os << "@" << reinterpret_cast<const void*>(&value) << " ";
|
847
|
+
|
848
|
+
// Then prints the value itself.
|
849
|
+
UniversalPrint(value, os);
|
850
|
+
}
|
851
|
+
|
852
|
+
GTEST_DISABLE_MSC_WARNINGS_POP_()
|
853
|
+
};
|
854
|
+
|
855
|
+
// Prints a value tersely: for a reference type, the referenced value
|
856
|
+
// (but not the address) is printed; for a (const) char pointer, the
|
857
|
+
// NUL-terminated string (but not the pointer) is printed.
|
858
|
+
|
859
|
+
template <typename T>
|
860
|
+
class UniversalTersePrinter {
|
861
|
+
public:
|
862
|
+
static void Print(const T& value, ::std::ostream* os) {
|
863
|
+
UniversalPrint(value, os);
|
864
|
+
}
|
865
|
+
};
|
866
|
+
template <typename T>
|
867
|
+
class UniversalTersePrinter<T&> {
|
868
|
+
public:
|
869
|
+
static void Print(const T& value, ::std::ostream* os) {
|
870
|
+
UniversalPrint(value, os);
|
871
|
+
}
|
872
|
+
};
|
873
|
+
template <typename T, size_t N>
|
874
|
+
class UniversalTersePrinter<T[N]> {
|
875
|
+
public:
|
876
|
+
static void Print(const T (&value)[N], ::std::ostream* os) {
|
877
|
+
UniversalPrinter<T[N]>::Print(value, os);
|
878
|
+
}
|
879
|
+
};
|
880
|
+
template <>
|
881
|
+
class UniversalTersePrinter<const char*> {
|
882
|
+
public:
|
883
|
+
static void Print(const char* str, ::std::ostream* os) {
|
884
|
+
if (str == NULL) {
|
885
|
+
*os << "NULL";
|
886
|
+
} else {
|
887
|
+
UniversalPrint(std::string(str), os);
|
888
|
+
}
|
889
|
+
}
|
890
|
+
};
|
891
|
+
template <>
|
892
|
+
class UniversalTersePrinter<char*> {
|
893
|
+
public:
|
894
|
+
static void Print(char* str, ::std::ostream* os) {
|
895
|
+
UniversalTersePrinter<const char*>::Print(str, os);
|
896
|
+
}
|
897
|
+
};
|
898
|
+
|
899
|
+
#if GTEST_HAS_STD_WSTRING
|
900
|
+
template <>
|
901
|
+
class UniversalTersePrinter<const wchar_t*> {
|
902
|
+
public:
|
903
|
+
static void Print(const wchar_t* str, ::std::ostream* os) {
|
904
|
+
if (str == NULL) {
|
905
|
+
*os << "NULL";
|
906
|
+
} else {
|
907
|
+
UniversalPrint(::std::wstring(str), os);
|
908
|
+
}
|
909
|
+
}
|
910
|
+
};
|
911
|
+
#endif
|
912
|
+
|
913
|
+
template <>
|
914
|
+
class UniversalTersePrinter<wchar_t*> {
|
915
|
+
public:
|
916
|
+
static void Print(wchar_t* str, ::std::ostream* os) {
|
917
|
+
UniversalTersePrinter<const wchar_t*>::Print(str, os);
|
918
|
+
}
|
919
|
+
};
|
920
|
+
|
921
|
+
template <typename T>
|
922
|
+
void UniversalTersePrint(const T& value, ::std::ostream* os) {
|
923
|
+
UniversalTersePrinter<T>::Print(value, os);
|
924
|
+
}
|
925
|
+
|
926
|
+
// Prints a value using the type inferred by the compiler. The
|
927
|
+
// difference between this and UniversalTersePrint() is that for a
|
928
|
+
// (const) char pointer, this prints both the pointer and the
|
929
|
+
// NUL-terminated string.
|
930
|
+
template <typename T>
|
931
|
+
void UniversalPrint(const T& value, ::std::ostream* os) {
|
932
|
+
// A workarond for the bug in VC++ 7.1 that prevents us from instantiating
|
933
|
+
// UniversalPrinter with T directly.
|
934
|
+
typedef T T1;
|
935
|
+
UniversalPrinter<T1>::Print(value, os);
|
936
|
+
}
|
937
|
+
|
938
|
+
typedef ::std::vector< ::std::string> Strings;
|
939
|
+
|
940
|
+
// TuplePolicy<TupleT> must provide:
|
941
|
+
// - tuple_size
|
942
|
+
// size of tuple TupleT.
|
943
|
+
// - get<size_t I>(const TupleT& t)
|
944
|
+
// static function extracting element I of tuple TupleT.
|
945
|
+
// - tuple_element<size_t I>::type
|
946
|
+
// type of element I of tuple TupleT.
|
947
|
+
template <typename TupleT>
|
948
|
+
struct TuplePolicy;
|
949
|
+
|
950
|
+
#if GTEST_HAS_TR1_TUPLE
|
951
|
+
template <typename TupleT>
|
952
|
+
struct TuplePolicy {
|
953
|
+
typedef TupleT Tuple;
|
954
|
+
static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;
|
955
|
+
|
956
|
+
template <size_t I>
|
957
|
+
struct tuple_element : ::std::tr1::tuple_element<I, Tuple> {};
|
958
|
+
|
959
|
+
template <size_t I>
|
960
|
+
static typename AddReference<
|
961
|
+
const typename ::std::tr1::tuple_element<I, Tuple>::type>::type get(
|
962
|
+
const Tuple& tuple) {
|
963
|
+
return ::std::tr1::get<I>(tuple);
|
964
|
+
}
|
965
|
+
};
|
966
|
+
template <typename TupleT>
|
967
|
+
const size_t TuplePolicy<TupleT>::tuple_size;
|
968
|
+
#endif // GTEST_HAS_TR1_TUPLE
|
969
|
+
|
970
|
+
#if GTEST_HAS_STD_TUPLE_
|
971
|
+
template <typename... Types>
|
972
|
+
struct TuplePolicy< ::std::tuple<Types...> > {
|
973
|
+
typedef ::std::tuple<Types...> Tuple;
|
974
|
+
static const size_t tuple_size = ::std::tuple_size<Tuple>::value;
|
975
|
+
|
976
|
+
template <size_t I>
|
977
|
+
struct tuple_element : ::std::tuple_element<I, Tuple> {};
|
978
|
+
|
979
|
+
template <size_t I>
|
980
|
+
static const typename ::std::tuple_element<I, Tuple>::type& get(
|
981
|
+
const Tuple& tuple) {
|
982
|
+
return ::std::get<I>(tuple);
|
983
|
+
}
|
984
|
+
};
|
985
|
+
template <typename... Types>
|
986
|
+
const size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;
|
987
|
+
#endif // GTEST_HAS_STD_TUPLE_
|
988
|
+
|
989
|
+
#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
|
990
|
+
// This helper template allows PrintTo() for tuples and
|
991
|
+
// UniversalTersePrintTupleFieldsToStrings() to be defined by
|
992
|
+
// induction on the number of tuple fields. The idea is that
|
993
|
+
// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
|
994
|
+
// fields in tuple t, and can be defined in terms of
|
995
|
+
// TuplePrefixPrinter<N - 1>.
|
996
|
+
//
|
997
|
+
// The inductive case.
|
998
|
+
template <size_t N>
|
999
|
+
struct TuplePrefixPrinter {
|
1000
|
+
// Prints the first N fields of a tuple.
|
1001
|
+
template <typename Tuple>
|
1002
|
+
static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
|
1003
|
+
TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
|
1004
|
+
GTEST_INTENTIONAL_CONST_COND_PUSH_()
|
1005
|
+
if (N > 1) {
|
1006
|
+
GTEST_INTENTIONAL_CONST_COND_POP_()
|
1007
|
+
*os << ", ";
|
1008
|
+
}
|
1009
|
+
UniversalPrinter<
|
1010
|
+
typename TuplePolicy<Tuple>::template tuple_element<N - 1>::type>
|
1011
|
+
::Print(TuplePolicy<Tuple>::template get<N - 1>(t), os);
|
1012
|
+
}
|
1013
|
+
|
1014
|
+
// Tersely prints the first N fields of a tuple to a string vector,
|
1015
|
+
// one element for each field.
|
1016
|
+
template <typename Tuple>
|
1017
|
+
static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
|
1018
|
+
TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
|
1019
|
+
::std::stringstream ss;
|
1020
|
+
UniversalTersePrint(TuplePolicy<Tuple>::template get<N - 1>(t), &ss);
|
1021
|
+
strings->push_back(ss.str());
|
1022
|
+
}
|
1023
|
+
};
|
1024
|
+
|
1025
|
+
// Base case.
|
1026
|
+
template <>
|
1027
|
+
struct TuplePrefixPrinter<0> {
|
1028
|
+
template <typename Tuple>
|
1029
|
+
static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
|
1030
|
+
|
1031
|
+
template <typename Tuple>
|
1032
|
+
static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
|
1033
|
+
};
|
1034
|
+
|
1035
|
+
// Helper function for printing a tuple.
|
1036
|
+
// Tuple must be either std::tr1::tuple or std::tuple type.
|
1037
|
+
template <typename Tuple>
|
1038
|
+
void PrintTupleTo(const Tuple& t, ::std::ostream* os) {
|
1039
|
+
*os << "(";
|
1040
|
+
TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::PrintPrefixTo(t, os);
|
1041
|
+
*os << ")";
|
1042
|
+
}
|
1043
|
+
|
1044
|
+
// Prints the fields of a tuple tersely to a string vector, one
|
1045
|
+
// element for each field. See the comment before
|
1046
|
+
// UniversalTersePrint() for how we define "tersely".
|
1047
|
+
template <typename Tuple>
|
1048
|
+
Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
|
1049
|
+
Strings result;
|
1050
|
+
TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::
|
1051
|
+
TersePrintPrefixToStrings(value, &result);
|
1052
|
+
return result;
|
1053
|
+
}
|
1054
|
+
#endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
|
1055
|
+
|
1056
|
+
} // namespace internal
|
1057
|
+
|
1058
|
+
#if GTEST_HAS_ABSL
|
1059
|
+
namespace internal2 {
|
1060
|
+
template <typename T>
|
1061
|
+
void TypeWithoutFormatter<T, kConvertibleToStringView>::PrintValue(
|
1062
|
+
const T& value, ::std::ostream* os) {
|
1063
|
+
internal::PrintTo(absl::string_view(value), os);
|
1064
|
+
}
|
1065
|
+
} // namespace internal2
|
1066
|
+
#endif
|
1067
|
+
|
1068
|
+
template <typename T>
|
1069
|
+
::std::string PrintToString(const T& value) {
|
1070
|
+
::std::stringstream ss;
|
1071
|
+
internal::UniversalTersePrinter<T>::Print(value, &ss);
|
1072
|
+
return ss.str();
|
1073
|
+
}
|
1074
|
+
|
1075
|
+
} // namespace testing
|
1076
|
+
|
1077
|
+
// Include any custom printer added by the local installation.
|
1078
|
+
// We must include this header at the end to make sure it can use the
|
1079
|
+
// declarations from this file.
|
1080
|
+
#include "gtest/internal/custom/gtest-printers.h"
|
1081
|
+
|
1082
|
+
#endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
|