rj_schema 0.2.4 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rj_schema/rapidjson/CHANGELOG.md +158 -0
- data/ext/rj_schema/rapidjson/CMakeLists.txt +248 -0
- data/ext/rj_schema/rapidjson/CMakeModules/FindGTestSrc.cmake +30 -0
- data/ext/rj_schema/rapidjson/RapidJSON.pc.in +7 -0
- data/ext/rj_schema/rapidjson/RapidJSONConfig.cmake.in +25 -0
- data/ext/rj_schema/rapidjson/RapidJSONConfigVersion.cmake.in +10 -0
- data/ext/rj_schema/rapidjson/appveyor.yml +102 -0
- data/ext/rj_schema/rapidjson/bin/data/abcde.txt +1 -0
- data/ext/rj_schema/rapidjson/bin/data/glossary.json +22 -0
- data/ext/rj_schema/rapidjson/bin/data/menu.json +27 -0
- data/ext/rj_schema/rapidjson/bin/data/readme.txt +1 -0
- data/ext/rj_schema/rapidjson/bin/data/sample.json +3315 -0
- data/ext/rj_schema/rapidjson/bin/data/webapp.json +88 -0
- data/ext/rj_schema/rapidjson/bin/data/widget.json +26 -0
- data/ext/rj_schema/rapidjson/bin/draft-04/schema +150 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16be.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16bebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16le.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16lebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32be.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32bebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32le.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32lebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf8.json +7 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf8bom.json +7 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail1.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail10.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail11.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail12.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail13.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail14.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail15.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail16.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail17.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail18.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail19.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail2.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail20.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail21.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail22.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail23.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail24.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail25.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail26.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail27.json +2 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail28.json +2 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail29.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail3.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail30.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail31.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail32.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail33.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail4.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail5.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail6.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail7.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail8.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail9.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass1.json +58 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass2.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass3.json +6 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/readme.txt +3 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/LICENSE +19 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/README.md +148 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/bin/jsonschema_suite +283 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json +3 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/integer.json +3 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/subSchemas.json +8 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json +82 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json +88 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/default.json +49 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/dependencies.json +108 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/disallow.json +80 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json +60 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/enum.json +71 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/extends.json +94 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/items.json +46 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maximum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minimum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json +107 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/format.json +222 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json +18 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json +15 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/pattern.json +34 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json +110 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/properties.json +92 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/ref.json +159 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/refRemote.json +74 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/required.json +53 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/type.json +474 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json +79 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json +82 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json +88 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/allOf.json +112 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/anyOf.json +68 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/default.json +49 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/definitions.json +32 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/dependencies.json +113 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/enum.json +72 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/items.json +46 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maximum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minProperties.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minimum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json +60 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/not.json +96 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/oneOf.json +68 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json +107 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/format.json +148 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json +15 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/pattern.json +34 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json +110 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/properties.json +92 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/ref.json +159 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/refRemote.json +74 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/required.json +39 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/type.json +330 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json +79 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tox.ini +8 -0
- data/ext/rj_schema/rapidjson/bin/types/alotofkeys.json +502 -0
- data/ext/rj_schema/rapidjson/bin/types/booleans.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/floats.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/guids.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/integers.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/mixed.json +592 -0
- data/ext/rj_schema/rapidjson/bin/types/nulls.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/paragraphs.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/readme.txt +1 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/address.json +139 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/allOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/anyOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/idandref.json +69 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/oneOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/contrib/natvis/LICENSE +45 -0
- data/ext/rj_schema/rapidjson/contrib/natvis/README.md +7 -0
- data/ext/rj_schema/rapidjson/contrib/natvis/rapidjson.natvis +38 -0
- data/ext/rj_schema/rapidjson/doc/CMakeLists.txt +27 -0
- data/ext/rj_schema/rapidjson/doc/Doxyfile.in +2369 -0
- data/ext/rj_schema/rapidjson/doc/Doxyfile.zh-cn.in +2369 -0
- data/ext/rj_schema/rapidjson/doc/diagram/architecture.dot +50 -0
- data/ext/rj_schema/rapidjson/doc/diagram/architecture.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.dot +65 -0
- data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.dot +62 -0
- data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/makefile +8 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move1.dot +47 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move1.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move2.dot +62 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move2.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move3.dot +60 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move3.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.dot +56 -0
- data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/simpledom.dot +54 -0
- data/ext/rj_schema/rapidjson/doc/diagram/simpledom.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/tutorial.dot +58 -0
- data/ext/rj_schema/rapidjson/doc/diagram/tutorial.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.dot +73 -0
- data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.png +0 -0
- data/ext/rj_schema/rapidjson/doc/dom.md +281 -0
- data/ext/rj_schema/rapidjson/doc/dom.zh-cn.md +285 -0
- data/ext/rj_schema/rapidjson/doc/encoding.md +146 -0
- data/ext/rj_schema/rapidjson/doc/encoding.zh-cn.md +152 -0
- data/ext/rj_schema/rapidjson/doc/faq.md +289 -0
- data/ext/rj_schema/rapidjson/doc/faq.zh-cn.md +290 -0
- data/ext/rj_schema/rapidjson/doc/features.md +104 -0
- data/ext/rj_schema/rapidjson/doc/features.zh-cn.md +103 -0
- data/ext/rj_schema/rapidjson/doc/internals.md +368 -0
- data/ext/rj_schema/rapidjson/doc/internals.zh-cn.md +363 -0
- data/ext/rj_schema/rapidjson/doc/logo/rapidjson.png +0 -0
- data/ext/rj_schema/rapidjson/doc/logo/rapidjson.svg +119 -0
- data/ext/rj_schema/rapidjson/doc/misc/DoxygenLayout.xml +194 -0
- data/ext/rj_schema/rapidjson/doc/misc/doxygenextra.css +274 -0
- data/ext/rj_schema/rapidjson/doc/misc/footer.html +11 -0
- data/ext/rj_schema/rapidjson/doc/misc/header.html +24 -0
- data/ext/rj_schema/rapidjson/doc/npm.md +31 -0
- data/ext/rj_schema/rapidjson/doc/performance.md +26 -0
- data/ext/rj_schema/rapidjson/doc/performance.zh-cn.md +26 -0
- data/ext/rj_schema/rapidjson/doc/pointer.md +234 -0
- data/ext/rj_schema/rapidjson/doc/pointer.zh-cn.md +234 -0
- data/ext/rj_schema/rapidjson/doc/sax.md +509 -0
- data/ext/rj_schema/rapidjson/doc/sax.zh-cn.md +487 -0
- data/ext/rj_schema/rapidjson/doc/schema.md +505 -0
- data/ext/rj_schema/rapidjson/doc/schema.zh-cn.md +237 -0
- data/ext/rj_schema/rapidjson/doc/stream.md +429 -0
- data/ext/rj_schema/rapidjson/doc/stream.zh-cn.md +429 -0
- data/ext/rj_schema/rapidjson/doc/tutorial.md +536 -0
- data/ext/rj_schema/rapidjson/doc/tutorial.zh-cn.md +535 -0
- data/ext/rj_schema/rapidjson/docker/debian/Dockerfile +8 -0
- data/ext/rj_schema/rapidjson/example/CMakeLists.txt +46 -0
- data/ext/rj_schema/rapidjson/example/archiver/archiver.cpp +292 -0
- data/ext/rj_schema/rapidjson/example/archiver/archiver.h +145 -0
- data/ext/rj_schema/rapidjson/example/archiver/archivertest.cpp +287 -0
- data/ext/rj_schema/rapidjson/example/capitalize/capitalize.cpp +67 -0
- data/ext/rj_schema/rapidjson/example/condense/condense.cpp +32 -0
- data/ext/rj_schema/rapidjson/example/filterkey/filterkey.cpp +135 -0
- data/ext/rj_schema/rapidjson/example/filterkeydom/filterkeydom.cpp +170 -0
- data/ext/rj_schema/rapidjson/example/jsonx/jsonx.cpp +207 -0
- data/ext/rj_schema/rapidjson/example/lookaheadparser/lookaheadparser.cpp +350 -0
- data/ext/rj_schema/rapidjson/example/messagereader/messagereader.cpp +105 -0
- data/ext/rj_schema/rapidjson/example/parsebyparts/parsebyparts.cpp +176 -0
- data/ext/rj_schema/rapidjson/example/pretty/pretty.cpp +30 -0
- data/ext/rj_schema/rapidjson/example/prettyauto/prettyauto.cpp +56 -0
- data/ext/rj_schema/rapidjson/example/schemavalidator/schemavalidator.cpp +198 -0
- data/ext/rj_schema/rapidjson/example/serialize/serialize.cpp +173 -0
- data/ext/rj_schema/rapidjson/example/simpledom/simpledom.cpp +29 -0
- data/ext/rj_schema/rapidjson/example/simplepullreader/simplepullreader.cpp +53 -0
- data/ext/rj_schema/rapidjson/example/simplereader/simplereader.cpp +42 -0
- data/ext/rj_schema/rapidjson/example/simplewriter/simplewriter.cpp +36 -0
- data/ext/rj_schema/rapidjson/example/sortkeys/sortkeys.cpp +62 -0
- data/ext/rj_schema/rapidjson/example/traverseaspointer.cpp +39 -0
- data/ext/rj_schema/rapidjson/example/tutorial/tutorial.cpp +151 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +692 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/cursorstreamwrapper.h +78 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/document.h +3027 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/encodedstream.h +299 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/encodings.h +716 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/error/en.h +122 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/error/error.h +216 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/filereadstream.h +99 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/filewritestream.h +104 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/fwd.h +151 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/biginteger.h +290 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/clzll.h +71 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/diyfp.h +257 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/dtoa.h +245 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/ieee754.h +78 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/itoa.h +308 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/meta.h +186 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/pow10.h +55 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/regex.h +739 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/stack.h +232 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strfunc.h +83 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strtod.h +290 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/swap.h +46 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/istreamwrapper.h +128 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/memorybuffer.h +70 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/memorystream.h +71 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/inttypes.h +316 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/stdint.h +300 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/ostreamwrapper.h +81 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/pointer.h +1482 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/prettywriter.h +277 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +741 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/reader.h +2244 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +2795 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/stream.h +223 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/stringbuffer.h +121 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/uri.h +466 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/writer.h +710 -0
- data/ext/rj_schema/rapidjson/include_dirs.js +2 -0
- data/ext/rj_schema/rapidjson/library.json +15 -0
- data/ext/rj_schema/rapidjson/license.txt +57 -0
- data/ext/rj_schema/rapidjson/package.json +24 -0
- data/ext/rj_schema/rapidjson/rapidjson.autopkg +77 -0
- data/ext/rj_schema/rapidjson/readme.md +210 -0
- data/ext/rj_schema/rapidjson/readme.zh-cn.md +152 -0
- data/ext/rj_schema/rapidjson/test/CMakeLists.txt +20 -0
- data/ext/rj_schema/rapidjson/test/perftest/CMakeLists.txt +28 -0
- data/ext/rj_schema/rapidjson/test/perftest/misctest.cpp +974 -0
- data/ext/rj_schema/rapidjson/test/perftest/perftest.cpp +24 -0
- data/ext/rj_schema/rapidjson/test/perftest/perftest.h +186 -0
- data/ext/rj_schema/rapidjson/test/perftest/platformtest.cpp +166 -0
- data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +564 -0
- data/ext/rj_schema/rapidjson/test/perftest/schematest.cpp +223 -0
- data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +95 -0
- data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +292 -0
- data/ext/rj_schema/rapidjson/test/unittest/bigintegertest.cpp +138 -0
- data/ext/rj_schema/rapidjson/test/unittest/clzlltest.cpp +34 -0
- data/ext/rj_schema/rapidjson/test/unittest/cursorstreamwrappertest.cpp +115 -0
- data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +674 -0
- data/ext/rj_schema/rapidjson/test/unittest/dtoatest.cpp +98 -0
- data/ext/rj_schema/rapidjson/test/unittest/encodedstreamtest.cpp +313 -0
- data/ext/rj_schema/rapidjson/test/unittest/encodingstest.cpp +451 -0
- data/ext/rj_schema/rapidjson/test/unittest/filestreamtest.cpp +155 -0
- data/ext/rj_schema/rapidjson/test/unittest/fwdtest.cpp +230 -0
- data/ext/rj_schema/rapidjson/test/unittest/istreamwrappertest.cpp +181 -0
- data/ext/rj_schema/rapidjson/test/unittest/itoatest.cpp +160 -0
- data/ext/rj_schema/rapidjson/test/unittest/jsoncheckertest.cpp +143 -0
- data/ext/rj_schema/rapidjson/test/unittest/namespacetest.cpp +70 -0
- data/ext/rj_schema/rapidjson/test/unittest/ostreamwrappertest.cpp +92 -0
- data/ext/rj_schema/rapidjson/test/unittest/platformtest.cpp +40 -0
- data/ext/rj_schema/rapidjson/test/unittest/pointertest.cpp +1730 -0
- data/ext/rj_schema/rapidjson/test/unittest/prettywritertest.cpp +373 -0
- data/ext/rj_schema/rapidjson/test/unittest/readertest.cpp +2228 -0
- data/ext/rj_schema/rapidjson/test/unittest/regextest.cpp +639 -0
- data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +2952 -0
- data/ext/rj_schema/rapidjson/test/unittest/simdtest.cpp +219 -0
- data/ext/rj_schema/rapidjson/test/unittest/strfunctest.cpp +30 -0
- data/ext/rj_schema/rapidjson/test/unittest/stringbuffertest.cpp +192 -0
- data/ext/rj_schema/rapidjson/test/unittest/strtodtest.cpp +132 -0
- data/ext/rj_schema/rapidjson/test/unittest/unittest.cpp +51 -0
- data/ext/rj_schema/rapidjson/test/unittest/unittest.h +143 -0
- data/ext/rj_schema/rapidjson/test/unittest/uritest.cpp +718 -0
- data/ext/rj_schema/rapidjson/test/unittest/valuetest.cpp +1861 -0
- data/ext/rj_schema/rapidjson/test/unittest/writertest.cpp +598 -0
- data/ext/rj_schema/rapidjson/test/valgrind.supp +17 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/BUILD.bazel +175 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/CMakeLists.txt +33 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/CONTRIBUTING.md +160 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/Makefile.am +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/README.md +122 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/WORKSPACE +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/appveyor.yml +104 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-autotools.sh +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-bazel.sh +36 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-linux.sh +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-osx.sh +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/get-nprocessors.sh +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-linux.sh +49 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-osx.sh +39 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/log-config.sh +51 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/travis.sh +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/configure.ac +16 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CHANGES +126 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +242 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CONTRIBUTORS +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/Makefile.am +224 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/README.md +344 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock_main.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/configure.ac +146 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +564 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +3660 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DesignDoc.md +280 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +15 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +447 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +627 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/KnownIssues.md +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +1262 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-cardinalities.h +147 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +2571 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +833 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +1379 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +347 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +2258 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +675 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +458 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +178 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +5255 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-actions.h +246 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +91 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +1918 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +95 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +10 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +38 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-port.h +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +286 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +136 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +574 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +87 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/make/Makefile +101 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.sln +32 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.vcproj +191 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_config.vsprops +15 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_main.vcproj +187 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_test.vcproj +201 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +145 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +151 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +176 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +145 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_config.props +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +151 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +176 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +240 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/LICENSE +203 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +34 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README.cppclean +115 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/__init__.py +0 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +1733 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class.py +227 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py +448 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/keywords.py +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/tokenize.py +287 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/utils.py +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/gmock_gen.py +31 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock-config.in +303 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock_doctor.py +640 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload.py +1387 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload_gmock.py +78 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-all.cc +47 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +156 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +204 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +573 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +883 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +205 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock_main.cc +54 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/BUILD.bazel +123 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +1575 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +428 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +1230 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +647 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +129 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +1341 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +718 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +6767 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +710 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +511 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-port_test.cc +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +2771 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_all_test.cc +51 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_ex_test.cc +81 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test.py +108 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test_.cc +100 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +691 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +183 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +310 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +317 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +323 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +262 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +110 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CHANGES +157 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +312 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CONTRIBUTORS +37 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/Makefile.am +339 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/README.md +341 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest_main.pc.in +10 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +280 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.cbproj +138 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.groupproj +54 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_all.cc +38 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_link.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_main.cbproj +82 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_unittest.cbproj +88 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/configure.ac +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Pkgconfig.md +146 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +177 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +93 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/advanced.md +2416 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/faq.md +1092 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/primer.md +536 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/samples.md +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +342 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +249 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +1438 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +501 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +1082 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +231 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-test-part.h +179 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +264 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +2332 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +357 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +61 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +70 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +275 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +205 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +1277 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-linked_ptr.h +243 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +5139 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +279 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +723 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +100 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +2687 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +167 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h +1020 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h.pump +347 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +3347 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +313 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/acx_pthread.m4 +363 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/gtest.m4 +74 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/make/Makefile +82 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.sln +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj +149 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.sln +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj +149 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj +154 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj +162 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj +199 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj.filters +26 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj +191 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj.filters +26 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj +188 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj +180 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +127 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.h +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +140 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +154 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.cc +56 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.h +85 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +110 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3-inl.h +172 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +152 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.cc +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.h +53 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +49 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +199 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +225 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +118 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +174 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +157 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/common.py +83 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +253 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +730 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gtest-config.in +274 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/pump.py +855 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/release_docs.py +158 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/test/Makefile +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +1387 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload_gtest.py +78 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +1536 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +385 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +1175 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +1277 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +458 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +102 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +119 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +5846 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +38 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/BUILD.bazel +396 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_ex_test.cc +93 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +1424 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +652 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-linked_ptr_test.cc +154 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +311 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-message_test.cc +159 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +213 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +61 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +1110 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +53 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +1303 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +1737 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-test-part_test.cc +208 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-tuple_test.cc +320 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +380 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.h +66 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +341 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +47 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_assert_by_exception_test.cc +119 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +210 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +87 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +235 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +311 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +129 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +63 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +119 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +124 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +189 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +638 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +138 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +172 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test_.cc +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_outfiles_test.py +162 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_output_unittest.py +611 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_test_utils.py +60 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +207 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest_.cc +157 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_no_test_unittest.cc +56 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +344 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +1067 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +781 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +2427 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_premature_exit_test.cc +127 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +57 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +236 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test.py +325 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test_.cc +103 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_sole_header_test.cc +57 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +250 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +318 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test.py +65 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test_.cc +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc +92 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +171 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test_.cc +72 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +69 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +7797 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +140 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +378 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +179 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +196 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.cc +36 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.h +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/DebugProject.xcconfig +30 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/FrameworkTarget.xcconfig +17 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/General.xcconfig +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/ReleaseProject.xcconfig +32 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/StaticLibraryTarget.xcconfig +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/TestTarget.xcconfig +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Resources/Info.plist +30 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/Info.plist +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj +457 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/runtests.sh +62 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.cc +63 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.h +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget_test.cc +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/runtests.sh +65 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +100 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +1182 -0
- data/ext/rj_schema/rapidjson/travis-doxygen.sh +128 -0
- data/ext/rj_schema/rj_schema.cpp +162 -18
- data/lib/rj_schema.rb +1 -1
- metadata +626 -3
@@ -0,0 +1,53 @@
|
|
1
|
+
// Copyright 2008, 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
|
+
// Authors: vladl@google.com (Vlad Losev)
|
31
|
+
//
|
32
|
+
// The Google C++ Testing and Mocking Framework (Google Test)
|
33
|
+
//
|
34
|
+
// This header file provides classes and functions used internally
|
35
|
+
// for testing Google Test itself.
|
36
|
+
|
37
|
+
#ifndef GTEST_TEST_GTEST_PARAM_TEST_TEST_H_
|
38
|
+
#define GTEST_TEST_GTEST_PARAM_TEST_TEST_H_
|
39
|
+
|
40
|
+
#include "gtest/gtest.h"
|
41
|
+
|
42
|
+
// Test fixture for testing definition and instantiation of a test
|
43
|
+
// in separate translation units.
|
44
|
+
class ExternalInstantiationTest : public ::testing::TestWithParam<int> {
|
45
|
+
};
|
46
|
+
|
47
|
+
// Test fixture for testing instantiation of a test in multiple
|
48
|
+
// translation units.
|
49
|
+
class InstantiationInMultipleTranslaionUnitsTest
|
50
|
+
: public ::testing::TestWithParam<int> {
|
51
|
+
};
|
52
|
+
|
53
|
+
#endif // GTEST_TEST_GTEST_PARAM_TEST_TEST_H_
|
@@ -0,0 +1,1303 @@
|
|
1
|
+
// Copyright 2008, 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
|
+
// Authors: vladl@google.com (Vlad Losev), wan@google.com (Zhanyong Wan)
|
31
|
+
//
|
32
|
+
// This file tests the internal cross-platform support utilities.
|
33
|
+
|
34
|
+
#include "gtest/internal/gtest-port.h"
|
35
|
+
|
36
|
+
#include <stdio.h>
|
37
|
+
|
38
|
+
#if GTEST_OS_MAC
|
39
|
+
# include <time.h>
|
40
|
+
#endif // GTEST_OS_MAC
|
41
|
+
|
42
|
+
#include <list>
|
43
|
+
#include <utility> // For std::pair and std::make_pair.
|
44
|
+
#include <vector>
|
45
|
+
|
46
|
+
#include "gtest/gtest.h"
|
47
|
+
#include "gtest/gtest-spi.h"
|
48
|
+
#include "src/gtest-internal-inl.h"
|
49
|
+
|
50
|
+
using std::make_pair;
|
51
|
+
using std::pair;
|
52
|
+
|
53
|
+
namespace testing {
|
54
|
+
namespace internal {
|
55
|
+
|
56
|
+
TEST(IsXDigitTest, WorksForNarrowAscii) {
|
57
|
+
EXPECT_TRUE(IsXDigit('0'));
|
58
|
+
EXPECT_TRUE(IsXDigit('9'));
|
59
|
+
EXPECT_TRUE(IsXDigit('A'));
|
60
|
+
EXPECT_TRUE(IsXDigit('F'));
|
61
|
+
EXPECT_TRUE(IsXDigit('a'));
|
62
|
+
EXPECT_TRUE(IsXDigit('f'));
|
63
|
+
|
64
|
+
EXPECT_FALSE(IsXDigit('-'));
|
65
|
+
EXPECT_FALSE(IsXDigit('g'));
|
66
|
+
EXPECT_FALSE(IsXDigit('G'));
|
67
|
+
}
|
68
|
+
|
69
|
+
TEST(IsXDigitTest, ReturnsFalseForNarrowNonAscii) {
|
70
|
+
EXPECT_FALSE(IsXDigit(static_cast<char>('\x80')));
|
71
|
+
EXPECT_FALSE(IsXDigit(static_cast<char>('0' | '\x80')));
|
72
|
+
}
|
73
|
+
|
74
|
+
TEST(IsXDigitTest, WorksForWideAscii) {
|
75
|
+
EXPECT_TRUE(IsXDigit(L'0'));
|
76
|
+
EXPECT_TRUE(IsXDigit(L'9'));
|
77
|
+
EXPECT_TRUE(IsXDigit(L'A'));
|
78
|
+
EXPECT_TRUE(IsXDigit(L'F'));
|
79
|
+
EXPECT_TRUE(IsXDigit(L'a'));
|
80
|
+
EXPECT_TRUE(IsXDigit(L'f'));
|
81
|
+
|
82
|
+
EXPECT_FALSE(IsXDigit(L'-'));
|
83
|
+
EXPECT_FALSE(IsXDigit(L'g'));
|
84
|
+
EXPECT_FALSE(IsXDigit(L'G'));
|
85
|
+
}
|
86
|
+
|
87
|
+
TEST(IsXDigitTest, ReturnsFalseForWideNonAscii) {
|
88
|
+
EXPECT_FALSE(IsXDigit(static_cast<wchar_t>(0x80)));
|
89
|
+
EXPECT_FALSE(IsXDigit(static_cast<wchar_t>(L'0' | 0x80)));
|
90
|
+
EXPECT_FALSE(IsXDigit(static_cast<wchar_t>(L'0' | 0x100)));
|
91
|
+
}
|
92
|
+
|
93
|
+
class Base {
|
94
|
+
public:
|
95
|
+
// Copy constructor and assignment operator do exactly what we need, so we
|
96
|
+
// use them.
|
97
|
+
Base() : member_(0) {}
|
98
|
+
explicit Base(int n) : member_(n) {}
|
99
|
+
virtual ~Base() {}
|
100
|
+
int member() { return member_; }
|
101
|
+
|
102
|
+
private:
|
103
|
+
int member_;
|
104
|
+
};
|
105
|
+
|
106
|
+
class Derived : public Base {
|
107
|
+
public:
|
108
|
+
explicit Derived(int n) : Base(n) {}
|
109
|
+
};
|
110
|
+
|
111
|
+
TEST(ImplicitCastTest, ConvertsPointers) {
|
112
|
+
Derived derived(0);
|
113
|
+
EXPECT_TRUE(&derived == ::testing::internal::ImplicitCast_<Base*>(&derived));
|
114
|
+
}
|
115
|
+
|
116
|
+
TEST(ImplicitCastTest, CanUseInheritance) {
|
117
|
+
Derived derived(1);
|
118
|
+
Base base = ::testing::internal::ImplicitCast_<Base>(derived);
|
119
|
+
EXPECT_EQ(derived.member(), base.member());
|
120
|
+
}
|
121
|
+
|
122
|
+
class Castable {
|
123
|
+
public:
|
124
|
+
explicit Castable(bool* converted) : converted_(converted) {}
|
125
|
+
operator Base() {
|
126
|
+
*converted_ = true;
|
127
|
+
return Base();
|
128
|
+
}
|
129
|
+
|
130
|
+
private:
|
131
|
+
bool* converted_;
|
132
|
+
};
|
133
|
+
|
134
|
+
TEST(ImplicitCastTest, CanUseNonConstCastOperator) {
|
135
|
+
bool converted = false;
|
136
|
+
Castable castable(&converted);
|
137
|
+
Base base = ::testing::internal::ImplicitCast_<Base>(castable);
|
138
|
+
EXPECT_TRUE(converted);
|
139
|
+
}
|
140
|
+
|
141
|
+
class ConstCastable {
|
142
|
+
public:
|
143
|
+
explicit ConstCastable(bool* converted) : converted_(converted) {}
|
144
|
+
operator Base() const {
|
145
|
+
*converted_ = true;
|
146
|
+
return Base();
|
147
|
+
}
|
148
|
+
|
149
|
+
private:
|
150
|
+
bool* converted_;
|
151
|
+
};
|
152
|
+
|
153
|
+
TEST(ImplicitCastTest, CanUseConstCastOperatorOnConstValues) {
|
154
|
+
bool converted = false;
|
155
|
+
const ConstCastable const_castable(&converted);
|
156
|
+
Base base = ::testing::internal::ImplicitCast_<Base>(const_castable);
|
157
|
+
EXPECT_TRUE(converted);
|
158
|
+
}
|
159
|
+
|
160
|
+
class ConstAndNonConstCastable {
|
161
|
+
public:
|
162
|
+
ConstAndNonConstCastable(bool* converted, bool* const_converted)
|
163
|
+
: converted_(converted), const_converted_(const_converted) {}
|
164
|
+
operator Base() {
|
165
|
+
*converted_ = true;
|
166
|
+
return Base();
|
167
|
+
}
|
168
|
+
operator Base() const {
|
169
|
+
*const_converted_ = true;
|
170
|
+
return Base();
|
171
|
+
}
|
172
|
+
|
173
|
+
private:
|
174
|
+
bool* converted_;
|
175
|
+
bool* const_converted_;
|
176
|
+
};
|
177
|
+
|
178
|
+
TEST(ImplicitCastTest, CanSelectBetweenConstAndNonConstCasrAppropriately) {
|
179
|
+
bool converted = false;
|
180
|
+
bool const_converted = false;
|
181
|
+
ConstAndNonConstCastable castable(&converted, &const_converted);
|
182
|
+
Base base = ::testing::internal::ImplicitCast_<Base>(castable);
|
183
|
+
EXPECT_TRUE(converted);
|
184
|
+
EXPECT_FALSE(const_converted);
|
185
|
+
|
186
|
+
converted = false;
|
187
|
+
const_converted = false;
|
188
|
+
const ConstAndNonConstCastable const_castable(&converted, &const_converted);
|
189
|
+
base = ::testing::internal::ImplicitCast_<Base>(const_castable);
|
190
|
+
EXPECT_FALSE(converted);
|
191
|
+
EXPECT_TRUE(const_converted);
|
192
|
+
}
|
193
|
+
|
194
|
+
class To {
|
195
|
+
public:
|
196
|
+
To(bool* converted) { *converted = true; } // NOLINT
|
197
|
+
};
|
198
|
+
|
199
|
+
TEST(ImplicitCastTest, CanUseImplicitConstructor) {
|
200
|
+
bool converted = false;
|
201
|
+
To to = ::testing::internal::ImplicitCast_<To>(&converted);
|
202
|
+
(void)to;
|
203
|
+
EXPECT_TRUE(converted);
|
204
|
+
}
|
205
|
+
|
206
|
+
TEST(IteratorTraitsTest, WorksForSTLContainerIterators) {
|
207
|
+
StaticAssertTypeEq<int,
|
208
|
+
IteratorTraits< ::std::vector<int>::const_iterator>::value_type>();
|
209
|
+
StaticAssertTypeEq<bool,
|
210
|
+
IteratorTraits< ::std::list<bool>::iterator>::value_type>();
|
211
|
+
}
|
212
|
+
|
213
|
+
TEST(IteratorTraitsTest, WorksForPointerToNonConst) {
|
214
|
+
StaticAssertTypeEq<char, IteratorTraits<char*>::value_type>();
|
215
|
+
StaticAssertTypeEq<const void*, IteratorTraits<const void**>::value_type>();
|
216
|
+
}
|
217
|
+
|
218
|
+
TEST(IteratorTraitsTest, WorksForPointerToConst) {
|
219
|
+
StaticAssertTypeEq<char, IteratorTraits<const char*>::value_type>();
|
220
|
+
StaticAssertTypeEq<const void*,
|
221
|
+
IteratorTraits<const void* const*>::value_type>();
|
222
|
+
}
|
223
|
+
|
224
|
+
// Tests that the element_type typedef is available in scoped_ptr and refers
|
225
|
+
// to the parameter type.
|
226
|
+
TEST(ScopedPtrTest, DefinesElementType) {
|
227
|
+
StaticAssertTypeEq<int, ::testing::internal::scoped_ptr<int>::element_type>();
|
228
|
+
}
|
229
|
+
|
230
|
+
// TODO(vladl@google.com): Implement THE REST of scoped_ptr tests.
|
231
|
+
|
232
|
+
TEST(GtestCheckSyntaxTest, BehavesLikeASingleStatement) {
|
233
|
+
if (AlwaysFalse())
|
234
|
+
GTEST_CHECK_(false) << "This should never be executed; "
|
235
|
+
"It's a compilation test only.";
|
236
|
+
|
237
|
+
if (AlwaysTrue())
|
238
|
+
GTEST_CHECK_(true);
|
239
|
+
else
|
240
|
+
; // NOLINT
|
241
|
+
|
242
|
+
if (AlwaysFalse())
|
243
|
+
; // NOLINT
|
244
|
+
else
|
245
|
+
GTEST_CHECK_(true) << "";
|
246
|
+
}
|
247
|
+
|
248
|
+
TEST(GtestCheckSyntaxTest, WorksWithSwitch) {
|
249
|
+
switch (0) {
|
250
|
+
case 1:
|
251
|
+
break;
|
252
|
+
default:
|
253
|
+
GTEST_CHECK_(true);
|
254
|
+
}
|
255
|
+
|
256
|
+
switch (0)
|
257
|
+
case 0:
|
258
|
+
GTEST_CHECK_(true) << "Check failed in switch case";
|
259
|
+
}
|
260
|
+
|
261
|
+
// Verifies behavior of FormatFileLocation.
|
262
|
+
TEST(FormatFileLocationTest, FormatsFileLocation) {
|
263
|
+
EXPECT_PRED_FORMAT2(IsSubstring, "foo.cc", FormatFileLocation("foo.cc", 42));
|
264
|
+
EXPECT_PRED_FORMAT2(IsSubstring, "42", FormatFileLocation("foo.cc", 42));
|
265
|
+
}
|
266
|
+
|
267
|
+
TEST(FormatFileLocationTest, FormatsUnknownFile) {
|
268
|
+
EXPECT_PRED_FORMAT2(
|
269
|
+
IsSubstring, "unknown file", FormatFileLocation(NULL, 42));
|
270
|
+
EXPECT_PRED_FORMAT2(IsSubstring, "42", FormatFileLocation(NULL, 42));
|
271
|
+
}
|
272
|
+
|
273
|
+
TEST(FormatFileLocationTest, FormatsUknownLine) {
|
274
|
+
EXPECT_EQ("foo.cc:", FormatFileLocation("foo.cc", -1));
|
275
|
+
}
|
276
|
+
|
277
|
+
TEST(FormatFileLocationTest, FormatsUknownFileAndLine) {
|
278
|
+
EXPECT_EQ("unknown file:", FormatFileLocation(NULL, -1));
|
279
|
+
}
|
280
|
+
|
281
|
+
// Verifies behavior of FormatCompilerIndependentFileLocation.
|
282
|
+
TEST(FormatCompilerIndependentFileLocationTest, FormatsFileLocation) {
|
283
|
+
EXPECT_EQ("foo.cc:42", FormatCompilerIndependentFileLocation("foo.cc", 42));
|
284
|
+
}
|
285
|
+
|
286
|
+
TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownFile) {
|
287
|
+
EXPECT_EQ("unknown file:42",
|
288
|
+
FormatCompilerIndependentFileLocation(NULL, 42));
|
289
|
+
}
|
290
|
+
|
291
|
+
TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownLine) {
|
292
|
+
EXPECT_EQ("foo.cc", FormatCompilerIndependentFileLocation("foo.cc", -1));
|
293
|
+
}
|
294
|
+
|
295
|
+
TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownFileAndLine) {
|
296
|
+
EXPECT_EQ("unknown file", FormatCompilerIndependentFileLocation(NULL, -1));
|
297
|
+
}
|
298
|
+
|
299
|
+
#if GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_QNX || GTEST_OS_FUCHSIA
|
300
|
+
void* ThreadFunc(void* data) {
|
301
|
+
internal::Mutex* mutex = static_cast<internal::Mutex*>(data);
|
302
|
+
mutex->Lock();
|
303
|
+
mutex->Unlock();
|
304
|
+
return NULL;
|
305
|
+
}
|
306
|
+
|
307
|
+
TEST(GetThreadCountTest, ReturnsCorrectValue) {
|
308
|
+
const size_t starting_count = GetThreadCount();
|
309
|
+
pthread_t thread_id;
|
310
|
+
|
311
|
+
internal::Mutex mutex;
|
312
|
+
{
|
313
|
+
internal::MutexLock lock(&mutex);
|
314
|
+
pthread_attr_t attr;
|
315
|
+
ASSERT_EQ(0, pthread_attr_init(&attr));
|
316
|
+
ASSERT_EQ(0, pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE));
|
317
|
+
|
318
|
+
const int status = pthread_create(&thread_id, &attr, &ThreadFunc, &mutex);
|
319
|
+
ASSERT_EQ(0, pthread_attr_destroy(&attr));
|
320
|
+
ASSERT_EQ(0, status);
|
321
|
+
EXPECT_EQ(starting_count + 1, GetThreadCount());
|
322
|
+
}
|
323
|
+
|
324
|
+
void* dummy;
|
325
|
+
ASSERT_EQ(0, pthread_join(thread_id, &dummy));
|
326
|
+
|
327
|
+
// The OS may not immediately report the updated thread count after
|
328
|
+
// joining a thread, causing flakiness in this test. To counter that, we
|
329
|
+
// wait for up to .5 seconds for the OS to report the correct value.
|
330
|
+
for (int i = 0; i < 5; ++i) {
|
331
|
+
if (GetThreadCount() == starting_count)
|
332
|
+
break;
|
333
|
+
|
334
|
+
SleepMilliseconds(100);
|
335
|
+
}
|
336
|
+
|
337
|
+
EXPECT_EQ(starting_count, GetThreadCount());
|
338
|
+
}
|
339
|
+
#else
|
340
|
+
TEST(GetThreadCountTest, ReturnsZeroWhenUnableToCountThreads) {
|
341
|
+
EXPECT_EQ(0U, GetThreadCount());
|
342
|
+
}
|
343
|
+
#endif // GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_QNX || GTEST_OS_FUCHSIA
|
344
|
+
|
345
|
+
TEST(GtestCheckDeathTest, DiesWithCorrectOutputOnFailure) {
|
346
|
+
const bool a_false_condition = false;
|
347
|
+
const char regex[] =
|
348
|
+
#ifdef _MSC_VER
|
349
|
+
"gtest-port_test\\.cc\\(\\d+\\):"
|
350
|
+
#elif GTEST_USES_POSIX_RE
|
351
|
+
"gtest-port_test\\.cc:[0-9]+"
|
352
|
+
#else
|
353
|
+
"gtest-port_test\\.cc:\\d+"
|
354
|
+
#endif // _MSC_VER
|
355
|
+
".*a_false_condition.*Extra info.*";
|
356
|
+
|
357
|
+
EXPECT_DEATH_IF_SUPPORTED(GTEST_CHECK_(a_false_condition) << "Extra info",
|
358
|
+
regex);
|
359
|
+
}
|
360
|
+
|
361
|
+
#if GTEST_HAS_DEATH_TEST
|
362
|
+
|
363
|
+
TEST(GtestCheckDeathTest, LivesSilentlyOnSuccess) {
|
364
|
+
EXPECT_EXIT({
|
365
|
+
GTEST_CHECK_(true) << "Extra info";
|
366
|
+
::std::cerr << "Success\n";
|
367
|
+
exit(0); },
|
368
|
+
::testing::ExitedWithCode(0), "Success");
|
369
|
+
}
|
370
|
+
|
371
|
+
#endif // GTEST_HAS_DEATH_TEST
|
372
|
+
|
373
|
+
// Verifies that Google Test choose regular expression engine appropriate to
|
374
|
+
// the platform. The test will produce compiler errors in case of failure.
|
375
|
+
// For simplicity, we only cover the most important platforms here.
|
376
|
+
TEST(RegexEngineSelectionTest, SelectsCorrectRegexEngine) {
|
377
|
+
#if !GTEST_USES_PCRE
|
378
|
+
# if GTEST_HAS_POSIX_RE
|
379
|
+
|
380
|
+
EXPECT_TRUE(GTEST_USES_POSIX_RE);
|
381
|
+
|
382
|
+
# else
|
383
|
+
|
384
|
+
EXPECT_TRUE(GTEST_USES_SIMPLE_RE);
|
385
|
+
|
386
|
+
# endif
|
387
|
+
#endif // !GTEST_USES_PCRE
|
388
|
+
}
|
389
|
+
|
390
|
+
#if GTEST_USES_POSIX_RE
|
391
|
+
|
392
|
+
# if GTEST_HAS_TYPED_TEST
|
393
|
+
|
394
|
+
template <typename Str>
|
395
|
+
class RETest : public ::testing::Test {};
|
396
|
+
|
397
|
+
// Defines StringTypes as the list of all string types that class RE
|
398
|
+
// supports.
|
399
|
+
typedef testing::Types<
|
400
|
+
::std::string,
|
401
|
+
# if GTEST_HAS_GLOBAL_STRING
|
402
|
+
::string,
|
403
|
+
# endif // GTEST_HAS_GLOBAL_STRING
|
404
|
+
const char*> StringTypes;
|
405
|
+
|
406
|
+
TYPED_TEST_CASE(RETest, StringTypes);
|
407
|
+
|
408
|
+
// Tests RE's implicit constructors.
|
409
|
+
TYPED_TEST(RETest, ImplicitConstructorWorks) {
|
410
|
+
const RE empty(TypeParam(""));
|
411
|
+
EXPECT_STREQ("", empty.pattern());
|
412
|
+
|
413
|
+
const RE simple(TypeParam("hello"));
|
414
|
+
EXPECT_STREQ("hello", simple.pattern());
|
415
|
+
|
416
|
+
const RE normal(TypeParam(".*(\\w+)"));
|
417
|
+
EXPECT_STREQ(".*(\\w+)", normal.pattern());
|
418
|
+
}
|
419
|
+
|
420
|
+
// Tests that RE's constructors reject invalid regular expressions.
|
421
|
+
TYPED_TEST(RETest, RejectsInvalidRegex) {
|
422
|
+
EXPECT_NONFATAL_FAILURE({
|
423
|
+
const RE invalid(TypeParam("?"));
|
424
|
+
}, "\"?\" is not a valid POSIX Extended regular expression.");
|
425
|
+
}
|
426
|
+
|
427
|
+
// Tests RE::FullMatch().
|
428
|
+
TYPED_TEST(RETest, FullMatchWorks) {
|
429
|
+
const RE empty(TypeParam(""));
|
430
|
+
EXPECT_TRUE(RE::FullMatch(TypeParam(""), empty));
|
431
|
+
EXPECT_FALSE(RE::FullMatch(TypeParam("a"), empty));
|
432
|
+
|
433
|
+
const RE re(TypeParam("a.*z"));
|
434
|
+
EXPECT_TRUE(RE::FullMatch(TypeParam("az"), re));
|
435
|
+
EXPECT_TRUE(RE::FullMatch(TypeParam("axyz"), re));
|
436
|
+
EXPECT_FALSE(RE::FullMatch(TypeParam("baz"), re));
|
437
|
+
EXPECT_FALSE(RE::FullMatch(TypeParam("azy"), re));
|
438
|
+
}
|
439
|
+
|
440
|
+
// Tests RE::PartialMatch().
|
441
|
+
TYPED_TEST(RETest, PartialMatchWorks) {
|
442
|
+
const RE empty(TypeParam(""));
|
443
|
+
EXPECT_TRUE(RE::PartialMatch(TypeParam(""), empty));
|
444
|
+
EXPECT_TRUE(RE::PartialMatch(TypeParam("a"), empty));
|
445
|
+
|
446
|
+
const RE re(TypeParam("a.*z"));
|
447
|
+
EXPECT_TRUE(RE::PartialMatch(TypeParam("az"), re));
|
448
|
+
EXPECT_TRUE(RE::PartialMatch(TypeParam("axyz"), re));
|
449
|
+
EXPECT_TRUE(RE::PartialMatch(TypeParam("baz"), re));
|
450
|
+
EXPECT_TRUE(RE::PartialMatch(TypeParam("azy"), re));
|
451
|
+
EXPECT_FALSE(RE::PartialMatch(TypeParam("zza"), re));
|
452
|
+
}
|
453
|
+
|
454
|
+
# endif // GTEST_HAS_TYPED_TEST
|
455
|
+
|
456
|
+
#elif GTEST_USES_SIMPLE_RE
|
457
|
+
|
458
|
+
TEST(IsInSetTest, NulCharIsNotInAnySet) {
|
459
|
+
EXPECT_FALSE(IsInSet('\0', ""));
|
460
|
+
EXPECT_FALSE(IsInSet('\0', "\0"));
|
461
|
+
EXPECT_FALSE(IsInSet('\0', "a"));
|
462
|
+
}
|
463
|
+
|
464
|
+
TEST(IsInSetTest, WorksForNonNulChars) {
|
465
|
+
EXPECT_FALSE(IsInSet('a', "Ab"));
|
466
|
+
EXPECT_FALSE(IsInSet('c', ""));
|
467
|
+
|
468
|
+
EXPECT_TRUE(IsInSet('b', "bcd"));
|
469
|
+
EXPECT_TRUE(IsInSet('b', "ab"));
|
470
|
+
}
|
471
|
+
|
472
|
+
TEST(IsAsciiDigitTest, IsFalseForNonDigit) {
|
473
|
+
EXPECT_FALSE(IsAsciiDigit('\0'));
|
474
|
+
EXPECT_FALSE(IsAsciiDigit(' '));
|
475
|
+
EXPECT_FALSE(IsAsciiDigit('+'));
|
476
|
+
EXPECT_FALSE(IsAsciiDigit('-'));
|
477
|
+
EXPECT_FALSE(IsAsciiDigit('.'));
|
478
|
+
EXPECT_FALSE(IsAsciiDigit('a'));
|
479
|
+
}
|
480
|
+
|
481
|
+
TEST(IsAsciiDigitTest, IsTrueForDigit) {
|
482
|
+
EXPECT_TRUE(IsAsciiDigit('0'));
|
483
|
+
EXPECT_TRUE(IsAsciiDigit('1'));
|
484
|
+
EXPECT_TRUE(IsAsciiDigit('5'));
|
485
|
+
EXPECT_TRUE(IsAsciiDigit('9'));
|
486
|
+
}
|
487
|
+
|
488
|
+
TEST(IsAsciiPunctTest, IsFalseForNonPunct) {
|
489
|
+
EXPECT_FALSE(IsAsciiPunct('\0'));
|
490
|
+
EXPECT_FALSE(IsAsciiPunct(' '));
|
491
|
+
EXPECT_FALSE(IsAsciiPunct('\n'));
|
492
|
+
EXPECT_FALSE(IsAsciiPunct('a'));
|
493
|
+
EXPECT_FALSE(IsAsciiPunct('0'));
|
494
|
+
}
|
495
|
+
|
496
|
+
TEST(IsAsciiPunctTest, IsTrueForPunct) {
|
497
|
+
for (const char* p = "^-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~"; *p; p++) {
|
498
|
+
EXPECT_PRED1(IsAsciiPunct, *p);
|
499
|
+
}
|
500
|
+
}
|
501
|
+
|
502
|
+
TEST(IsRepeatTest, IsFalseForNonRepeatChar) {
|
503
|
+
EXPECT_FALSE(IsRepeat('\0'));
|
504
|
+
EXPECT_FALSE(IsRepeat(' '));
|
505
|
+
EXPECT_FALSE(IsRepeat('a'));
|
506
|
+
EXPECT_FALSE(IsRepeat('1'));
|
507
|
+
EXPECT_FALSE(IsRepeat('-'));
|
508
|
+
}
|
509
|
+
|
510
|
+
TEST(IsRepeatTest, IsTrueForRepeatChar) {
|
511
|
+
EXPECT_TRUE(IsRepeat('?'));
|
512
|
+
EXPECT_TRUE(IsRepeat('*'));
|
513
|
+
EXPECT_TRUE(IsRepeat('+'));
|
514
|
+
}
|
515
|
+
|
516
|
+
TEST(IsAsciiWhiteSpaceTest, IsFalseForNonWhiteSpace) {
|
517
|
+
EXPECT_FALSE(IsAsciiWhiteSpace('\0'));
|
518
|
+
EXPECT_FALSE(IsAsciiWhiteSpace('a'));
|
519
|
+
EXPECT_FALSE(IsAsciiWhiteSpace('1'));
|
520
|
+
EXPECT_FALSE(IsAsciiWhiteSpace('+'));
|
521
|
+
EXPECT_FALSE(IsAsciiWhiteSpace('_'));
|
522
|
+
}
|
523
|
+
|
524
|
+
TEST(IsAsciiWhiteSpaceTest, IsTrueForWhiteSpace) {
|
525
|
+
EXPECT_TRUE(IsAsciiWhiteSpace(' '));
|
526
|
+
EXPECT_TRUE(IsAsciiWhiteSpace('\n'));
|
527
|
+
EXPECT_TRUE(IsAsciiWhiteSpace('\r'));
|
528
|
+
EXPECT_TRUE(IsAsciiWhiteSpace('\t'));
|
529
|
+
EXPECT_TRUE(IsAsciiWhiteSpace('\v'));
|
530
|
+
EXPECT_TRUE(IsAsciiWhiteSpace('\f'));
|
531
|
+
}
|
532
|
+
|
533
|
+
TEST(IsAsciiWordCharTest, IsFalseForNonWordChar) {
|
534
|
+
EXPECT_FALSE(IsAsciiWordChar('\0'));
|
535
|
+
EXPECT_FALSE(IsAsciiWordChar('+'));
|
536
|
+
EXPECT_FALSE(IsAsciiWordChar('.'));
|
537
|
+
EXPECT_FALSE(IsAsciiWordChar(' '));
|
538
|
+
EXPECT_FALSE(IsAsciiWordChar('\n'));
|
539
|
+
}
|
540
|
+
|
541
|
+
TEST(IsAsciiWordCharTest, IsTrueForLetter) {
|
542
|
+
EXPECT_TRUE(IsAsciiWordChar('a'));
|
543
|
+
EXPECT_TRUE(IsAsciiWordChar('b'));
|
544
|
+
EXPECT_TRUE(IsAsciiWordChar('A'));
|
545
|
+
EXPECT_TRUE(IsAsciiWordChar('Z'));
|
546
|
+
}
|
547
|
+
|
548
|
+
TEST(IsAsciiWordCharTest, IsTrueForDigit) {
|
549
|
+
EXPECT_TRUE(IsAsciiWordChar('0'));
|
550
|
+
EXPECT_TRUE(IsAsciiWordChar('1'));
|
551
|
+
EXPECT_TRUE(IsAsciiWordChar('7'));
|
552
|
+
EXPECT_TRUE(IsAsciiWordChar('9'));
|
553
|
+
}
|
554
|
+
|
555
|
+
TEST(IsAsciiWordCharTest, IsTrueForUnderscore) {
|
556
|
+
EXPECT_TRUE(IsAsciiWordChar('_'));
|
557
|
+
}
|
558
|
+
|
559
|
+
TEST(IsValidEscapeTest, IsFalseForNonPrintable) {
|
560
|
+
EXPECT_FALSE(IsValidEscape('\0'));
|
561
|
+
EXPECT_FALSE(IsValidEscape('\007'));
|
562
|
+
}
|
563
|
+
|
564
|
+
TEST(IsValidEscapeTest, IsFalseForDigit) {
|
565
|
+
EXPECT_FALSE(IsValidEscape('0'));
|
566
|
+
EXPECT_FALSE(IsValidEscape('9'));
|
567
|
+
}
|
568
|
+
|
569
|
+
TEST(IsValidEscapeTest, IsFalseForWhiteSpace) {
|
570
|
+
EXPECT_FALSE(IsValidEscape(' '));
|
571
|
+
EXPECT_FALSE(IsValidEscape('\n'));
|
572
|
+
}
|
573
|
+
|
574
|
+
TEST(IsValidEscapeTest, IsFalseForSomeLetter) {
|
575
|
+
EXPECT_FALSE(IsValidEscape('a'));
|
576
|
+
EXPECT_FALSE(IsValidEscape('Z'));
|
577
|
+
}
|
578
|
+
|
579
|
+
TEST(IsValidEscapeTest, IsTrueForPunct) {
|
580
|
+
EXPECT_TRUE(IsValidEscape('.'));
|
581
|
+
EXPECT_TRUE(IsValidEscape('-'));
|
582
|
+
EXPECT_TRUE(IsValidEscape('^'));
|
583
|
+
EXPECT_TRUE(IsValidEscape('$'));
|
584
|
+
EXPECT_TRUE(IsValidEscape('('));
|
585
|
+
EXPECT_TRUE(IsValidEscape(']'));
|
586
|
+
EXPECT_TRUE(IsValidEscape('{'));
|
587
|
+
EXPECT_TRUE(IsValidEscape('|'));
|
588
|
+
}
|
589
|
+
|
590
|
+
TEST(IsValidEscapeTest, IsTrueForSomeLetter) {
|
591
|
+
EXPECT_TRUE(IsValidEscape('d'));
|
592
|
+
EXPECT_TRUE(IsValidEscape('D'));
|
593
|
+
EXPECT_TRUE(IsValidEscape('s'));
|
594
|
+
EXPECT_TRUE(IsValidEscape('S'));
|
595
|
+
EXPECT_TRUE(IsValidEscape('w'));
|
596
|
+
EXPECT_TRUE(IsValidEscape('W'));
|
597
|
+
}
|
598
|
+
|
599
|
+
TEST(AtomMatchesCharTest, EscapedPunct) {
|
600
|
+
EXPECT_FALSE(AtomMatchesChar(true, '\\', '\0'));
|
601
|
+
EXPECT_FALSE(AtomMatchesChar(true, '\\', ' '));
|
602
|
+
EXPECT_FALSE(AtomMatchesChar(true, '_', '.'));
|
603
|
+
EXPECT_FALSE(AtomMatchesChar(true, '.', 'a'));
|
604
|
+
|
605
|
+
EXPECT_TRUE(AtomMatchesChar(true, '\\', '\\'));
|
606
|
+
EXPECT_TRUE(AtomMatchesChar(true, '_', '_'));
|
607
|
+
EXPECT_TRUE(AtomMatchesChar(true, '+', '+'));
|
608
|
+
EXPECT_TRUE(AtomMatchesChar(true, '.', '.'));
|
609
|
+
}
|
610
|
+
|
611
|
+
TEST(AtomMatchesCharTest, Escaped_d) {
|
612
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'd', '\0'));
|
613
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'd', 'a'));
|
614
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'd', '.'));
|
615
|
+
|
616
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'd', '0'));
|
617
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'd', '9'));
|
618
|
+
}
|
619
|
+
|
620
|
+
TEST(AtomMatchesCharTest, Escaped_D) {
|
621
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'D', '0'));
|
622
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'D', '9'));
|
623
|
+
|
624
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'D', '\0'));
|
625
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'D', 'a'));
|
626
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'D', '-'));
|
627
|
+
}
|
628
|
+
|
629
|
+
TEST(AtomMatchesCharTest, Escaped_s) {
|
630
|
+
EXPECT_FALSE(AtomMatchesChar(true, 's', '\0'));
|
631
|
+
EXPECT_FALSE(AtomMatchesChar(true, 's', 'a'));
|
632
|
+
EXPECT_FALSE(AtomMatchesChar(true, 's', '.'));
|
633
|
+
EXPECT_FALSE(AtomMatchesChar(true, 's', '9'));
|
634
|
+
|
635
|
+
EXPECT_TRUE(AtomMatchesChar(true, 's', ' '));
|
636
|
+
EXPECT_TRUE(AtomMatchesChar(true, 's', '\n'));
|
637
|
+
EXPECT_TRUE(AtomMatchesChar(true, 's', '\t'));
|
638
|
+
}
|
639
|
+
|
640
|
+
TEST(AtomMatchesCharTest, Escaped_S) {
|
641
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'S', ' '));
|
642
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'S', '\r'));
|
643
|
+
|
644
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'S', '\0'));
|
645
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'S', 'a'));
|
646
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'S', '9'));
|
647
|
+
}
|
648
|
+
|
649
|
+
TEST(AtomMatchesCharTest, Escaped_w) {
|
650
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'w', '\0'));
|
651
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'w', '+'));
|
652
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'w', ' '));
|
653
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'w', '\n'));
|
654
|
+
|
655
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'w', '0'));
|
656
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'w', 'b'));
|
657
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'w', 'C'));
|
658
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'w', '_'));
|
659
|
+
}
|
660
|
+
|
661
|
+
TEST(AtomMatchesCharTest, Escaped_W) {
|
662
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'W', 'A'));
|
663
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'W', 'b'));
|
664
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'W', '9'));
|
665
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'W', '_'));
|
666
|
+
|
667
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'W', '\0'));
|
668
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'W', '*'));
|
669
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'W', '\n'));
|
670
|
+
}
|
671
|
+
|
672
|
+
TEST(AtomMatchesCharTest, EscapedWhiteSpace) {
|
673
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'f', '\0'));
|
674
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'f', '\n'));
|
675
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'n', '\0'));
|
676
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'n', '\r'));
|
677
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'r', '\0'));
|
678
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'r', 'a'));
|
679
|
+
EXPECT_FALSE(AtomMatchesChar(true, 't', '\0'));
|
680
|
+
EXPECT_FALSE(AtomMatchesChar(true, 't', 't'));
|
681
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'v', '\0'));
|
682
|
+
EXPECT_FALSE(AtomMatchesChar(true, 'v', '\f'));
|
683
|
+
|
684
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'f', '\f'));
|
685
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'n', '\n'));
|
686
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'r', '\r'));
|
687
|
+
EXPECT_TRUE(AtomMatchesChar(true, 't', '\t'));
|
688
|
+
EXPECT_TRUE(AtomMatchesChar(true, 'v', '\v'));
|
689
|
+
}
|
690
|
+
|
691
|
+
TEST(AtomMatchesCharTest, UnescapedDot) {
|
692
|
+
EXPECT_FALSE(AtomMatchesChar(false, '.', '\n'));
|
693
|
+
|
694
|
+
EXPECT_TRUE(AtomMatchesChar(false, '.', '\0'));
|
695
|
+
EXPECT_TRUE(AtomMatchesChar(false, '.', '.'));
|
696
|
+
EXPECT_TRUE(AtomMatchesChar(false, '.', 'a'));
|
697
|
+
EXPECT_TRUE(AtomMatchesChar(false, '.', ' '));
|
698
|
+
}
|
699
|
+
|
700
|
+
TEST(AtomMatchesCharTest, UnescapedChar) {
|
701
|
+
EXPECT_FALSE(AtomMatchesChar(false, 'a', '\0'));
|
702
|
+
EXPECT_FALSE(AtomMatchesChar(false, 'a', 'b'));
|
703
|
+
EXPECT_FALSE(AtomMatchesChar(false, '$', 'a'));
|
704
|
+
|
705
|
+
EXPECT_TRUE(AtomMatchesChar(false, '$', '$'));
|
706
|
+
EXPECT_TRUE(AtomMatchesChar(false, '5', '5'));
|
707
|
+
EXPECT_TRUE(AtomMatchesChar(false, 'Z', 'Z'));
|
708
|
+
}
|
709
|
+
|
710
|
+
TEST(ValidateRegexTest, GeneratesFailureAndReturnsFalseForInvalid) {
|
711
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex(NULL)),
|
712
|
+
"NULL is not a valid simple regular expression");
|
713
|
+
EXPECT_NONFATAL_FAILURE(
|
714
|
+
ASSERT_FALSE(ValidateRegex("a\\")),
|
715
|
+
"Syntax error at index 1 in simple regular expression \"a\\\": ");
|
716
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("a\\")),
|
717
|
+
"'\\' cannot appear at the end");
|
718
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("\\n\\")),
|
719
|
+
"'\\' cannot appear at the end");
|
720
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("\\s\\hb")),
|
721
|
+
"invalid escape sequence \"\\h\"");
|
722
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("^^")),
|
723
|
+
"'^' can only appear at the beginning");
|
724
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex(".*^b")),
|
725
|
+
"'^' can only appear at the beginning");
|
726
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("$$")),
|
727
|
+
"'$' can only appear at the end");
|
728
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("^$a")),
|
729
|
+
"'$' can only appear at the end");
|
730
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("a(b")),
|
731
|
+
"'(' is unsupported");
|
732
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("ab)")),
|
733
|
+
"')' is unsupported");
|
734
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("[ab")),
|
735
|
+
"'[' is unsupported");
|
736
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("a{2")),
|
737
|
+
"'{' is unsupported");
|
738
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("?")),
|
739
|
+
"'?' can only follow a repeatable token");
|
740
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("^*")),
|
741
|
+
"'*' can only follow a repeatable token");
|
742
|
+
EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("5*+")),
|
743
|
+
"'+' can only follow a repeatable token");
|
744
|
+
}
|
745
|
+
|
746
|
+
TEST(ValidateRegexTest, ReturnsTrueForValid) {
|
747
|
+
EXPECT_TRUE(ValidateRegex(""));
|
748
|
+
EXPECT_TRUE(ValidateRegex("a"));
|
749
|
+
EXPECT_TRUE(ValidateRegex(".*"));
|
750
|
+
EXPECT_TRUE(ValidateRegex("^a_+"));
|
751
|
+
EXPECT_TRUE(ValidateRegex("^a\\t\\&?"));
|
752
|
+
EXPECT_TRUE(ValidateRegex("09*$"));
|
753
|
+
EXPECT_TRUE(ValidateRegex("^Z$"));
|
754
|
+
EXPECT_TRUE(ValidateRegex("a\\^Z\\$\\(\\)\\|\\[\\]\\{\\}"));
|
755
|
+
}
|
756
|
+
|
757
|
+
TEST(MatchRepetitionAndRegexAtHeadTest, WorksForZeroOrOne) {
|
758
|
+
EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "a", "ba"));
|
759
|
+
// Repeating more than once.
|
760
|
+
EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "b", "aab"));
|
761
|
+
|
762
|
+
// Repeating zero times.
|
763
|
+
EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "b", "ba"));
|
764
|
+
// Repeating once.
|
765
|
+
EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "b", "ab"));
|
766
|
+
EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '#', '?', ".", "##"));
|
767
|
+
}
|
768
|
+
|
769
|
+
TEST(MatchRepetitionAndRegexAtHeadTest, WorksForZeroOrMany) {
|
770
|
+
EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, '.', '*', "a$", "baab"));
|
771
|
+
|
772
|
+
// Repeating zero times.
|
773
|
+
EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '.', '*', "b", "bc"));
|
774
|
+
// Repeating once.
|
775
|
+
EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '.', '*', "b", "abc"));
|
776
|
+
// Repeating more than once.
|
777
|
+
EXPECT_TRUE(MatchRepetitionAndRegexAtHead(true, 'w', '*', "-", "ab_1-g"));
|
778
|
+
}
|
779
|
+
|
780
|
+
TEST(MatchRepetitionAndRegexAtHeadTest, WorksForOneOrMany) {
|
781
|
+
EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, '.', '+', "a$", "baab"));
|
782
|
+
// Repeating zero times.
|
783
|
+
EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, '.', '+', "b", "bc"));
|
784
|
+
|
785
|
+
// Repeating once.
|
786
|
+
EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '.', '+', "b", "abc"));
|
787
|
+
// Repeating more than once.
|
788
|
+
EXPECT_TRUE(MatchRepetitionAndRegexAtHead(true, 'w', '+', "-", "ab_1-g"));
|
789
|
+
}
|
790
|
+
|
791
|
+
TEST(MatchRegexAtHeadTest, ReturnsTrueForEmptyRegex) {
|
792
|
+
EXPECT_TRUE(MatchRegexAtHead("", ""));
|
793
|
+
EXPECT_TRUE(MatchRegexAtHead("", "ab"));
|
794
|
+
}
|
795
|
+
|
796
|
+
TEST(MatchRegexAtHeadTest, WorksWhenDollarIsInRegex) {
|
797
|
+
EXPECT_FALSE(MatchRegexAtHead("$", "a"));
|
798
|
+
|
799
|
+
EXPECT_TRUE(MatchRegexAtHead("$", ""));
|
800
|
+
EXPECT_TRUE(MatchRegexAtHead("a$", "a"));
|
801
|
+
}
|
802
|
+
|
803
|
+
TEST(MatchRegexAtHeadTest, WorksWhenRegexStartsWithEscapeSequence) {
|
804
|
+
EXPECT_FALSE(MatchRegexAtHead("\\w", "+"));
|
805
|
+
EXPECT_FALSE(MatchRegexAtHead("\\W", "ab"));
|
806
|
+
|
807
|
+
EXPECT_TRUE(MatchRegexAtHead("\\sa", "\nab"));
|
808
|
+
EXPECT_TRUE(MatchRegexAtHead("\\d", "1a"));
|
809
|
+
}
|
810
|
+
|
811
|
+
TEST(MatchRegexAtHeadTest, WorksWhenRegexStartsWithRepetition) {
|
812
|
+
EXPECT_FALSE(MatchRegexAtHead(".+a", "abc"));
|
813
|
+
EXPECT_FALSE(MatchRegexAtHead("a?b", "aab"));
|
814
|
+
|
815
|
+
EXPECT_TRUE(MatchRegexAtHead(".*a", "bc12-ab"));
|
816
|
+
EXPECT_TRUE(MatchRegexAtHead("a?b", "b"));
|
817
|
+
EXPECT_TRUE(MatchRegexAtHead("a?b", "ab"));
|
818
|
+
}
|
819
|
+
|
820
|
+
TEST(MatchRegexAtHeadTest,
|
821
|
+
WorksWhenRegexStartsWithRepetionOfEscapeSequence) {
|
822
|
+
EXPECT_FALSE(MatchRegexAtHead("\\.+a", "abc"));
|
823
|
+
EXPECT_FALSE(MatchRegexAtHead("\\s?b", " b"));
|
824
|
+
|
825
|
+
EXPECT_TRUE(MatchRegexAtHead("\\(*a", "((((ab"));
|
826
|
+
EXPECT_TRUE(MatchRegexAtHead("\\^?b", "^b"));
|
827
|
+
EXPECT_TRUE(MatchRegexAtHead("\\\\?b", "b"));
|
828
|
+
EXPECT_TRUE(MatchRegexAtHead("\\\\?b", "\\b"));
|
829
|
+
}
|
830
|
+
|
831
|
+
TEST(MatchRegexAtHeadTest, MatchesSequentially) {
|
832
|
+
EXPECT_FALSE(MatchRegexAtHead("ab.*c", "acabc"));
|
833
|
+
|
834
|
+
EXPECT_TRUE(MatchRegexAtHead("ab.*c", "ab-fsc"));
|
835
|
+
}
|
836
|
+
|
837
|
+
TEST(MatchRegexAnywhereTest, ReturnsFalseWhenStringIsNull) {
|
838
|
+
EXPECT_FALSE(MatchRegexAnywhere("", NULL));
|
839
|
+
}
|
840
|
+
|
841
|
+
TEST(MatchRegexAnywhereTest, WorksWhenRegexStartsWithCaret) {
|
842
|
+
EXPECT_FALSE(MatchRegexAnywhere("^a", "ba"));
|
843
|
+
EXPECT_FALSE(MatchRegexAnywhere("^$", "a"));
|
844
|
+
|
845
|
+
EXPECT_TRUE(MatchRegexAnywhere("^a", "ab"));
|
846
|
+
EXPECT_TRUE(MatchRegexAnywhere("^", "ab"));
|
847
|
+
EXPECT_TRUE(MatchRegexAnywhere("^$", ""));
|
848
|
+
}
|
849
|
+
|
850
|
+
TEST(MatchRegexAnywhereTest, ReturnsFalseWhenNoMatch) {
|
851
|
+
EXPECT_FALSE(MatchRegexAnywhere("a", "bcde123"));
|
852
|
+
EXPECT_FALSE(MatchRegexAnywhere("a.+a", "--aa88888888"));
|
853
|
+
}
|
854
|
+
|
855
|
+
TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingPrefix) {
|
856
|
+
EXPECT_TRUE(MatchRegexAnywhere("\\w+", "ab1_ - 5"));
|
857
|
+
EXPECT_TRUE(MatchRegexAnywhere(".*=", "="));
|
858
|
+
EXPECT_TRUE(MatchRegexAnywhere("x.*ab?.*bc", "xaaabc"));
|
859
|
+
}
|
860
|
+
|
861
|
+
TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingNonPrefix) {
|
862
|
+
EXPECT_TRUE(MatchRegexAnywhere("\\w+", "$$$ ab1_ - 5"));
|
863
|
+
EXPECT_TRUE(MatchRegexAnywhere("\\.+=", "= ...="));
|
864
|
+
}
|
865
|
+
|
866
|
+
// Tests RE's implicit constructors.
|
867
|
+
TEST(RETest, ImplicitConstructorWorks) {
|
868
|
+
const RE empty("");
|
869
|
+
EXPECT_STREQ("", empty.pattern());
|
870
|
+
|
871
|
+
const RE simple("hello");
|
872
|
+
EXPECT_STREQ("hello", simple.pattern());
|
873
|
+
}
|
874
|
+
|
875
|
+
// Tests that RE's constructors reject invalid regular expressions.
|
876
|
+
TEST(RETest, RejectsInvalidRegex) {
|
877
|
+
EXPECT_NONFATAL_FAILURE({
|
878
|
+
const RE normal(NULL);
|
879
|
+
}, "NULL is not a valid simple regular expression");
|
880
|
+
|
881
|
+
EXPECT_NONFATAL_FAILURE({
|
882
|
+
const RE normal(".*(\\w+");
|
883
|
+
}, "'(' is unsupported");
|
884
|
+
|
885
|
+
EXPECT_NONFATAL_FAILURE({
|
886
|
+
const RE invalid("^?");
|
887
|
+
}, "'?' can only follow a repeatable token");
|
888
|
+
}
|
889
|
+
|
890
|
+
// Tests RE::FullMatch().
|
891
|
+
TEST(RETest, FullMatchWorks) {
|
892
|
+
const RE empty("");
|
893
|
+
EXPECT_TRUE(RE::FullMatch("", empty));
|
894
|
+
EXPECT_FALSE(RE::FullMatch("a", empty));
|
895
|
+
|
896
|
+
const RE re1("a");
|
897
|
+
EXPECT_TRUE(RE::FullMatch("a", re1));
|
898
|
+
|
899
|
+
const RE re("a.*z");
|
900
|
+
EXPECT_TRUE(RE::FullMatch("az", re));
|
901
|
+
EXPECT_TRUE(RE::FullMatch("axyz", re));
|
902
|
+
EXPECT_FALSE(RE::FullMatch("baz", re));
|
903
|
+
EXPECT_FALSE(RE::FullMatch("azy", re));
|
904
|
+
}
|
905
|
+
|
906
|
+
// Tests RE::PartialMatch().
|
907
|
+
TEST(RETest, PartialMatchWorks) {
|
908
|
+
const RE empty("");
|
909
|
+
EXPECT_TRUE(RE::PartialMatch("", empty));
|
910
|
+
EXPECT_TRUE(RE::PartialMatch("a", empty));
|
911
|
+
|
912
|
+
const RE re("a.*z");
|
913
|
+
EXPECT_TRUE(RE::PartialMatch("az", re));
|
914
|
+
EXPECT_TRUE(RE::PartialMatch("axyz", re));
|
915
|
+
EXPECT_TRUE(RE::PartialMatch("baz", re));
|
916
|
+
EXPECT_TRUE(RE::PartialMatch("azy", re));
|
917
|
+
EXPECT_FALSE(RE::PartialMatch("zza", re));
|
918
|
+
}
|
919
|
+
|
920
|
+
#endif // GTEST_USES_POSIX_RE
|
921
|
+
|
922
|
+
#if !GTEST_OS_WINDOWS_MOBILE
|
923
|
+
|
924
|
+
TEST(CaptureTest, CapturesStdout) {
|
925
|
+
CaptureStdout();
|
926
|
+
fprintf(stdout, "abc");
|
927
|
+
EXPECT_STREQ("abc", GetCapturedStdout().c_str());
|
928
|
+
|
929
|
+
CaptureStdout();
|
930
|
+
fprintf(stdout, "def%cghi", '\0');
|
931
|
+
EXPECT_EQ(::std::string("def\0ghi", 7), ::std::string(GetCapturedStdout()));
|
932
|
+
}
|
933
|
+
|
934
|
+
TEST(CaptureTest, CapturesStderr) {
|
935
|
+
CaptureStderr();
|
936
|
+
fprintf(stderr, "jkl");
|
937
|
+
EXPECT_STREQ("jkl", GetCapturedStderr().c_str());
|
938
|
+
|
939
|
+
CaptureStderr();
|
940
|
+
fprintf(stderr, "jkl%cmno", '\0');
|
941
|
+
EXPECT_EQ(::std::string("jkl\0mno", 7), ::std::string(GetCapturedStderr()));
|
942
|
+
}
|
943
|
+
|
944
|
+
// Tests that stdout and stderr capture don't interfere with each other.
|
945
|
+
TEST(CaptureTest, CapturesStdoutAndStderr) {
|
946
|
+
CaptureStdout();
|
947
|
+
CaptureStderr();
|
948
|
+
fprintf(stdout, "pqr");
|
949
|
+
fprintf(stderr, "stu");
|
950
|
+
EXPECT_STREQ("pqr", GetCapturedStdout().c_str());
|
951
|
+
EXPECT_STREQ("stu", GetCapturedStderr().c_str());
|
952
|
+
}
|
953
|
+
|
954
|
+
TEST(CaptureDeathTest, CannotReenterStdoutCapture) {
|
955
|
+
CaptureStdout();
|
956
|
+
EXPECT_DEATH_IF_SUPPORTED(CaptureStdout(),
|
957
|
+
"Only one stdout capturer can exist at a time");
|
958
|
+
GetCapturedStdout();
|
959
|
+
|
960
|
+
// We cannot test stderr capturing using death tests as they use it
|
961
|
+
// themselves.
|
962
|
+
}
|
963
|
+
|
964
|
+
#endif // !GTEST_OS_WINDOWS_MOBILE
|
965
|
+
|
966
|
+
TEST(ThreadLocalTest, DefaultConstructorInitializesToDefaultValues) {
|
967
|
+
ThreadLocal<int> t1;
|
968
|
+
EXPECT_EQ(0, t1.get());
|
969
|
+
|
970
|
+
ThreadLocal<void*> t2;
|
971
|
+
EXPECT_TRUE(t2.get() == NULL);
|
972
|
+
}
|
973
|
+
|
974
|
+
TEST(ThreadLocalTest, SingleParamConstructorInitializesToParam) {
|
975
|
+
ThreadLocal<int> t1(123);
|
976
|
+
EXPECT_EQ(123, t1.get());
|
977
|
+
|
978
|
+
int i = 0;
|
979
|
+
ThreadLocal<int*> t2(&i);
|
980
|
+
EXPECT_EQ(&i, t2.get());
|
981
|
+
}
|
982
|
+
|
983
|
+
class NoDefaultContructor {
|
984
|
+
public:
|
985
|
+
explicit NoDefaultContructor(const char*) {}
|
986
|
+
NoDefaultContructor(const NoDefaultContructor&) {}
|
987
|
+
};
|
988
|
+
|
989
|
+
TEST(ThreadLocalTest, ValueDefaultContructorIsNotRequiredForParamVersion) {
|
990
|
+
ThreadLocal<NoDefaultContructor> bar(NoDefaultContructor("foo"));
|
991
|
+
bar.pointer();
|
992
|
+
}
|
993
|
+
|
994
|
+
TEST(ThreadLocalTest, GetAndPointerReturnSameValue) {
|
995
|
+
ThreadLocal<std::string> thread_local_string;
|
996
|
+
|
997
|
+
EXPECT_EQ(thread_local_string.pointer(), &(thread_local_string.get()));
|
998
|
+
|
999
|
+
// Verifies the condition still holds after calling set.
|
1000
|
+
thread_local_string.set("foo");
|
1001
|
+
EXPECT_EQ(thread_local_string.pointer(), &(thread_local_string.get()));
|
1002
|
+
}
|
1003
|
+
|
1004
|
+
TEST(ThreadLocalTest, PointerAndConstPointerReturnSameValue) {
|
1005
|
+
ThreadLocal<std::string> thread_local_string;
|
1006
|
+
const ThreadLocal<std::string>& const_thread_local_string =
|
1007
|
+
thread_local_string;
|
1008
|
+
|
1009
|
+
EXPECT_EQ(thread_local_string.pointer(), const_thread_local_string.pointer());
|
1010
|
+
|
1011
|
+
thread_local_string.set("foo");
|
1012
|
+
EXPECT_EQ(thread_local_string.pointer(), const_thread_local_string.pointer());
|
1013
|
+
}
|
1014
|
+
|
1015
|
+
#if GTEST_IS_THREADSAFE
|
1016
|
+
|
1017
|
+
void AddTwo(int* param) { *param += 2; }
|
1018
|
+
|
1019
|
+
TEST(ThreadWithParamTest, ConstructorExecutesThreadFunc) {
|
1020
|
+
int i = 40;
|
1021
|
+
ThreadWithParam<int*> thread(&AddTwo, &i, NULL);
|
1022
|
+
thread.Join();
|
1023
|
+
EXPECT_EQ(42, i);
|
1024
|
+
}
|
1025
|
+
|
1026
|
+
TEST(MutexDeathTest, AssertHeldShouldAssertWhenNotLocked) {
|
1027
|
+
// AssertHeld() is flaky only in the presence of multiple threads accessing
|
1028
|
+
// the lock. In this case, the test is robust.
|
1029
|
+
EXPECT_DEATH_IF_SUPPORTED({
|
1030
|
+
Mutex m;
|
1031
|
+
{ MutexLock lock(&m); }
|
1032
|
+
m.AssertHeld();
|
1033
|
+
},
|
1034
|
+
"thread .*hold");
|
1035
|
+
}
|
1036
|
+
|
1037
|
+
TEST(MutexTest, AssertHeldShouldNotAssertWhenLocked) {
|
1038
|
+
Mutex m;
|
1039
|
+
MutexLock lock(&m);
|
1040
|
+
m.AssertHeld();
|
1041
|
+
}
|
1042
|
+
|
1043
|
+
class AtomicCounterWithMutex {
|
1044
|
+
public:
|
1045
|
+
explicit AtomicCounterWithMutex(Mutex* mutex) :
|
1046
|
+
value_(0), mutex_(mutex), random_(42) {}
|
1047
|
+
|
1048
|
+
void Increment() {
|
1049
|
+
MutexLock lock(mutex_);
|
1050
|
+
int temp = value_;
|
1051
|
+
{
|
1052
|
+
// We need to put up a memory barrier to prevent reads and writes to
|
1053
|
+
// value_ rearranged with the call to SleepMilliseconds when observed
|
1054
|
+
// from other threads.
|
1055
|
+
#if GTEST_HAS_PTHREAD
|
1056
|
+
// On POSIX, locking a mutex puts up a memory barrier. We cannot use
|
1057
|
+
// Mutex and MutexLock here or rely on their memory barrier
|
1058
|
+
// functionality as we are testing them here.
|
1059
|
+
pthread_mutex_t memory_barrier_mutex;
|
1060
|
+
GTEST_CHECK_POSIX_SUCCESS_(
|
1061
|
+
pthread_mutex_init(&memory_barrier_mutex, NULL));
|
1062
|
+
GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&memory_barrier_mutex));
|
1063
|
+
|
1064
|
+
SleepMilliseconds(random_.Generate(30));
|
1065
|
+
|
1066
|
+
GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&memory_barrier_mutex));
|
1067
|
+
GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&memory_barrier_mutex));
|
1068
|
+
#elif GTEST_OS_WINDOWS
|
1069
|
+
// On Windows, performing an interlocked access puts up a memory barrier.
|
1070
|
+
volatile LONG dummy = 0;
|
1071
|
+
::InterlockedIncrement(&dummy);
|
1072
|
+
SleepMilliseconds(random_.Generate(30));
|
1073
|
+
::InterlockedIncrement(&dummy);
|
1074
|
+
#else
|
1075
|
+
# error "Memory barrier not implemented on this platform."
|
1076
|
+
#endif // GTEST_HAS_PTHREAD
|
1077
|
+
}
|
1078
|
+
value_ = temp + 1;
|
1079
|
+
}
|
1080
|
+
int value() const { return value_; }
|
1081
|
+
|
1082
|
+
private:
|
1083
|
+
volatile int value_;
|
1084
|
+
Mutex* const mutex_; // Protects value_.
|
1085
|
+
Random random_;
|
1086
|
+
};
|
1087
|
+
|
1088
|
+
void CountingThreadFunc(pair<AtomicCounterWithMutex*, int> param) {
|
1089
|
+
for (int i = 0; i < param.second; ++i)
|
1090
|
+
param.first->Increment();
|
1091
|
+
}
|
1092
|
+
|
1093
|
+
// Tests that the mutex only lets one thread at a time to lock it.
|
1094
|
+
TEST(MutexTest, OnlyOneThreadCanLockAtATime) {
|
1095
|
+
Mutex mutex;
|
1096
|
+
AtomicCounterWithMutex locked_counter(&mutex);
|
1097
|
+
|
1098
|
+
typedef ThreadWithParam<pair<AtomicCounterWithMutex*, int> > ThreadType;
|
1099
|
+
const int kCycleCount = 20;
|
1100
|
+
const int kThreadCount = 7;
|
1101
|
+
scoped_ptr<ThreadType> counting_threads[kThreadCount];
|
1102
|
+
Notification threads_can_start;
|
1103
|
+
// Creates and runs kThreadCount threads that increment locked_counter
|
1104
|
+
// kCycleCount times each.
|
1105
|
+
for (int i = 0; i < kThreadCount; ++i) {
|
1106
|
+
counting_threads[i].reset(new ThreadType(&CountingThreadFunc,
|
1107
|
+
make_pair(&locked_counter,
|
1108
|
+
kCycleCount),
|
1109
|
+
&threads_can_start));
|
1110
|
+
}
|
1111
|
+
threads_can_start.Notify();
|
1112
|
+
for (int i = 0; i < kThreadCount; ++i)
|
1113
|
+
counting_threads[i]->Join();
|
1114
|
+
|
1115
|
+
// If the mutex lets more than one thread to increment the counter at a
|
1116
|
+
// time, they are likely to encounter a race condition and have some
|
1117
|
+
// increments overwritten, resulting in the lower then expected counter
|
1118
|
+
// value.
|
1119
|
+
EXPECT_EQ(kCycleCount * kThreadCount, locked_counter.value());
|
1120
|
+
}
|
1121
|
+
|
1122
|
+
template <typename T>
|
1123
|
+
void RunFromThread(void (func)(T), T param) {
|
1124
|
+
ThreadWithParam<T> thread(func, param, NULL);
|
1125
|
+
thread.Join();
|
1126
|
+
}
|
1127
|
+
|
1128
|
+
void RetrieveThreadLocalValue(
|
1129
|
+
pair<ThreadLocal<std::string>*, std::string*> param) {
|
1130
|
+
*param.second = param.first->get();
|
1131
|
+
}
|
1132
|
+
|
1133
|
+
TEST(ThreadLocalTest, ParameterizedConstructorSetsDefault) {
|
1134
|
+
ThreadLocal<std::string> thread_local_string("foo");
|
1135
|
+
EXPECT_STREQ("foo", thread_local_string.get().c_str());
|
1136
|
+
|
1137
|
+
thread_local_string.set("bar");
|
1138
|
+
EXPECT_STREQ("bar", thread_local_string.get().c_str());
|
1139
|
+
|
1140
|
+
std::string result;
|
1141
|
+
RunFromThread(&RetrieveThreadLocalValue,
|
1142
|
+
make_pair(&thread_local_string, &result));
|
1143
|
+
EXPECT_STREQ("foo", result.c_str());
|
1144
|
+
}
|
1145
|
+
|
1146
|
+
// Keeps track of whether of destructors being called on instances of
|
1147
|
+
// DestructorTracker. On Windows, waits for the destructor call reports.
|
1148
|
+
class DestructorCall {
|
1149
|
+
public:
|
1150
|
+
DestructorCall() {
|
1151
|
+
invoked_ = false;
|
1152
|
+
#if GTEST_OS_WINDOWS
|
1153
|
+
wait_event_.Reset(::CreateEvent(NULL, TRUE, FALSE, NULL));
|
1154
|
+
GTEST_CHECK_(wait_event_.Get() != NULL);
|
1155
|
+
#endif
|
1156
|
+
}
|
1157
|
+
|
1158
|
+
bool CheckDestroyed() const {
|
1159
|
+
#if GTEST_OS_WINDOWS
|
1160
|
+
if (::WaitForSingleObject(wait_event_.Get(), 1000) != WAIT_OBJECT_0)
|
1161
|
+
return false;
|
1162
|
+
#endif
|
1163
|
+
return invoked_;
|
1164
|
+
}
|
1165
|
+
|
1166
|
+
void ReportDestroyed() {
|
1167
|
+
invoked_ = true;
|
1168
|
+
#if GTEST_OS_WINDOWS
|
1169
|
+
::SetEvent(wait_event_.Get());
|
1170
|
+
#endif
|
1171
|
+
}
|
1172
|
+
|
1173
|
+
static std::vector<DestructorCall*>& List() { return *list_; }
|
1174
|
+
|
1175
|
+
static void ResetList() {
|
1176
|
+
for (size_t i = 0; i < list_->size(); ++i) {
|
1177
|
+
delete list_->at(i);
|
1178
|
+
}
|
1179
|
+
list_->clear();
|
1180
|
+
}
|
1181
|
+
|
1182
|
+
private:
|
1183
|
+
bool invoked_;
|
1184
|
+
#if GTEST_OS_WINDOWS
|
1185
|
+
AutoHandle wait_event_;
|
1186
|
+
#endif
|
1187
|
+
static std::vector<DestructorCall*>* const list_;
|
1188
|
+
|
1189
|
+
GTEST_DISALLOW_COPY_AND_ASSIGN_(DestructorCall);
|
1190
|
+
};
|
1191
|
+
|
1192
|
+
std::vector<DestructorCall*>* const DestructorCall::list_ =
|
1193
|
+
new std::vector<DestructorCall*>;
|
1194
|
+
|
1195
|
+
// DestructorTracker keeps track of whether its instances have been
|
1196
|
+
// destroyed.
|
1197
|
+
class DestructorTracker {
|
1198
|
+
public:
|
1199
|
+
DestructorTracker() : index_(GetNewIndex()) {}
|
1200
|
+
DestructorTracker(const DestructorTracker& /* rhs */)
|
1201
|
+
: index_(GetNewIndex()) {}
|
1202
|
+
~DestructorTracker() {
|
1203
|
+
// We never access DestructorCall::List() concurrently, so we don't need
|
1204
|
+
// to protect this access with a mutex.
|
1205
|
+
DestructorCall::List()[index_]->ReportDestroyed();
|
1206
|
+
}
|
1207
|
+
|
1208
|
+
private:
|
1209
|
+
static size_t GetNewIndex() {
|
1210
|
+
DestructorCall::List().push_back(new DestructorCall);
|
1211
|
+
return DestructorCall::List().size() - 1;
|
1212
|
+
}
|
1213
|
+
const size_t index_;
|
1214
|
+
|
1215
|
+
GTEST_DISALLOW_ASSIGN_(DestructorTracker);
|
1216
|
+
};
|
1217
|
+
|
1218
|
+
typedef ThreadLocal<DestructorTracker>* ThreadParam;
|
1219
|
+
|
1220
|
+
void CallThreadLocalGet(ThreadParam thread_local_param) {
|
1221
|
+
thread_local_param->get();
|
1222
|
+
}
|
1223
|
+
|
1224
|
+
// Tests that when a ThreadLocal object dies in a thread, it destroys
|
1225
|
+
// the managed object for that thread.
|
1226
|
+
TEST(ThreadLocalTest, DestroysManagedObjectForOwnThreadWhenDying) {
|
1227
|
+
DestructorCall::ResetList();
|
1228
|
+
|
1229
|
+
{
|
1230
|
+
ThreadLocal<DestructorTracker> thread_local_tracker;
|
1231
|
+
ASSERT_EQ(0U, DestructorCall::List().size());
|
1232
|
+
|
1233
|
+
// This creates another DestructorTracker object for the main thread.
|
1234
|
+
thread_local_tracker.get();
|
1235
|
+
ASSERT_EQ(1U, DestructorCall::List().size());
|
1236
|
+
ASSERT_FALSE(DestructorCall::List()[0]->CheckDestroyed());
|
1237
|
+
}
|
1238
|
+
|
1239
|
+
// Now thread_local_tracker has died.
|
1240
|
+
ASSERT_EQ(1U, DestructorCall::List().size());
|
1241
|
+
EXPECT_TRUE(DestructorCall::List()[0]->CheckDestroyed());
|
1242
|
+
|
1243
|
+
DestructorCall::ResetList();
|
1244
|
+
}
|
1245
|
+
|
1246
|
+
// Tests that when a thread exits, the thread-local object for that
|
1247
|
+
// thread is destroyed.
|
1248
|
+
TEST(ThreadLocalTest, DestroysManagedObjectAtThreadExit) {
|
1249
|
+
DestructorCall::ResetList();
|
1250
|
+
|
1251
|
+
{
|
1252
|
+
ThreadLocal<DestructorTracker> thread_local_tracker;
|
1253
|
+
ASSERT_EQ(0U, DestructorCall::List().size());
|
1254
|
+
|
1255
|
+
// This creates another DestructorTracker object in the new thread.
|
1256
|
+
ThreadWithParam<ThreadParam> thread(
|
1257
|
+
&CallThreadLocalGet, &thread_local_tracker, NULL);
|
1258
|
+
thread.Join();
|
1259
|
+
|
1260
|
+
// The thread has exited, and we should have a DestroyedTracker
|
1261
|
+
// instance created for it. But it may not have been destroyed yet.
|
1262
|
+
ASSERT_EQ(1U, DestructorCall::List().size());
|
1263
|
+
}
|
1264
|
+
|
1265
|
+
// The thread has exited and thread_local_tracker has died.
|
1266
|
+
ASSERT_EQ(1U, DestructorCall::List().size());
|
1267
|
+
EXPECT_TRUE(DestructorCall::List()[0]->CheckDestroyed());
|
1268
|
+
|
1269
|
+
DestructorCall::ResetList();
|
1270
|
+
}
|
1271
|
+
|
1272
|
+
TEST(ThreadLocalTest, ThreadLocalMutationsAffectOnlyCurrentThread) {
|
1273
|
+
ThreadLocal<std::string> thread_local_string;
|
1274
|
+
thread_local_string.set("Foo");
|
1275
|
+
EXPECT_STREQ("Foo", thread_local_string.get().c_str());
|
1276
|
+
|
1277
|
+
std::string result;
|
1278
|
+
RunFromThread(&RetrieveThreadLocalValue,
|
1279
|
+
make_pair(&thread_local_string, &result));
|
1280
|
+
EXPECT_TRUE(result.empty());
|
1281
|
+
}
|
1282
|
+
|
1283
|
+
#endif // GTEST_IS_THREADSAFE
|
1284
|
+
|
1285
|
+
#if GTEST_OS_WINDOWS
|
1286
|
+
TEST(WindowsTypesTest, HANDLEIsVoidStar) {
|
1287
|
+
StaticAssertTypeEq<HANDLE, void*>();
|
1288
|
+
}
|
1289
|
+
|
1290
|
+
#if GTEST_OS_WINDOWS_MINGW && !defined(__MINGW64_VERSION_MAJOR)
|
1291
|
+
TEST(WindowsTypesTest, _CRITICAL_SECTIONIs_CRITICAL_SECTION) {
|
1292
|
+
StaticAssertTypeEq<CRITICAL_SECTION, _CRITICAL_SECTION>();
|
1293
|
+
}
|
1294
|
+
#else
|
1295
|
+
TEST(WindowsTypesTest, CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION) {
|
1296
|
+
StaticAssertTypeEq<CRITICAL_SECTION, _RTL_CRITICAL_SECTION>();
|
1297
|
+
}
|
1298
|
+
#endif
|
1299
|
+
|
1300
|
+
#endif // GTEST_OS_WINDOWS
|
1301
|
+
|
1302
|
+
} // namespace internal
|
1303
|
+
} // namespace testing
|