rj_schema 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +3 -615
- data/ext/rj_schema/rapidjson/CHANGELOG.md +0 -158
- data/ext/rj_schema/rapidjson/CMakeLists.txt +0 -221
- data/ext/rj_schema/rapidjson/CMakeModules/FindGTestSrc.cmake +0 -30
- data/ext/rj_schema/rapidjson/RapidJSON.pc.in +0 -7
- data/ext/rj_schema/rapidjson/RapidJSONConfig.cmake.in +0 -15
- data/ext/rj_schema/rapidjson/RapidJSONConfigVersion.cmake.in +0 -10
- data/ext/rj_schema/rapidjson/appveyor.yml +0 -41
- data/ext/rj_schema/rapidjson/bin/data/glossary.json +0 -22
- data/ext/rj_schema/rapidjson/bin/data/menu.json +0 -27
- data/ext/rj_schema/rapidjson/bin/data/readme.txt +0 -1
- data/ext/rj_schema/rapidjson/bin/data/sample.json +0 -3315
- data/ext/rj_schema/rapidjson/bin/data/webapp.json +0 -88
- data/ext/rj_schema/rapidjson/bin/data/widget.json +0 -26
- data/ext/rj_schema/rapidjson/bin/draft-04/schema +0 -150
- 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 +0 -7
- data/ext/rj_schema/rapidjson/bin/encodings/utf8bom.json +0 -7
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail1.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail10.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail11.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail12.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail13.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail14.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail15.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail16.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail17.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail18.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail19.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail2.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail20.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail21.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail22.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail23.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail24.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail25.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail26.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail27.json +0 -2
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail28.json +0 -2
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail29.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail3.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail30.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail31.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail32.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail33.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail4.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail5.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail6.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail7.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail8.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail9.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass1.json +0 -58
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass2.json +0 -1
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass3.json +0 -6
- data/ext/rj_schema/rapidjson/bin/jsonchecker/readme.txt +0 -3
- data/ext/rj_schema/rapidjson/bin/jsonschema/LICENSE +0 -19
- data/ext/rj_schema/rapidjson/bin/jsonschema/README.md +0 -148
- data/ext/rj_schema/rapidjson/bin/jsonschema/bin/jsonschema_suite +0 -283
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json +0 -3
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/integer.json +0 -3
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/subSchemas.json +0 -8
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json +0 -82
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json +0 -88
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/default.json +0 -49
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/dependencies.json +0 -108
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/disallow.json +0 -80
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json +0 -60
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/enum.json +0 -71
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/extends.json +0 -94
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/items.json +0 -46
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxItems.json +0 -28
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxLength.json +0 -33
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maximum.json +0 -42
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minItems.json +0 -28
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minLength.json +0 -33
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minimum.json +0 -42
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json +0 -107
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/format.json +0 -222
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json +0 -18
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json +0 -15
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/pattern.json +0 -34
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json +0 -110
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/properties.json +0 -92
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/ref.json +0 -159
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/refRemote.json +0 -74
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/required.json +0 -53
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/type.json +0 -474
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json +0 -79
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json +0 -82
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json +0 -88
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/allOf.json +0 -112
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/anyOf.json +0 -68
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/default.json +0 -49
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/definitions.json +0 -32
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/dependencies.json +0 -113
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/enum.json +0 -72
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/items.json +0 -46
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxItems.json +0 -28
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxLength.json +0 -33
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json +0 -28
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maximum.json +0 -42
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minItems.json +0 -28
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minLength.json +0 -33
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minProperties.json +0 -28
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minimum.json +0 -42
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json +0 -60
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/not.json +0 -96
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/oneOf.json +0 -68
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json +0 -107
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/format.json +0 -148
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json +0 -15
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/pattern.json +0 -34
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json +0 -110
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/properties.json +0 -92
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/ref.json +0 -159
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/refRemote.json +0 -74
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/required.json +0 -39
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/type.json +0 -330
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json +0 -79
- data/ext/rj_schema/rapidjson/bin/jsonschema/tox.ini +0 -8
- data/ext/rj_schema/rapidjson/bin/types/booleans.json +0 -102
- data/ext/rj_schema/rapidjson/bin/types/floats.json +0 -102
- data/ext/rj_schema/rapidjson/bin/types/guids.json +0 -102
- data/ext/rj_schema/rapidjson/bin/types/integers.json +0 -102
- data/ext/rj_schema/rapidjson/bin/types/mixed.json +0 -592
- data/ext/rj_schema/rapidjson/bin/types/nulls.json +0 -102
- data/ext/rj_schema/rapidjson/bin/types/paragraphs.json +0 -102
- data/ext/rj_schema/rapidjson/bin/types/readme.txt +0 -1
- data/ext/rj_schema/rapidjson/contrib/natvis/LICENSE +0 -45
- data/ext/rj_schema/rapidjson/contrib/natvis/README.md +0 -7
- data/ext/rj_schema/rapidjson/contrib/natvis/rapidjson.natvis +0 -38
- data/ext/rj_schema/rapidjson/doc/CMakeLists.txt +0 -27
- data/ext/rj_schema/rapidjson/doc/Doxyfile.in +0 -2369
- data/ext/rj_schema/rapidjson/doc/Doxyfile.zh-cn.in +0 -2369
- data/ext/rj_schema/rapidjson/doc/diagram/architecture.dot +0 -50
- data/ext/rj_schema/rapidjson/doc/diagram/architecture.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.dot +0 -65
- data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.dot +0 -62
- data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/makefile +0 -8
- data/ext/rj_schema/rapidjson/doc/diagram/move1.dot +0 -47
- data/ext/rj_schema/rapidjson/doc/diagram/move1.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move2.dot +0 -62
- data/ext/rj_schema/rapidjson/doc/diagram/move2.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move3.dot +0 -60
- data/ext/rj_schema/rapidjson/doc/diagram/move3.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.dot +0 -56
- data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/simpledom.dot +0 -54
- data/ext/rj_schema/rapidjson/doc/diagram/simpledom.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/tutorial.dot +0 -58
- data/ext/rj_schema/rapidjson/doc/diagram/tutorial.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.dot +0 -73
- data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.png +0 -0
- data/ext/rj_schema/rapidjson/doc/dom.md +0 -280
- data/ext/rj_schema/rapidjson/doc/dom.zh-cn.md +0 -284
- data/ext/rj_schema/rapidjson/doc/encoding.md +0 -146
- data/ext/rj_schema/rapidjson/doc/encoding.zh-cn.md +0 -152
- data/ext/rj_schema/rapidjson/doc/faq.md +0 -289
- data/ext/rj_schema/rapidjson/doc/faq.zh-cn.md +0 -290
- data/ext/rj_schema/rapidjson/doc/features.md +0 -104
- data/ext/rj_schema/rapidjson/doc/features.zh-cn.md +0 -103
- data/ext/rj_schema/rapidjson/doc/internals.md +0 -368
- data/ext/rj_schema/rapidjson/doc/internals.zh-cn.md +0 -363
- data/ext/rj_schema/rapidjson/doc/logo/rapidjson.png +0 -0
- data/ext/rj_schema/rapidjson/doc/logo/rapidjson.svg +0 -119
- data/ext/rj_schema/rapidjson/doc/misc/DoxygenLayout.xml +0 -194
- data/ext/rj_schema/rapidjson/doc/misc/doxygenextra.css +0 -274
- data/ext/rj_schema/rapidjson/doc/misc/footer.html +0 -11
- data/ext/rj_schema/rapidjson/doc/misc/header.html +0 -24
- data/ext/rj_schema/rapidjson/doc/npm.md +0 -31
- data/ext/rj_schema/rapidjson/doc/performance.md +0 -26
- data/ext/rj_schema/rapidjson/doc/performance.zh-cn.md +0 -26
- data/ext/rj_schema/rapidjson/doc/pointer.md +0 -234
- data/ext/rj_schema/rapidjson/doc/pointer.zh-cn.md +0 -234
- data/ext/rj_schema/rapidjson/doc/sax.md +0 -509
- data/ext/rj_schema/rapidjson/doc/sax.zh-cn.md +0 -487
- data/ext/rj_schema/rapidjson/doc/schema.md +0 -505
- data/ext/rj_schema/rapidjson/doc/schema.zh-cn.md +0 -237
- data/ext/rj_schema/rapidjson/doc/stream.md +0 -429
- data/ext/rj_schema/rapidjson/doc/stream.zh-cn.md +0 -429
- data/ext/rj_schema/rapidjson/doc/tutorial.md +0 -536
- data/ext/rj_schema/rapidjson/doc/tutorial.zh-cn.md +0 -534
- data/ext/rj_schema/rapidjson/docker/debian/Dockerfile +0 -8
- data/ext/rj_schema/rapidjson/example/CMakeLists.txt +0 -45
- data/ext/rj_schema/rapidjson/example/archiver/archiver.cpp +0 -292
- data/ext/rj_schema/rapidjson/example/archiver/archiver.h +0 -145
- data/ext/rj_schema/rapidjson/example/archiver/archivertest.cpp +0 -287
- data/ext/rj_schema/rapidjson/example/capitalize/capitalize.cpp +0 -67
- data/ext/rj_schema/rapidjson/example/condense/condense.cpp +0 -32
- data/ext/rj_schema/rapidjson/example/filterkey/filterkey.cpp +0 -135
- data/ext/rj_schema/rapidjson/example/filterkeydom/filterkeydom.cpp +0 -170
- data/ext/rj_schema/rapidjson/example/jsonx/jsonx.cpp +0 -207
- data/ext/rj_schema/rapidjson/example/lookaheadparser/lookaheadparser.cpp +0 -350
- data/ext/rj_schema/rapidjson/example/messagereader/messagereader.cpp +0 -105
- data/ext/rj_schema/rapidjson/example/parsebyparts/parsebyparts.cpp +0 -176
- data/ext/rj_schema/rapidjson/example/pretty/pretty.cpp +0 -30
- data/ext/rj_schema/rapidjson/example/prettyauto/prettyauto.cpp +0 -56
- data/ext/rj_schema/rapidjson/example/schemavalidator/schemavalidator.cpp +0 -78
- data/ext/rj_schema/rapidjson/example/serialize/serialize.cpp +0 -173
- data/ext/rj_schema/rapidjson/example/simpledom/simpledom.cpp +0 -29
- data/ext/rj_schema/rapidjson/example/simplepullreader/simplepullreader.cpp +0 -53
- data/ext/rj_schema/rapidjson/example/simplereader/simplereader.cpp +0 -42
- data/ext/rj_schema/rapidjson/example/simplewriter/simplewriter.cpp +0 -36
- data/ext/rj_schema/rapidjson/example/tutorial/tutorial.cpp +0 -151
- data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +0 -284
- data/ext/rj_schema/rapidjson/include/rapidjson/cursorstreamwrapper.h +0 -78
- data/ext/rj_schema/rapidjson/include/rapidjson/document.h +0 -2648
- data/ext/rj_schema/rapidjson/include/rapidjson/encodedstream.h +0 -299
- data/ext/rj_schema/rapidjson/include/rapidjson/encodings.h +0 -716
- data/ext/rj_schema/rapidjson/include/rapidjson/error/en.h +0 -74
- data/ext/rj_schema/rapidjson/include/rapidjson/error/error.h +0 -161
- data/ext/rj_schema/rapidjson/include/rapidjson/filereadstream.h +0 -99
- data/ext/rj_schema/rapidjson/include/rapidjson/filewritestream.h +0 -104
- data/ext/rj_schema/rapidjson/include/rapidjson/fwd.h +0 -151
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/biginteger.h +0 -290
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/diyfp.h +0 -271
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/dtoa.h +0 -245
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/ieee754.h +0 -78
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/itoa.h +0 -308
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/meta.h +0 -186
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/pow10.h +0 -55
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/regex.h +0 -732
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/stack.h +0 -231
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strfunc.h +0 -69
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strtod.h +0 -290
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/swap.h +0 -46
- data/ext/rj_schema/rapidjson/include/rapidjson/istreamwrapper.h +0 -113
- data/ext/rj_schema/rapidjson/include/rapidjson/memorybuffer.h +0 -70
- data/ext/rj_schema/rapidjson/include/rapidjson/memorystream.h +0 -71
- data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/inttypes.h +0 -316
- data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/stdint.h +0 -300
- data/ext/rj_schema/rapidjson/include/rapidjson/ostreamwrapper.h +0 -81
- data/ext/rj_schema/rapidjson/include/rapidjson/pointer.h +0 -1357
- data/ext/rj_schema/rapidjson/include/rapidjson/prettywriter.h +0 -277
- data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +0 -630
- data/ext/rj_schema/rapidjson/include/rapidjson/reader.h +0 -2230
- data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +0 -2494
- data/ext/rj_schema/rapidjson/include/rapidjson/stream.h +0 -223
- data/ext/rj_schema/rapidjson/include/rapidjson/stringbuffer.h +0 -121
- data/ext/rj_schema/rapidjson/include/rapidjson/writer.h +0 -710
- data/ext/rj_schema/rapidjson/include_dirs.js +0 -2
- data/ext/rj_schema/rapidjson/library.json +0 -15
- data/ext/rj_schema/rapidjson/license.txt +0 -57
- data/ext/rj_schema/rapidjson/package.json +0 -24
- data/ext/rj_schema/rapidjson/rapidjson.autopkg +0 -77
- data/ext/rj_schema/rapidjson/readme.md +0 -160
- data/ext/rj_schema/rapidjson/readme.zh-cn.md +0 -152
- data/ext/rj_schema/rapidjson/test/CMakeLists.txt +0 -20
- data/ext/rj_schema/rapidjson/test/perftest/CMakeLists.txt +0 -28
- data/ext/rj_schema/rapidjson/test/perftest/misctest.cpp +0 -974
- data/ext/rj_schema/rapidjson/test/perftest/perftest.cpp +0 -24
- data/ext/rj_schema/rapidjson/test/perftest/perftest.h +0 -185
- data/ext/rj_schema/rapidjson/test/perftest/platformtest.cpp +0 -166
- data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +0 -472
- data/ext/rj_schema/rapidjson/test/perftest/schematest.cpp +0 -223
- data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +0 -92
- data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +0 -100
- data/ext/rj_schema/rapidjson/test/unittest/bigintegertest.cpp +0 -138
- data/ext/rj_schema/rapidjson/test/unittest/cursorstreamwrappertest.cpp +0 -115
- data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +0 -672
- data/ext/rj_schema/rapidjson/test/unittest/dtoatest.cpp +0 -98
- data/ext/rj_schema/rapidjson/test/unittest/encodedstreamtest.cpp +0 -313
- data/ext/rj_schema/rapidjson/test/unittest/encodingstest.cpp +0 -451
- data/ext/rj_schema/rapidjson/test/unittest/filestreamtest.cpp +0 -112
- data/ext/rj_schema/rapidjson/test/unittest/fwdtest.cpp +0 -230
- data/ext/rj_schema/rapidjson/test/unittest/istreamwrappertest.cpp +0 -181
- data/ext/rj_schema/rapidjson/test/unittest/itoatest.cpp +0 -160
- data/ext/rj_schema/rapidjson/test/unittest/jsoncheckertest.cpp +0 -143
- data/ext/rj_schema/rapidjson/test/unittest/namespacetest.cpp +0 -70
- data/ext/rj_schema/rapidjson/test/unittest/ostreamwrappertest.cpp +0 -92
- data/ext/rj_schema/rapidjson/test/unittest/pointertest.cpp +0 -1529
- data/ext/rj_schema/rapidjson/test/unittest/prettywritertest.cpp +0 -373
- data/ext/rj_schema/rapidjson/test/unittest/readertest.cpp +0 -2190
- data/ext/rj_schema/rapidjson/test/unittest/regextest.cpp +0 -638
- data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +0 -2072
- data/ext/rj_schema/rapidjson/test/unittest/simdtest.cpp +0 -219
- data/ext/rj_schema/rapidjson/test/unittest/strfunctest.cpp +0 -30
- data/ext/rj_schema/rapidjson/test/unittest/stringbuffertest.cpp +0 -192
- data/ext/rj_schema/rapidjson/test/unittest/strtodtest.cpp +0 -132
- data/ext/rj_schema/rapidjson/test/unittest/unittest.cpp +0 -51
- data/ext/rj_schema/rapidjson/test/unittest/unittest.h +0 -140
- data/ext/rj_schema/rapidjson/test/unittest/valuetest.cpp +0 -1851
- data/ext/rj_schema/rapidjson/test/unittest/writertest.cpp +0 -598
- data/ext/rj_schema/rapidjson/test/valgrind.supp +0 -17
- data/ext/rj_schema/rapidjson/thirdparty/gtest/CMakeLists.txt +0 -16
- data/ext/rj_schema/rapidjson/thirdparty/gtest/README.md +0 -141
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CHANGES +0 -126
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +0 -202
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CONTRIBUTORS +0 -40
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/LICENSE +0 -28
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/Makefile.am +0 -224
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/README.md +0 -333
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/configure.ac +0 -146
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +0 -562
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +0 -3675
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DesignDoc.md +0 -280
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DevGuide.md +0 -132
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +0 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +0 -439
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +0 -628
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/KnownIssues.md +0 -19
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/CheatSheet.md +0 -525
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/CookBook.md +0 -3250
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/Documentation.md +0 -11
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/ForDummies.md +0 -439
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/FrequentlyAskedQuestions.md +0 -624
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/CheatSheet.md +0 -534
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/CookBook.md +0 -3342
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/Documentation.md +0 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/ForDummies.md +0 -439
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/FrequentlyAskedQuestions.md +0 -628
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/CheatSheet.md +0 -556
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/CookBook.md +0 -3432
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/Documentation.md +0 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/ForDummies.md +0 -439
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/FrequentlyAskedQuestions.md +0 -628
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +0 -1205
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-cardinalities.h +0 -147
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +0 -2377
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +0 -794
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +0 -1095
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +0 -291
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +0 -2179
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +0 -672
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +0 -397
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +0 -161
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +0 -4399
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-actions.h +0 -246
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +0 -58
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +0 -1847
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +0 -94
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +0 -8
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +0 -10
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +0 -39
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-port.h +0 -46
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +0 -279
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +0 -136
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +0 -511
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +0 -91
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/make/Makefile +0 -101
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.sln +0 -32
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.vcproj +0 -191
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_config.vsprops +0 -15
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_main.vcproj +0 -187
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_test.vcproj +0 -201
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +0 -32
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +0 -82
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +0 -19
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +0 -88
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +0 -101
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +0 -32
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +0 -84
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_config.props +0 -19
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +0 -90
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +0 -103
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +0 -240
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/LICENSE +0 -203
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +0 -35
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README.cppclean +0 -115
- 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 +0 -1733
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class.py +0 -227
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py +0 -448
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/keywords.py +0 -59
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/tokenize.py +0 -287
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/utils.py +0 -41
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/gmock_gen.py +0 -31
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock-config.in +0 -303
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock_doctor.py +0 -640
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload.py +0 -1387
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload_gmock.py +0 -78
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-all.cc +0 -47
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +0 -156
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +0 -174
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +0 -498
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +0 -823
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +0 -183
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock_main.cc +0 -54
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +0 -1411
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +0 -428
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +0 -1228
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +0 -622
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +0 -127
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +0 -1286
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +0 -699
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +0 -5648
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +0 -708
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +0 -424
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-port_test.cc +0 -43
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +0 -2644
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_all_test.cc +0 -51
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_ex_test.cc +0 -81
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test.py +0 -108
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test_.cc +0 -100
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +0 -40
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +0 -40
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +0 -669
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +0 -180
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +0 -291
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +0 -310
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +0 -322
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +0 -220
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +0 -112
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CHANGES +0 -157
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +0 -286
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CONTRIBUTORS +0 -37
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/LICENSE +0 -28
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/Makefile.am +0 -310
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/README.md +0 -280
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +0 -242
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.cbproj +0 -138
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.groupproj +0 -54
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_all.cc +0 -38
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_link.cc +0 -40
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_main.cbproj +0 -82
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_unittest.cbproj +0 -88
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/configure.ac +0 -68
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/AdvancedGuide.md +0 -2182
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/DevGuide.md +0 -126
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Documentation.md +0 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/FAQ.md +0 -1087
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Primer.md +0 -502
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +0 -177
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Samples.md +0 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_AdvancedGuide.md +0 -2096
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_Documentation.md +0 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_FAQ.md +0 -886
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_Primer.md +0 -497
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_PumpManual.md +0 -177
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_XcodeGuide.md +0 -93
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_AdvancedGuide.md +0 -2178
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Documentation.md +0 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_FAQ.md +0 -1038
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Primer.md +0 -501
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_PumpManual.md +0 -177
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Samples.md +0 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_XcodeGuide.md +0 -93
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_AdvancedGuide.md +0 -2181
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Documentation.md +0 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_FAQ.md +0 -1082
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Primer.md +0 -501
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_PumpManual.md +0 -177
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Samples.md +0 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_XcodeGuide.md +0 -93
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +0 -93
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +0 -294
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +0 -250
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +0 -1444
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +0 -510
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +0 -993
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +0 -232
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-test-part.h +0 -179
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +0 -263
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +0 -2236
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +0 -358
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +0 -58
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +0 -69
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-printers.h +0 -42
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +0 -41
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +0 -319
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +0 -206
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +0 -1238
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-linked_ptr.h +0 -243
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +0 -5146
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +0 -286
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +0 -731
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +0 -93
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +0 -2554
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +0 -167
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h +0 -1020
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h.pump +0 -347
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +0 -3331
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +0 -297
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/acx_pthread.m4 +0 -363
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/gtest.m4 +0 -74
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/make/Makefile +0 -82
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest-md.sln +0 -45
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest-md.vcproj +0 -126
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest.sln +0 -45
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest.vcproj +0 -126
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_main-md.vcproj +0 -129
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_main.vcproj +0 -129
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_prod_test-md.vcproj +0 -164
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_prod_test.vcproj +0 -164
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_unittest-md.vcproj +0 -147
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_unittest.vcproj +0 -147
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +0 -123
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +0 -68
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.h +0 -43
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +0 -144
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +0 -153
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.cc +0 -56
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.h +0 -85
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +0 -109
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3-inl.h +0 -172
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +0 -151
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.cc +0 -46
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.h +0 -53
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +0 -45
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +0 -199
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +0 -224
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +0 -130
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +0 -173
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +0 -160
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/common.py +0 -83
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +0 -253
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +0 -730
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gtest-config.in +0 -274
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/pump.py +0 -855
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/release_docs.py +0 -158
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/test/Makefile +0 -59
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +0 -1387
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload_gtest.py +0 -78
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +0 -48
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +0 -1342
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +0 -387
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +0 -1183
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +0 -1259
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +0 -373
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +0 -110
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +0 -118
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +0 -5388
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +0 -38
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_ex_test.cc +0 -93
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +0 -1427
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +0 -662
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-linked_ptr_test.cc +0 -154
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +0 -311
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-message_test.cc +0 -159
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +0 -215
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +0 -65
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +0 -1055
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +0 -57
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +0 -1304
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +0 -1635
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-test-part_test.cc +0 -208
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-tuple_test.cc +0 -320
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +0 -45
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +0 -380
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.h +0 -66
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +0 -341
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +0 -47
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +0 -212
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +0 -88
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +0 -237
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +0 -311
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +0 -130
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +0 -71
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +0 -117
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +0 -126
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +0 -192
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +0 -636
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +0 -140
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +0 -172
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test_.cc +0 -46
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +0 -207
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest_.cc +0 -157
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +0 -45
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_no_test_unittest.cc +0 -56
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +0 -340
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +0 -1062
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +0 -743
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +0 -2427
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_premature_exit_test.cc +0 -127
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +0 -57
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +0 -253
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test.py +0 -325
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test_.cc +0 -103
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_sole_header_test.cc +0 -57
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +0 -256
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +0 -320
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc +0 -92
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +0 -171
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test_.cc +0 -72
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +0 -70
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +0 -43
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +0 -7706
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +0 -49
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +0 -49
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +0 -132
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +0 -308
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +0 -181
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +0 -194
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.cc +0 -36
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.h +0 -55
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/DebugProject.xcconfig +0 -30
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/FrameworkTarget.xcconfig +0 -17
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/General.xcconfig +0 -41
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/ReleaseProject.xcconfig +0 -32
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/StaticLibraryTarget.xcconfig +0 -18
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/TestTarget.xcconfig +0 -8
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Resources/Info.plist +0 -30
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/Info.plist +0 -28
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj +0 -457
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/runtests.sh +0 -62
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.cc +0 -63
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.h +0 -59
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget_test.cc +0 -68
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/runtests.sh +0 -65
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +0 -100
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +0 -1135
- data/ext/rj_schema/rapidjson/thirdparty/gtest/travis.sh +0 -15
- data/ext/rj_schema/rapidjson/travis-doxygen.sh +0 -121
@@ -1,1259 +0,0 @@
|
|
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
|
-
// Author: wan@google.com (Zhanyong Wan)
|
31
|
-
|
32
|
-
#include "gtest/internal/gtest-port.h"
|
33
|
-
|
34
|
-
#include <limits.h>
|
35
|
-
#include <stdlib.h>
|
36
|
-
#include <stdio.h>
|
37
|
-
#include <string.h>
|
38
|
-
#include <fstream>
|
39
|
-
|
40
|
-
#if GTEST_OS_WINDOWS
|
41
|
-
# include <windows.h>
|
42
|
-
# include <io.h>
|
43
|
-
# include <sys/stat.h>
|
44
|
-
# include <map> // Used in ThreadLocal.
|
45
|
-
#else
|
46
|
-
# include <unistd.h>
|
47
|
-
#endif // GTEST_OS_WINDOWS
|
48
|
-
|
49
|
-
#if GTEST_OS_MAC
|
50
|
-
# include <mach/mach_init.h>
|
51
|
-
# include <mach/task.h>
|
52
|
-
# include <mach/vm_map.h>
|
53
|
-
#endif // GTEST_OS_MAC
|
54
|
-
|
55
|
-
#if GTEST_OS_QNX
|
56
|
-
# include <devctl.h>
|
57
|
-
# include <fcntl.h>
|
58
|
-
# include <sys/procfs.h>
|
59
|
-
#endif // GTEST_OS_QNX
|
60
|
-
|
61
|
-
#if GTEST_OS_AIX
|
62
|
-
# include <procinfo.h>
|
63
|
-
# include <sys/types.h>
|
64
|
-
#endif // GTEST_OS_AIX
|
65
|
-
|
66
|
-
#include "gtest/gtest-spi.h"
|
67
|
-
#include "gtest/gtest-message.h"
|
68
|
-
#include "gtest/internal/gtest-internal.h"
|
69
|
-
#include "gtest/internal/gtest-string.h"
|
70
|
-
|
71
|
-
// Indicates that this translation unit is part of Google Test's
|
72
|
-
// implementation. It must come before gtest-internal-inl.h is
|
73
|
-
// included, or there will be a compiler error. This trick exists to
|
74
|
-
// prevent the accidental inclusion of gtest-internal-inl.h in the
|
75
|
-
// user's code.
|
76
|
-
#define GTEST_IMPLEMENTATION_ 1
|
77
|
-
#include "src/gtest-internal-inl.h"
|
78
|
-
#undef GTEST_IMPLEMENTATION_
|
79
|
-
|
80
|
-
namespace testing {
|
81
|
-
namespace internal {
|
82
|
-
|
83
|
-
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
84
|
-
// MSVC and C++Builder do not provide a definition of STDERR_FILENO.
|
85
|
-
const int kStdOutFileno = 1;
|
86
|
-
const int kStdErrFileno = 2;
|
87
|
-
#else
|
88
|
-
const int kStdOutFileno = STDOUT_FILENO;
|
89
|
-
const int kStdErrFileno = STDERR_FILENO;
|
90
|
-
#endif // _MSC_VER
|
91
|
-
|
92
|
-
#if GTEST_OS_LINUX
|
93
|
-
|
94
|
-
namespace {
|
95
|
-
template <typename T>
|
96
|
-
T ReadProcFileField(const string& filename, int field) {
|
97
|
-
std::string dummy;
|
98
|
-
std::ifstream file(filename.c_str());
|
99
|
-
while (field-- > 0) {
|
100
|
-
file >> dummy;
|
101
|
-
}
|
102
|
-
T output = 0;
|
103
|
-
file >> output;
|
104
|
-
return output;
|
105
|
-
}
|
106
|
-
} // namespace
|
107
|
-
|
108
|
-
// Returns the number of active threads, or 0 when there is an error.
|
109
|
-
size_t GetThreadCount() {
|
110
|
-
const string filename =
|
111
|
-
(Message() << "/proc/" << getpid() << "/stat").GetString();
|
112
|
-
return ReadProcFileField<int>(filename, 19);
|
113
|
-
}
|
114
|
-
|
115
|
-
#elif GTEST_OS_MAC
|
116
|
-
|
117
|
-
size_t GetThreadCount() {
|
118
|
-
const task_t task = mach_task_self();
|
119
|
-
mach_msg_type_number_t thread_count;
|
120
|
-
thread_act_array_t thread_list;
|
121
|
-
const kern_return_t status = task_threads(task, &thread_list, &thread_count);
|
122
|
-
if (status == KERN_SUCCESS) {
|
123
|
-
// task_threads allocates resources in thread_list and we need to free them
|
124
|
-
// to avoid leaks.
|
125
|
-
vm_deallocate(task,
|
126
|
-
reinterpret_cast<vm_address_t>(thread_list),
|
127
|
-
sizeof(thread_t) * thread_count);
|
128
|
-
return static_cast<size_t>(thread_count);
|
129
|
-
} else {
|
130
|
-
return 0;
|
131
|
-
}
|
132
|
-
}
|
133
|
-
|
134
|
-
#elif GTEST_OS_QNX
|
135
|
-
|
136
|
-
// Returns the number of threads running in the process, or 0 to indicate that
|
137
|
-
// we cannot detect it.
|
138
|
-
size_t GetThreadCount() {
|
139
|
-
const int fd = open("/proc/self/as", O_RDONLY);
|
140
|
-
if (fd < 0) {
|
141
|
-
return 0;
|
142
|
-
}
|
143
|
-
procfs_info process_info;
|
144
|
-
const int status =
|
145
|
-
devctl(fd, DCMD_PROC_INFO, &process_info, sizeof(process_info), NULL);
|
146
|
-
close(fd);
|
147
|
-
if (status == EOK) {
|
148
|
-
return static_cast<size_t>(process_info.num_threads);
|
149
|
-
} else {
|
150
|
-
return 0;
|
151
|
-
}
|
152
|
-
}
|
153
|
-
|
154
|
-
#elif GTEST_OS_AIX
|
155
|
-
|
156
|
-
size_t GetThreadCount() {
|
157
|
-
struct procentry64 entry;
|
158
|
-
pid_t pid = getpid();
|
159
|
-
int status = getprocs64(&entry, sizeof(entry), NULL, 0, &pid, 1);
|
160
|
-
if (status == 1) {
|
161
|
-
return entry.pi_thcount;
|
162
|
-
} else {
|
163
|
-
return 0;
|
164
|
-
}
|
165
|
-
}
|
166
|
-
|
167
|
-
#else
|
168
|
-
|
169
|
-
size_t GetThreadCount() {
|
170
|
-
// There's no portable way to detect the number of threads, so we just
|
171
|
-
// return 0 to indicate that we cannot detect it.
|
172
|
-
return 0;
|
173
|
-
}
|
174
|
-
|
175
|
-
#endif // GTEST_OS_LINUX
|
176
|
-
|
177
|
-
#if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
|
178
|
-
|
179
|
-
void SleepMilliseconds(int n) {
|
180
|
-
::Sleep(n);
|
181
|
-
}
|
182
|
-
|
183
|
-
AutoHandle::AutoHandle()
|
184
|
-
: handle_(INVALID_HANDLE_VALUE) {}
|
185
|
-
|
186
|
-
AutoHandle::AutoHandle(Handle handle)
|
187
|
-
: handle_(handle) {}
|
188
|
-
|
189
|
-
AutoHandle::~AutoHandle() {
|
190
|
-
Reset();
|
191
|
-
}
|
192
|
-
|
193
|
-
AutoHandle::Handle AutoHandle::Get() const {
|
194
|
-
return handle_;
|
195
|
-
}
|
196
|
-
|
197
|
-
void AutoHandle::Reset() {
|
198
|
-
Reset(INVALID_HANDLE_VALUE);
|
199
|
-
}
|
200
|
-
|
201
|
-
void AutoHandle::Reset(HANDLE handle) {
|
202
|
-
// Resetting with the same handle we already own is invalid.
|
203
|
-
if (handle_ != handle) {
|
204
|
-
if (IsCloseable()) {
|
205
|
-
::CloseHandle(handle_);
|
206
|
-
}
|
207
|
-
handle_ = handle;
|
208
|
-
} else {
|
209
|
-
GTEST_CHECK_(!IsCloseable())
|
210
|
-
<< "Resetting a valid handle to itself is likely a programmer error "
|
211
|
-
"and thus not allowed.";
|
212
|
-
}
|
213
|
-
}
|
214
|
-
|
215
|
-
bool AutoHandle::IsCloseable() const {
|
216
|
-
// Different Windows APIs may use either of these values to represent an
|
217
|
-
// invalid handle.
|
218
|
-
return handle_ != NULL && handle_ != INVALID_HANDLE_VALUE;
|
219
|
-
}
|
220
|
-
|
221
|
-
Notification::Notification()
|
222
|
-
: event_(::CreateEvent(NULL, // Default security attributes.
|
223
|
-
TRUE, // Do not reset automatically.
|
224
|
-
FALSE, // Initially unset.
|
225
|
-
NULL)) { // Anonymous event.
|
226
|
-
GTEST_CHECK_(event_.Get() != NULL);
|
227
|
-
}
|
228
|
-
|
229
|
-
void Notification::Notify() {
|
230
|
-
GTEST_CHECK_(::SetEvent(event_.Get()) != FALSE);
|
231
|
-
}
|
232
|
-
|
233
|
-
void Notification::WaitForNotification() {
|
234
|
-
GTEST_CHECK_(
|
235
|
-
::WaitForSingleObject(event_.Get(), INFINITE) == WAIT_OBJECT_0);
|
236
|
-
}
|
237
|
-
|
238
|
-
Mutex::Mutex()
|
239
|
-
: owner_thread_id_(0),
|
240
|
-
type_(kDynamic),
|
241
|
-
critical_section_init_phase_(0),
|
242
|
-
critical_section_(new CRITICAL_SECTION) {
|
243
|
-
::InitializeCriticalSection(critical_section_);
|
244
|
-
}
|
245
|
-
|
246
|
-
Mutex::~Mutex() {
|
247
|
-
// Static mutexes are leaked intentionally. It is not thread-safe to try
|
248
|
-
// to clean them up.
|
249
|
-
// TODO(yukawa): Switch to Slim Reader/Writer (SRW) Locks, which requires
|
250
|
-
// nothing to clean it up but is available only on Vista and later.
|
251
|
-
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa904937.aspx
|
252
|
-
if (type_ == kDynamic) {
|
253
|
-
::DeleteCriticalSection(critical_section_);
|
254
|
-
delete critical_section_;
|
255
|
-
critical_section_ = NULL;
|
256
|
-
}
|
257
|
-
}
|
258
|
-
|
259
|
-
void Mutex::Lock() {
|
260
|
-
ThreadSafeLazyInit();
|
261
|
-
::EnterCriticalSection(critical_section_);
|
262
|
-
owner_thread_id_ = ::GetCurrentThreadId();
|
263
|
-
}
|
264
|
-
|
265
|
-
void Mutex::Unlock() {
|
266
|
-
ThreadSafeLazyInit();
|
267
|
-
// We don't protect writing to owner_thread_id_ here, as it's the
|
268
|
-
// caller's responsibility to ensure that the current thread holds the
|
269
|
-
// mutex when this is called.
|
270
|
-
owner_thread_id_ = 0;
|
271
|
-
::LeaveCriticalSection(critical_section_);
|
272
|
-
}
|
273
|
-
|
274
|
-
// Does nothing if the current thread holds the mutex. Otherwise, crashes
|
275
|
-
// with high probability.
|
276
|
-
void Mutex::AssertHeld() {
|
277
|
-
ThreadSafeLazyInit();
|
278
|
-
GTEST_CHECK_(owner_thread_id_ == ::GetCurrentThreadId())
|
279
|
-
<< "The current thread is not holding the mutex @" << this;
|
280
|
-
}
|
281
|
-
|
282
|
-
// Initializes owner_thread_id_ and critical_section_ in static mutexes.
|
283
|
-
void Mutex::ThreadSafeLazyInit() {
|
284
|
-
// Dynamic mutexes are initialized in the constructor.
|
285
|
-
if (type_ == kStatic) {
|
286
|
-
switch (
|
287
|
-
::InterlockedCompareExchange(&critical_section_init_phase_, 1L, 0L)) {
|
288
|
-
case 0:
|
289
|
-
// If critical_section_init_phase_ was 0 before the exchange, we
|
290
|
-
// are the first to test it and need to perform the initialization.
|
291
|
-
owner_thread_id_ = 0;
|
292
|
-
critical_section_ = new CRITICAL_SECTION;
|
293
|
-
::InitializeCriticalSection(critical_section_);
|
294
|
-
// Updates the critical_section_init_phase_ to 2 to signal
|
295
|
-
// initialization complete.
|
296
|
-
GTEST_CHECK_(::InterlockedCompareExchange(
|
297
|
-
&critical_section_init_phase_, 2L, 1L) ==
|
298
|
-
1L);
|
299
|
-
break;
|
300
|
-
case 1:
|
301
|
-
// Somebody else is already initializing the mutex; spin until they
|
302
|
-
// are done.
|
303
|
-
while (::InterlockedCompareExchange(&critical_section_init_phase_,
|
304
|
-
2L,
|
305
|
-
2L) != 2L) {
|
306
|
-
// Possibly yields the rest of the thread's time slice to other
|
307
|
-
// threads.
|
308
|
-
::Sleep(0);
|
309
|
-
}
|
310
|
-
break;
|
311
|
-
|
312
|
-
case 2:
|
313
|
-
break; // The mutex is already initialized and ready for use.
|
314
|
-
|
315
|
-
default:
|
316
|
-
GTEST_CHECK_(false)
|
317
|
-
<< "Unexpected value of critical_section_init_phase_ "
|
318
|
-
<< "while initializing a static mutex.";
|
319
|
-
}
|
320
|
-
}
|
321
|
-
}
|
322
|
-
|
323
|
-
namespace {
|
324
|
-
|
325
|
-
class ThreadWithParamSupport : public ThreadWithParamBase {
|
326
|
-
public:
|
327
|
-
static HANDLE CreateThread(Runnable* runnable,
|
328
|
-
Notification* thread_can_start) {
|
329
|
-
ThreadMainParam* param = new ThreadMainParam(runnable, thread_can_start);
|
330
|
-
DWORD thread_id;
|
331
|
-
// TODO(yukawa): Consider to use _beginthreadex instead.
|
332
|
-
HANDLE thread_handle = ::CreateThread(
|
333
|
-
NULL, // Default security.
|
334
|
-
0, // Default stack size.
|
335
|
-
&ThreadWithParamSupport::ThreadMain,
|
336
|
-
param, // Parameter to ThreadMainStatic
|
337
|
-
0x0, // Default creation flags.
|
338
|
-
&thread_id); // Need a valid pointer for the call to work under Win98.
|
339
|
-
GTEST_CHECK_(thread_handle != NULL) << "CreateThread failed with error "
|
340
|
-
<< ::GetLastError() << ".";
|
341
|
-
if (thread_handle == NULL) {
|
342
|
-
delete param;
|
343
|
-
}
|
344
|
-
return thread_handle;
|
345
|
-
}
|
346
|
-
|
347
|
-
private:
|
348
|
-
struct ThreadMainParam {
|
349
|
-
ThreadMainParam(Runnable* runnable, Notification* thread_can_start)
|
350
|
-
: runnable_(runnable),
|
351
|
-
thread_can_start_(thread_can_start) {
|
352
|
-
}
|
353
|
-
scoped_ptr<Runnable> runnable_;
|
354
|
-
// Does not own.
|
355
|
-
Notification* thread_can_start_;
|
356
|
-
};
|
357
|
-
|
358
|
-
static DWORD WINAPI ThreadMain(void* ptr) {
|
359
|
-
// Transfers ownership.
|
360
|
-
scoped_ptr<ThreadMainParam> param(static_cast<ThreadMainParam*>(ptr));
|
361
|
-
if (param->thread_can_start_ != NULL)
|
362
|
-
param->thread_can_start_->WaitForNotification();
|
363
|
-
param->runnable_->Run();
|
364
|
-
return 0;
|
365
|
-
}
|
366
|
-
|
367
|
-
// Prohibit instantiation.
|
368
|
-
ThreadWithParamSupport();
|
369
|
-
|
370
|
-
GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport);
|
371
|
-
};
|
372
|
-
|
373
|
-
} // namespace
|
374
|
-
|
375
|
-
ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
|
376
|
-
Notification* thread_can_start)
|
377
|
-
: thread_(ThreadWithParamSupport::CreateThread(runnable,
|
378
|
-
thread_can_start)) {
|
379
|
-
}
|
380
|
-
|
381
|
-
ThreadWithParamBase::~ThreadWithParamBase() {
|
382
|
-
Join();
|
383
|
-
}
|
384
|
-
|
385
|
-
void ThreadWithParamBase::Join() {
|
386
|
-
GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0)
|
387
|
-
<< "Failed to join the thread with error " << ::GetLastError() << ".";
|
388
|
-
}
|
389
|
-
|
390
|
-
// Maps a thread to a set of ThreadIdToThreadLocals that have values
|
391
|
-
// instantiated on that thread and notifies them when the thread exits. A
|
392
|
-
// ThreadLocal instance is expected to persist until all threads it has
|
393
|
-
// values on have terminated.
|
394
|
-
class ThreadLocalRegistryImpl {
|
395
|
-
public:
|
396
|
-
// Registers thread_local_instance as having value on the current thread.
|
397
|
-
// Returns a value that can be used to identify the thread from other threads.
|
398
|
-
static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
|
399
|
-
const ThreadLocalBase* thread_local_instance) {
|
400
|
-
DWORD current_thread = ::GetCurrentThreadId();
|
401
|
-
MutexLock lock(&mutex_);
|
402
|
-
ThreadIdToThreadLocals* const thread_to_thread_locals =
|
403
|
-
GetThreadLocalsMapLocked();
|
404
|
-
ThreadIdToThreadLocals::iterator thread_local_pos =
|
405
|
-
thread_to_thread_locals->find(current_thread);
|
406
|
-
if (thread_local_pos == thread_to_thread_locals->end()) {
|
407
|
-
thread_local_pos = thread_to_thread_locals->insert(
|
408
|
-
std::make_pair(current_thread, ThreadLocalValues())).first;
|
409
|
-
StartWatcherThreadFor(current_thread);
|
410
|
-
}
|
411
|
-
ThreadLocalValues& thread_local_values = thread_local_pos->second;
|
412
|
-
ThreadLocalValues::iterator value_pos =
|
413
|
-
thread_local_values.find(thread_local_instance);
|
414
|
-
if (value_pos == thread_local_values.end()) {
|
415
|
-
value_pos =
|
416
|
-
thread_local_values
|
417
|
-
.insert(std::make_pair(
|
418
|
-
thread_local_instance,
|
419
|
-
linked_ptr<ThreadLocalValueHolderBase>(
|
420
|
-
thread_local_instance->NewValueForCurrentThread())))
|
421
|
-
.first;
|
422
|
-
}
|
423
|
-
return value_pos->second.get();
|
424
|
-
}
|
425
|
-
|
426
|
-
static void OnThreadLocalDestroyed(
|
427
|
-
const ThreadLocalBase* thread_local_instance) {
|
428
|
-
std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;
|
429
|
-
// Clean up the ThreadLocalValues data structure while holding the lock, but
|
430
|
-
// defer the destruction of the ThreadLocalValueHolderBases.
|
431
|
-
{
|
432
|
-
MutexLock lock(&mutex_);
|
433
|
-
ThreadIdToThreadLocals* const thread_to_thread_locals =
|
434
|
-
GetThreadLocalsMapLocked();
|
435
|
-
for (ThreadIdToThreadLocals::iterator it =
|
436
|
-
thread_to_thread_locals->begin();
|
437
|
-
it != thread_to_thread_locals->end();
|
438
|
-
++it) {
|
439
|
-
ThreadLocalValues& thread_local_values = it->second;
|
440
|
-
ThreadLocalValues::iterator value_pos =
|
441
|
-
thread_local_values.find(thread_local_instance);
|
442
|
-
if (value_pos != thread_local_values.end()) {
|
443
|
-
value_holders.push_back(value_pos->second);
|
444
|
-
thread_local_values.erase(value_pos);
|
445
|
-
// This 'if' can only be successful at most once, so theoretically we
|
446
|
-
// could break out of the loop here, but we don't bother doing so.
|
447
|
-
}
|
448
|
-
}
|
449
|
-
}
|
450
|
-
// Outside the lock, let the destructor for 'value_holders' deallocate the
|
451
|
-
// ThreadLocalValueHolderBases.
|
452
|
-
}
|
453
|
-
|
454
|
-
static void OnThreadExit(DWORD thread_id) {
|
455
|
-
GTEST_CHECK_(thread_id != 0) << ::GetLastError();
|
456
|
-
std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;
|
457
|
-
// Clean up the ThreadIdToThreadLocals data structure while holding the
|
458
|
-
// lock, but defer the destruction of the ThreadLocalValueHolderBases.
|
459
|
-
{
|
460
|
-
MutexLock lock(&mutex_);
|
461
|
-
ThreadIdToThreadLocals* const thread_to_thread_locals =
|
462
|
-
GetThreadLocalsMapLocked();
|
463
|
-
ThreadIdToThreadLocals::iterator thread_local_pos =
|
464
|
-
thread_to_thread_locals->find(thread_id);
|
465
|
-
if (thread_local_pos != thread_to_thread_locals->end()) {
|
466
|
-
ThreadLocalValues& thread_local_values = thread_local_pos->second;
|
467
|
-
for (ThreadLocalValues::iterator value_pos =
|
468
|
-
thread_local_values.begin();
|
469
|
-
value_pos != thread_local_values.end();
|
470
|
-
++value_pos) {
|
471
|
-
value_holders.push_back(value_pos->second);
|
472
|
-
}
|
473
|
-
thread_to_thread_locals->erase(thread_local_pos);
|
474
|
-
}
|
475
|
-
}
|
476
|
-
// Outside the lock, let the destructor for 'value_holders' deallocate the
|
477
|
-
// ThreadLocalValueHolderBases.
|
478
|
-
}
|
479
|
-
|
480
|
-
private:
|
481
|
-
// In a particular thread, maps a ThreadLocal object to its value.
|
482
|
-
typedef std::map<const ThreadLocalBase*,
|
483
|
-
linked_ptr<ThreadLocalValueHolderBase> > ThreadLocalValues;
|
484
|
-
// Stores all ThreadIdToThreadLocals having values in a thread, indexed by
|
485
|
-
// thread's ID.
|
486
|
-
typedef std::map<DWORD, ThreadLocalValues> ThreadIdToThreadLocals;
|
487
|
-
|
488
|
-
// Holds the thread id and thread handle that we pass from
|
489
|
-
// StartWatcherThreadFor to WatcherThreadFunc.
|
490
|
-
typedef std::pair<DWORD, HANDLE> ThreadIdAndHandle;
|
491
|
-
|
492
|
-
static void StartWatcherThreadFor(DWORD thread_id) {
|
493
|
-
// The returned handle will be kept in thread_map and closed by
|
494
|
-
// watcher_thread in WatcherThreadFunc.
|
495
|
-
HANDLE thread = ::OpenThread(SYNCHRONIZE | THREAD_QUERY_INFORMATION,
|
496
|
-
FALSE,
|
497
|
-
thread_id);
|
498
|
-
GTEST_CHECK_(thread != NULL);
|
499
|
-
// We need to to pass a valid thread ID pointer into CreateThread for it
|
500
|
-
// to work correctly under Win98.
|
501
|
-
DWORD watcher_thread_id;
|
502
|
-
HANDLE watcher_thread = ::CreateThread(
|
503
|
-
NULL, // Default security.
|
504
|
-
0, // Default stack size
|
505
|
-
&ThreadLocalRegistryImpl::WatcherThreadFunc,
|
506
|
-
reinterpret_cast<LPVOID>(new ThreadIdAndHandle(thread_id, thread)),
|
507
|
-
CREATE_SUSPENDED,
|
508
|
-
&watcher_thread_id);
|
509
|
-
GTEST_CHECK_(watcher_thread != NULL);
|
510
|
-
// Give the watcher thread the same priority as ours to avoid being
|
511
|
-
// blocked by it.
|
512
|
-
::SetThreadPriority(watcher_thread,
|
513
|
-
::GetThreadPriority(::GetCurrentThread()));
|
514
|
-
::ResumeThread(watcher_thread);
|
515
|
-
::CloseHandle(watcher_thread);
|
516
|
-
}
|
517
|
-
|
518
|
-
// Monitors exit from a given thread and notifies those
|
519
|
-
// ThreadIdToThreadLocals about thread termination.
|
520
|
-
static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
|
521
|
-
const ThreadIdAndHandle* tah =
|
522
|
-
reinterpret_cast<const ThreadIdAndHandle*>(param);
|
523
|
-
GTEST_CHECK_(
|
524
|
-
::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
|
525
|
-
OnThreadExit(tah->first);
|
526
|
-
::CloseHandle(tah->second);
|
527
|
-
delete tah;
|
528
|
-
return 0;
|
529
|
-
}
|
530
|
-
|
531
|
-
// Returns map of thread local instances.
|
532
|
-
static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() {
|
533
|
-
mutex_.AssertHeld();
|
534
|
-
static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
|
535
|
-
return map;
|
536
|
-
}
|
537
|
-
|
538
|
-
// Protects access to GetThreadLocalsMapLocked() and its return value.
|
539
|
-
static Mutex mutex_;
|
540
|
-
// Protects access to GetThreadMapLocked() and its return value.
|
541
|
-
static Mutex thread_map_mutex_;
|
542
|
-
};
|
543
|
-
|
544
|
-
Mutex ThreadLocalRegistryImpl::mutex_(Mutex::kStaticMutex);
|
545
|
-
Mutex ThreadLocalRegistryImpl::thread_map_mutex_(Mutex::kStaticMutex);
|
546
|
-
|
547
|
-
ThreadLocalValueHolderBase* ThreadLocalRegistry::GetValueOnCurrentThread(
|
548
|
-
const ThreadLocalBase* thread_local_instance) {
|
549
|
-
return ThreadLocalRegistryImpl::GetValueOnCurrentThread(
|
550
|
-
thread_local_instance);
|
551
|
-
}
|
552
|
-
|
553
|
-
void ThreadLocalRegistry::OnThreadLocalDestroyed(
|
554
|
-
const ThreadLocalBase* thread_local_instance) {
|
555
|
-
ThreadLocalRegistryImpl::OnThreadLocalDestroyed(thread_local_instance);
|
556
|
-
}
|
557
|
-
|
558
|
-
#endif // GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
|
559
|
-
|
560
|
-
#if GTEST_USES_POSIX_RE
|
561
|
-
|
562
|
-
// Implements RE. Currently only needed for death tests.
|
563
|
-
|
564
|
-
RE::~RE() {
|
565
|
-
if (is_valid_) {
|
566
|
-
// regfree'ing an invalid regex might crash because the content
|
567
|
-
// of the regex is undefined. Since the regex's are essentially
|
568
|
-
// the same, one cannot be valid (or invalid) without the other
|
569
|
-
// being so too.
|
570
|
-
regfree(&partial_regex_);
|
571
|
-
regfree(&full_regex_);
|
572
|
-
}
|
573
|
-
free(const_cast<char*>(pattern_));
|
574
|
-
}
|
575
|
-
|
576
|
-
// Returns true iff regular expression re matches the entire str.
|
577
|
-
bool RE::FullMatch(const char* str, const RE& re) {
|
578
|
-
if (!re.is_valid_) return false;
|
579
|
-
|
580
|
-
regmatch_t match;
|
581
|
-
return regexec(&re.full_regex_, str, 1, &match, 0) == 0;
|
582
|
-
}
|
583
|
-
|
584
|
-
// Returns true iff regular expression re matches a substring of str
|
585
|
-
// (including str itself).
|
586
|
-
bool RE::PartialMatch(const char* str, const RE& re) {
|
587
|
-
if (!re.is_valid_) return false;
|
588
|
-
|
589
|
-
regmatch_t match;
|
590
|
-
return regexec(&re.partial_regex_, str, 1, &match, 0) == 0;
|
591
|
-
}
|
592
|
-
|
593
|
-
// Initializes an RE from its string representation.
|
594
|
-
void RE::Init(const char* regex) {
|
595
|
-
pattern_ = posix::StrDup(regex);
|
596
|
-
|
597
|
-
// Reserves enough bytes to hold the regular expression used for a
|
598
|
-
// full match.
|
599
|
-
const size_t full_regex_len = strlen(regex) + 10;
|
600
|
-
char* const full_pattern = new char[full_regex_len];
|
601
|
-
|
602
|
-
snprintf(full_pattern, full_regex_len, "^(%s)$", regex);
|
603
|
-
is_valid_ = regcomp(&full_regex_, full_pattern, REG_EXTENDED) == 0;
|
604
|
-
// We want to call regcomp(&partial_regex_, ...) even if the
|
605
|
-
// previous expression returns false. Otherwise partial_regex_ may
|
606
|
-
// not be properly initialized can may cause trouble when it's
|
607
|
-
// freed.
|
608
|
-
//
|
609
|
-
// Some implementation of POSIX regex (e.g. on at least some
|
610
|
-
// versions of Cygwin) doesn't accept the empty string as a valid
|
611
|
-
// regex. We change it to an equivalent form "()" to be safe.
|
612
|
-
if (is_valid_) {
|
613
|
-
const char* const partial_regex = (*regex == '\0') ? "()" : regex;
|
614
|
-
is_valid_ = regcomp(&partial_regex_, partial_regex, REG_EXTENDED) == 0;
|
615
|
-
}
|
616
|
-
EXPECT_TRUE(is_valid_)
|
617
|
-
<< "Regular expression \"" << regex
|
618
|
-
<< "\" is not a valid POSIX Extended regular expression.";
|
619
|
-
|
620
|
-
delete[] full_pattern;
|
621
|
-
}
|
622
|
-
|
623
|
-
#elif GTEST_USES_SIMPLE_RE
|
624
|
-
|
625
|
-
// Returns true iff ch appears anywhere in str (excluding the
|
626
|
-
// terminating '\0' character).
|
627
|
-
bool IsInSet(char ch, const char* str) {
|
628
|
-
return ch != '\0' && strchr(str, ch) != NULL;
|
629
|
-
}
|
630
|
-
|
631
|
-
// Returns true iff ch belongs to the given classification. Unlike
|
632
|
-
// similar functions in <ctype.h>, these aren't affected by the
|
633
|
-
// current locale.
|
634
|
-
bool IsAsciiDigit(char ch) { return '0' <= ch && ch <= '9'; }
|
635
|
-
bool IsAsciiPunct(char ch) {
|
636
|
-
return IsInSet(ch, "^-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~");
|
637
|
-
}
|
638
|
-
bool IsRepeat(char ch) { return IsInSet(ch, "?*+"); }
|
639
|
-
bool IsAsciiWhiteSpace(char ch) { return IsInSet(ch, " \f\n\r\t\v"); }
|
640
|
-
bool IsAsciiWordChar(char ch) {
|
641
|
-
return ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z') ||
|
642
|
-
('0' <= ch && ch <= '9') || ch == '_';
|
643
|
-
}
|
644
|
-
|
645
|
-
// Returns true iff "\\c" is a supported escape sequence.
|
646
|
-
bool IsValidEscape(char c) {
|
647
|
-
return (IsAsciiPunct(c) || IsInSet(c, "dDfnrsStvwW"));
|
648
|
-
}
|
649
|
-
|
650
|
-
// Returns true iff the given atom (specified by escaped and pattern)
|
651
|
-
// matches ch. The result is undefined if the atom is invalid.
|
652
|
-
bool AtomMatchesChar(bool escaped, char pattern_char, char ch) {
|
653
|
-
if (escaped) { // "\\p" where p is pattern_char.
|
654
|
-
switch (pattern_char) {
|
655
|
-
case 'd': return IsAsciiDigit(ch);
|
656
|
-
case 'D': return !IsAsciiDigit(ch);
|
657
|
-
case 'f': return ch == '\f';
|
658
|
-
case 'n': return ch == '\n';
|
659
|
-
case 'r': return ch == '\r';
|
660
|
-
case 's': return IsAsciiWhiteSpace(ch);
|
661
|
-
case 'S': return !IsAsciiWhiteSpace(ch);
|
662
|
-
case 't': return ch == '\t';
|
663
|
-
case 'v': return ch == '\v';
|
664
|
-
case 'w': return IsAsciiWordChar(ch);
|
665
|
-
case 'W': return !IsAsciiWordChar(ch);
|
666
|
-
}
|
667
|
-
return IsAsciiPunct(pattern_char) && pattern_char == ch;
|
668
|
-
}
|
669
|
-
|
670
|
-
return (pattern_char == '.' && ch != '\n') || pattern_char == ch;
|
671
|
-
}
|
672
|
-
|
673
|
-
// Helper function used by ValidateRegex() to format error messages.
|
674
|
-
std::string FormatRegexSyntaxError(const char* regex, int index) {
|
675
|
-
return (Message() << "Syntax error at index " << index
|
676
|
-
<< " in simple regular expression \"" << regex << "\": ").GetString();
|
677
|
-
}
|
678
|
-
|
679
|
-
// Generates non-fatal failures and returns false if regex is invalid;
|
680
|
-
// otherwise returns true.
|
681
|
-
bool ValidateRegex(const char* regex) {
|
682
|
-
if (regex == NULL) {
|
683
|
-
// TODO(wan@google.com): fix the source file location in the
|
684
|
-
// assertion failures to match where the regex is used in user
|
685
|
-
// code.
|
686
|
-
ADD_FAILURE() << "NULL is not a valid simple regular expression.";
|
687
|
-
return false;
|
688
|
-
}
|
689
|
-
|
690
|
-
bool is_valid = true;
|
691
|
-
|
692
|
-
// True iff ?, *, or + can follow the previous atom.
|
693
|
-
bool prev_repeatable = false;
|
694
|
-
for (int i = 0; regex[i]; i++) {
|
695
|
-
if (regex[i] == '\\') { // An escape sequence
|
696
|
-
i++;
|
697
|
-
if (regex[i] == '\0') {
|
698
|
-
ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)
|
699
|
-
<< "'\\' cannot appear at the end.";
|
700
|
-
return false;
|
701
|
-
}
|
702
|
-
|
703
|
-
if (!IsValidEscape(regex[i])) {
|
704
|
-
ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)
|
705
|
-
<< "invalid escape sequence \"\\" << regex[i] << "\".";
|
706
|
-
is_valid = false;
|
707
|
-
}
|
708
|
-
prev_repeatable = true;
|
709
|
-
} else { // Not an escape sequence.
|
710
|
-
const char ch = regex[i];
|
711
|
-
|
712
|
-
if (ch == '^' && i > 0) {
|
713
|
-
ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
|
714
|
-
<< "'^' can only appear at the beginning.";
|
715
|
-
is_valid = false;
|
716
|
-
} else if (ch == '$' && regex[i + 1] != '\0') {
|
717
|
-
ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
|
718
|
-
<< "'$' can only appear at the end.";
|
719
|
-
is_valid = false;
|
720
|
-
} else if (IsInSet(ch, "()[]{}|")) {
|
721
|
-
ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
|
722
|
-
<< "'" << ch << "' is unsupported.";
|
723
|
-
is_valid = false;
|
724
|
-
} else if (IsRepeat(ch) && !prev_repeatable) {
|
725
|
-
ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
|
726
|
-
<< "'" << ch << "' can only follow a repeatable token.";
|
727
|
-
is_valid = false;
|
728
|
-
}
|
729
|
-
|
730
|
-
prev_repeatable = !IsInSet(ch, "^$?*+");
|
731
|
-
}
|
732
|
-
}
|
733
|
-
|
734
|
-
return is_valid;
|
735
|
-
}
|
736
|
-
|
737
|
-
// Matches a repeated regex atom followed by a valid simple regular
|
738
|
-
// expression. The regex atom is defined as c if escaped is false,
|
739
|
-
// or \c otherwise. repeat is the repetition meta character (?, *,
|
740
|
-
// or +). The behavior is undefined if str contains too many
|
741
|
-
// characters to be indexable by size_t, in which case the test will
|
742
|
-
// probably time out anyway. We are fine with this limitation as
|
743
|
-
// std::string has it too.
|
744
|
-
bool MatchRepetitionAndRegexAtHead(
|
745
|
-
bool escaped, char c, char repeat, const char* regex,
|
746
|
-
const char* str) {
|
747
|
-
const size_t min_count = (repeat == '+') ? 1 : 0;
|
748
|
-
const size_t max_count = (repeat == '?') ? 1 :
|
749
|
-
static_cast<size_t>(-1) - 1;
|
750
|
-
// We cannot call numeric_limits::max() as it conflicts with the
|
751
|
-
// max() macro on Windows.
|
752
|
-
|
753
|
-
for (size_t i = 0; i <= max_count; ++i) {
|
754
|
-
// We know that the atom matches each of the first i characters in str.
|
755
|
-
if (i >= min_count && MatchRegexAtHead(regex, str + i)) {
|
756
|
-
// We have enough matches at the head, and the tail matches too.
|
757
|
-
// Since we only care about *whether* the pattern matches str
|
758
|
-
// (as opposed to *how* it matches), there is no need to find a
|
759
|
-
// greedy match.
|
760
|
-
return true;
|
761
|
-
}
|
762
|
-
if (str[i] == '\0' || !AtomMatchesChar(escaped, c, str[i]))
|
763
|
-
return false;
|
764
|
-
}
|
765
|
-
return false;
|
766
|
-
}
|
767
|
-
|
768
|
-
// Returns true iff regex matches a prefix of str. regex must be a
|
769
|
-
// valid simple regular expression and not start with "^", or the
|
770
|
-
// result is undefined.
|
771
|
-
bool MatchRegexAtHead(const char* regex, const char* str) {
|
772
|
-
if (*regex == '\0') // An empty regex matches a prefix of anything.
|
773
|
-
return true;
|
774
|
-
|
775
|
-
// "$" only matches the end of a string. Note that regex being
|
776
|
-
// valid guarantees that there's nothing after "$" in it.
|
777
|
-
if (*regex == '$')
|
778
|
-
return *str == '\0';
|
779
|
-
|
780
|
-
// Is the first thing in regex an escape sequence?
|
781
|
-
const bool escaped = *regex == '\\';
|
782
|
-
if (escaped)
|
783
|
-
++regex;
|
784
|
-
if (IsRepeat(regex[1])) {
|
785
|
-
// MatchRepetitionAndRegexAtHead() calls MatchRegexAtHead(), so
|
786
|
-
// here's an indirect recursion. It terminates as the regex gets
|
787
|
-
// shorter in each recursion.
|
788
|
-
return MatchRepetitionAndRegexAtHead(
|
789
|
-
escaped, regex[0], regex[1], regex + 2, str);
|
790
|
-
} else {
|
791
|
-
// regex isn't empty, isn't "$", and doesn't start with a
|
792
|
-
// repetition. We match the first atom of regex with the first
|
793
|
-
// character of str and recurse.
|
794
|
-
return (*str != '\0') && AtomMatchesChar(escaped, *regex, *str) &&
|
795
|
-
MatchRegexAtHead(regex + 1, str + 1);
|
796
|
-
}
|
797
|
-
}
|
798
|
-
|
799
|
-
// Returns true iff regex matches any substring of str. regex must be
|
800
|
-
// a valid simple regular expression, or the result is undefined.
|
801
|
-
//
|
802
|
-
// The algorithm is recursive, but the recursion depth doesn't exceed
|
803
|
-
// the regex length, so we won't need to worry about running out of
|
804
|
-
// stack space normally. In rare cases the time complexity can be
|
805
|
-
// exponential with respect to the regex length + the string length,
|
806
|
-
// but usually it's must faster (often close to linear).
|
807
|
-
bool MatchRegexAnywhere(const char* regex, const char* str) {
|
808
|
-
if (regex == NULL || str == NULL)
|
809
|
-
return false;
|
810
|
-
|
811
|
-
if (*regex == '^')
|
812
|
-
return MatchRegexAtHead(regex + 1, str);
|
813
|
-
|
814
|
-
// A successful match can be anywhere in str.
|
815
|
-
do {
|
816
|
-
if (MatchRegexAtHead(regex, str))
|
817
|
-
return true;
|
818
|
-
} while (*str++ != '\0');
|
819
|
-
return false;
|
820
|
-
}
|
821
|
-
|
822
|
-
// Implements the RE class.
|
823
|
-
|
824
|
-
RE::~RE() {
|
825
|
-
free(const_cast<char*>(pattern_));
|
826
|
-
free(const_cast<char*>(full_pattern_));
|
827
|
-
}
|
828
|
-
|
829
|
-
// Returns true iff regular expression re matches the entire str.
|
830
|
-
bool RE::FullMatch(const char* str, const RE& re) {
|
831
|
-
return re.is_valid_ && MatchRegexAnywhere(re.full_pattern_, str);
|
832
|
-
}
|
833
|
-
|
834
|
-
// Returns true iff regular expression re matches a substring of str
|
835
|
-
// (including str itself).
|
836
|
-
bool RE::PartialMatch(const char* str, const RE& re) {
|
837
|
-
return re.is_valid_ && MatchRegexAnywhere(re.pattern_, str);
|
838
|
-
}
|
839
|
-
|
840
|
-
// Initializes an RE from its string representation.
|
841
|
-
void RE::Init(const char* regex) {
|
842
|
-
pattern_ = full_pattern_ = NULL;
|
843
|
-
if (regex != NULL) {
|
844
|
-
pattern_ = posix::StrDup(regex);
|
845
|
-
}
|
846
|
-
|
847
|
-
is_valid_ = ValidateRegex(regex);
|
848
|
-
if (!is_valid_) {
|
849
|
-
// No need to calculate the full pattern when the regex is invalid.
|
850
|
-
return;
|
851
|
-
}
|
852
|
-
|
853
|
-
const size_t len = strlen(regex);
|
854
|
-
// Reserves enough bytes to hold the regular expression used for a
|
855
|
-
// full match: we need space to prepend a '^', append a '$', and
|
856
|
-
// terminate the string with '\0'.
|
857
|
-
char* buffer = static_cast<char*>(malloc(len + 3));
|
858
|
-
full_pattern_ = buffer;
|
859
|
-
|
860
|
-
if (*regex != '^')
|
861
|
-
*buffer++ = '^'; // Makes sure full_pattern_ starts with '^'.
|
862
|
-
|
863
|
-
// We don't use snprintf or strncpy, as they trigger a warning when
|
864
|
-
// compiled with VC++ 8.0.
|
865
|
-
memcpy(buffer, regex, len);
|
866
|
-
buffer += len;
|
867
|
-
|
868
|
-
if (len == 0 || regex[len - 1] != '$')
|
869
|
-
*buffer++ = '$'; // Makes sure full_pattern_ ends with '$'.
|
870
|
-
|
871
|
-
*buffer = '\0';
|
872
|
-
}
|
873
|
-
|
874
|
-
#endif // GTEST_USES_POSIX_RE
|
875
|
-
|
876
|
-
const char kUnknownFile[] = "unknown file";
|
877
|
-
|
878
|
-
// Formats a source file path and a line number as they would appear
|
879
|
-
// in an error message from the compiler used to compile this code.
|
880
|
-
GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {
|
881
|
-
const std::string file_name(file == NULL ? kUnknownFile : file);
|
882
|
-
|
883
|
-
if (line < 0) {
|
884
|
-
return file_name + ":";
|
885
|
-
}
|
886
|
-
#ifdef _MSC_VER
|
887
|
-
return file_name + "(" + StreamableToString(line) + "):";
|
888
|
-
#else
|
889
|
-
return file_name + ":" + StreamableToString(line) + ":";
|
890
|
-
#endif // _MSC_VER
|
891
|
-
}
|
892
|
-
|
893
|
-
// Formats a file location for compiler-independent XML output.
|
894
|
-
// Although this function is not platform dependent, we put it next to
|
895
|
-
// FormatFileLocation in order to contrast the two functions.
|
896
|
-
// Note that FormatCompilerIndependentFileLocation() does NOT append colon
|
897
|
-
// to the file location it produces, unlike FormatFileLocation().
|
898
|
-
GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(
|
899
|
-
const char* file, int line) {
|
900
|
-
const std::string file_name(file == NULL ? kUnknownFile : file);
|
901
|
-
|
902
|
-
if (line < 0)
|
903
|
-
return file_name;
|
904
|
-
else
|
905
|
-
return file_name + ":" + StreamableToString(line);
|
906
|
-
}
|
907
|
-
|
908
|
-
GTestLog::GTestLog(GTestLogSeverity severity, const char* file, int line)
|
909
|
-
: severity_(severity) {
|
910
|
-
const char* const marker =
|
911
|
-
severity == GTEST_INFO ? "[ INFO ]" :
|
912
|
-
severity == GTEST_WARNING ? "[WARNING]" :
|
913
|
-
severity == GTEST_ERROR ? "[ ERROR ]" : "[ FATAL ]";
|
914
|
-
GetStream() << ::std::endl << marker << " "
|
915
|
-
<< FormatFileLocation(file, line).c_str() << ": ";
|
916
|
-
}
|
917
|
-
|
918
|
-
// Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
|
919
|
-
GTestLog::~GTestLog() {
|
920
|
-
GetStream() << ::std::endl;
|
921
|
-
if (severity_ == GTEST_FATAL) {
|
922
|
-
fflush(stderr);
|
923
|
-
posix::Abort();
|
924
|
-
}
|
925
|
-
}
|
926
|
-
// Disable Microsoft deprecation warnings for POSIX functions called from
|
927
|
-
// this class (creat, dup, dup2, and close)
|
928
|
-
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
|
929
|
-
|
930
|
-
#if GTEST_HAS_STREAM_REDIRECTION
|
931
|
-
|
932
|
-
// Object that captures an output stream (stdout/stderr).
|
933
|
-
class CapturedStream {
|
934
|
-
public:
|
935
|
-
// The ctor redirects the stream to a temporary file.
|
936
|
-
explicit CapturedStream(int fd) : fd_(fd), uncaptured_fd_(dup(fd)) {
|
937
|
-
# if GTEST_OS_WINDOWS
|
938
|
-
char temp_dir_path[MAX_PATH + 1] = { '\0' }; // NOLINT
|
939
|
-
char temp_file_path[MAX_PATH + 1] = { '\0' }; // NOLINT
|
940
|
-
|
941
|
-
::GetTempPathA(sizeof(temp_dir_path), temp_dir_path);
|
942
|
-
const UINT success = ::GetTempFileNameA(temp_dir_path,
|
943
|
-
"gtest_redir",
|
944
|
-
0, // Generate unique file name.
|
945
|
-
temp_file_path);
|
946
|
-
GTEST_CHECK_(success != 0)
|
947
|
-
<< "Unable to create a temporary file in " << temp_dir_path;
|
948
|
-
const int captured_fd = creat(temp_file_path, _S_IREAD | _S_IWRITE);
|
949
|
-
GTEST_CHECK_(captured_fd != -1) << "Unable to open temporary file "
|
950
|
-
<< temp_file_path;
|
951
|
-
filename_ = temp_file_path;
|
952
|
-
# else
|
953
|
-
// There's no guarantee that a test has write access to the current
|
954
|
-
// directory, so we create the temporary file in the /tmp directory
|
955
|
-
// instead. We use /tmp on most systems, and /sdcard on Android.
|
956
|
-
// That's because Android doesn't have /tmp.
|
957
|
-
# if GTEST_OS_LINUX_ANDROID
|
958
|
-
// Note: Android applications are expected to call the framework's
|
959
|
-
// Context.getExternalStorageDirectory() method through JNI to get
|
960
|
-
// the location of the world-writable SD Card directory. However,
|
961
|
-
// this requires a Context handle, which cannot be retrieved
|
962
|
-
// globally from native code. Doing so also precludes running the
|
963
|
-
// code as part of a regular standalone executable, which doesn't
|
964
|
-
// run in a Dalvik process (e.g. when running it through 'adb shell').
|
965
|
-
//
|
966
|
-
// The location /sdcard is directly accessible from native code
|
967
|
-
// and is the only location (unofficially) supported by the Android
|
968
|
-
// team. It's generally a symlink to the real SD Card mount point
|
969
|
-
// which can be /mnt/sdcard, /mnt/sdcard0, /system/media/sdcard, or
|
970
|
-
// other OEM-customized locations. Never rely on these, and always
|
971
|
-
// use /sdcard.
|
972
|
-
char name_template[] = "/sdcard/gtest_captured_stream.XXXXXX";
|
973
|
-
# else
|
974
|
-
char name_template[] = "/tmp/captured_stream.XXXXXX";
|
975
|
-
# endif // GTEST_OS_LINUX_ANDROID
|
976
|
-
const int captured_fd = mkstemp(name_template);
|
977
|
-
filename_ = name_template;
|
978
|
-
# endif // GTEST_OS_WINDOWS
|
979
|
-
fflush(NULL);
|
980
|
-
dup2(captured_fd, fd_);
|
981
|
-
close(captured_fd);
|
982
|
-
}
|
983
|
-
|
984
|
-
~CapturedStream() {
|
985
|
-
remove(filename_.c_str());
|
986
|
-
}
|
987
|
-
|
988
|
-
std::string GetCapturedString() {
|
989
|
-
if (uncaptured_fd_ != -1) {
|
990
|
-
// Restores the original stream.
|
991
|
-
fflush(NULL);
|
992
|
-
dup2(uncaptured_fd_, fd_);
|
993
|
-
close(uncaptured_fd_);
|
994
|
-
uncaptured_fd_ = -1;
|
995
|
-
}
|
996
|
-
|
997
|
-
FILE* const file = posix::FOpen(filename_.c_str(), "r");
|
998
|
-
const std::string content = ReadEntireFile(file);
|
999
|
-
posix::FClose(file);
|
1000
|
-
return content;
|
1001
|
-
}
|
1002
|
-
|
1003
|
-
private:
|
1004
|
-
const int fd_; // A stream to capture.
|
1005
|
-
int uncaptured_fd_;
|
1006
|
-
// Name of the temporary file holding the stderr output.
|
1007
|
-
::std::string filename_;
|
1008
|
-
|
1009
|
-
GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream);
|
1010
|
-
};
|
1011
|
-
|
1012
|
-
GTEST_DISABLE_MSC_WARNINGS_POP_()
|
1013
|
-
|
1014
|
-
static CapturedStream* g_captured_stderr = NULL;
|
1015
|
-
static CapturedStream* g_captured_stdout = NULL;
|
1016
|
-
|
1017
|
-
// Starts capturing an output stream (stdout/stderr).
|
1018
|
-
void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) {
|
1019
|
-
if (*stream != NULL) {
|
1020
|
-
GTEST_LOG_(FATAL) << "Only one " << stream_name
|
1021
|
-
<< " capturer can exist at a time.";
|
1022
|
-
}
|
1023
|
-
*stream = new CapturedStream(fd);
|
1024
|
-
}
|
1025
|
-
|
1026
|
-
// Stops capturing the output stream and returns the captured string.
|
1027
|
-
std::string GetCapturedStream(CapturedStream** captured_stream) {
|
1028
|
-
const std::string content = (*captured_stream)->GetCapturedString();
|
1029
|
-
|
1030
|
-
delete *captured_stream;
|
1031
|
-
*captured_stream = NULL;
|
1032
|
-
|
1033
|
-
return content;
|
1034
|
-
}
|
1035
|
-
|
1036
|
-
// Starts capturing stdout.
|
1037
|
-
void CaptureStdout() {
|
1038
|
-
CaptureStream(kStdOutFileno, "stdout", &g_captured_stdout);
|
1039
|
-
}
|
1040
|
-
|
1041
|
-
// Starts capturing stderr.
|
1042
|
-
void CaptureStderr() {
|
1043
|
-
CaptureStream(kStdErrFileno, "stderr", &g_captured_stderr);
|
1044
|
-
}
|
1045
|
-
|
1046
|
-
// Stops capturing stdout and returns the captured string.
|
1047
|
-
std::string GetCapturedStdout() {
|
1048
|
-
return GetCapturedStream(&g_captured_stdout);
|
1049
|
-
}
|
1050
|
-
|
1051
|
-
// Stops capturing stderr and returns the captured string.
|
1052
|
-
std::string GetCapturedStderr() {
|
1053
|
-
return GetCapturedStream(&g_captured_stderr);
|
1054
|
-
}
|
1055
|
-
|
1056
|
-
#endif // GTEST_HAS_STREAM_REDIRECTION
|
1057
|
-
|
1058
|
-
std::string TempDir() {
|
1059
|
-
#if GTEST_OS_WINDOWS_MOBILE
|
1060
|
-
return "\\temp\\";
|
1061
|
-
#elif GTEST_OS_WINDOWS
|
1062
|
-
const char* temp_dir = posix::GetEnv("TEMP");
|
1063
|
-
if (temp_dir == NULL || temp_dir[0] == '\0')
|
1064
|
-
return "\\temp\\";
|
1065
|
-
else if (temp_dir[strlen(temp_dir) - 1] == '\\')
|
1066
|
-
return temp_dir;
|
1067
|
-
else
|
1068
|
-
return std::string(temp_dir) + "\\";
|
1069
|
-
#elif GTEST_OS_LINUX_ANDROID
|
1070
|
-
return "/sdcard/";
|
1071
|
-
#else
|
1072
|
-
return "/tmp/";
|
1073
|
-
#endif // GTEST_OS_WINDOWS_MOBILE
|
1074
|
-
}
|
1075
|
-
|
1076
|
-
size_t GetFileSize(FILE* file) {
|
1077
|
-
fseek(file, 0, SEEK_END);
|
1078
|
-
return static_cast<size_t>(ftell(file));
|
1079
|
-
}
|
1080
|
-
|
1081
|
-
std::string ReadEntireFile(FILE* file) {
|
1082
|
-
const size_t file_size = GetFileSize(file);
|
1083
|
-
char* const buffer = new char[file_size];
|
1084
|
-
|
1085
|
-
size_t bytes_last_read = 0; // # of bytes read in the last fread()
|
1086
|
-
size_t bytes_read = 0; // # of bytes read so far
|
1087
|
-
|
1088
|
-
fseek(file, 0, SEEK_SET);
|
1089
|
-
|
1090
|
-
// Keeps reading the file until we cannot read further or the
|
1091
|
-
// pre-determined file size is reached.
|
1092
|
-
do {
|
1093
|
-
bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);
|
1094
|
-
bytes_read += bytes_last_read;
|
1095
|
-
} while (bytes_last_read > 0 && bytes_read < file_size);
|
1096
|
-
|
1097
|
-
const std::string content(buffer, bytes_read);
|
1098
|
-
delete[] buffer;
|
1099
|
-
|
1100
|
-
return content;
|
1101
|
-
}
|
1102
|
-
|
1103
|
-
#if GTEST_HAS_DEATH_TEST
|
1104
|
-
|
1105
|
-
static const ::std::vector<testing::internal::string>* g_injected_test_argvs =
|
1106
|
-
NULL; // Owned.
|
1107
|
-
|
1108
|
-
void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) {
|
1109
|
-
if (g_injected_test_argvs != argvs)
|
1110
|
-
delete g_injected_test_argvs;
|
1111
|
-
g_injected_test_argvs = argvs;
|
1112
|
-
}
|
1113
|
-
|
1114
|
-
const ::std::vector<testing::internal::string>& GetInjectableArgvs() {
|
1115
|
-
if (g_injected_test_argvs != NULL) {
|
1116
|
-
return *g_injected_test_argvs;
|
1117
|
-
}
|
1118
|
-
return GetArgvs();
|
1119
|
-
}
|
1120
|
-
#endif // GTEST_HAS_DEATH_TEST
|
1121
|
-
|
1122
|
-
#if GTEST_OS_WINDOWS_MOBILE
|
1123
|
-
namespace posix {
|
1124
|
-
void Abort() {
|
1125
|
-
DebugBreak();
|
1126
|
-
TerminateProcess(GetCurrentProcess(), 1);
|
1127
|
-
}
|
1128
|
-
} // namespace posix
|
1129
|
-
#endif // GTEST_OS_WINDOWS_MOBILE
|
1130
|
-
|
1131
|
-
// Returns the name of the environment variable corresponding to the
|
1132
|
-
// given flag. For example, FlagToEnvVar("foo") will return
|
1133
|
-
// "GTEST_FOO" in the open-source version.
|
1134
|
-
static std::string FlagToEnvVar(const char* flag) {
|
1135
|
-
const std::string full_flag =
|
1136
|
-
(Message() << GTEST_FLAG_PREFIX_ << flag).GetString();
|
1137
|
-
|
1138
|
-
Message env_var;
|
1139
|
-
for (size_t i = 0; i != full_flag.length(); i++) {
|
1140
|
-
env_var << ToUpper(full_flag.c_str()[i]);
|
1141
|
-
}
|
1142
|
-
|
1143
|
-
return env_var.GetString();
|
1144
|
-
}
|
1145
|
-
|
1146
|
-
// Parses 'str' for a 32-bit signed integer. If successful, writes
|
1147
|
-
// the result to *value and returns true; otherwise leaves *value
|
1148
|
-
// unchanged and returns false.
|
1149
|
-
bool ParseInt32(const Message& src_text, const char* str, Int32* value) {
|
1150
|
-
// Parses the environment variable as a decimal integer.
|
1151
|
-
char* end = NULL;
|
1152
|
-
const long long_value = strtol(str, &end, 10); // NOLINT
|
1153
|
-
|
1154
|
-
// Has strtol() consumed all characters in the string?
|
1155
|
-
if (*end != '\0') {
|
1156
|
-
// No - an invalid character was encountered.
|
1157
|
-
Message msg;
|
1158
|
-
msg << "WARNING: " << src_text
|
1159
|
-
<< " is expected to be a 32-bit integer, but actually"
|
1160
|
-
<< " has value \"" << str << "\".\n";
|
1161
|
-
printf("%s", msg.GetString().c_str());
|
1162
|
-
fflush(stdout);
|
1163
|
-
return false;
|
1164
|
-
}
|
1165
|
-
|
1166
|
-
// Is the parsed value in the range of an Int32?
|
1167
|
-
const Int32 result = static_cast<Int32>(long_value);
|
1168
|
-
if (long_value == LONG_MAX || long_value == LONG_MIN ||
|
1169
|
-
// The parsed value overflows as a long. (strtol() returns
|
1170
|
-
// LONG_MAX or LONG_MIN when the input overflows.)
|
1171
|
-
result != long_value
|
1172
|
-
// The parsed value overflows as an Int32.
|
1173
|
-
) {
|
1174
|
-
Message msg;
|
1175
|
-
msg << "WARNING: " << src_text
|
1176
|
-
<< " is expected to be a 32-bit integer, but actually"
|
1177
|
-
<< " has value " << str << ", which overflows.\n";
|
1178
|
-
printf("%s", msg.GetString().c_str());
|
1179
|
-
fflush(stdout);
|
1180
|
-
return false;
|
1181
|
-
}
|
1182
|
-
|
1183
|
-
*value = result;
|
1184
|
-
return true;
|
1185
|
-
}
|
1186
|
-
|
1187
|
-
// Reads and returns the Boolean environment variable corresponding to
|
1188
|
-
// the given flag; if it's not set, returns default_value.
|
1189
|
-
//
|
1190
|
-
// The value is considered true iff it's not "0".
|
1191
|
-
bool BoolFromGTestEnv(const char* flag, bool default_value) {
|
1192
|
-
#if defined(GTEST_GET_BOOL_FROM_ENV_)
|
1193
|
-
return GTEST_GET_BOOL_FROM_ENV_(flag, default_value);
|
1194
|
-
#endif // defined(GTEST_GET_BOOL_FROM_ENV_)
|
1195
|
-
const std::string env_var = FlagToEnvVar(flag);
|
1196
|
-
const char* const string_value = posix::GetEnv(env_var.c_str());
|
1197
|
-
return string_value == NULL ?
|
1198
|
-
default_value : strcmp(string_value, "0") != 0;
|
1199
|
-
}
|
1200
|
-
|
1201
|
-
// Reads and returns a 32-bit integer stored in the environment
|
1202
|
-
// variable corresponding to the given flag; if it isn't set or
|
1203
|
-
// doesn't represent a valid 32-bit integer, returns default_value.
|
1204
|
-
Int32 Int32FromGTestEnv(const char* flag, Int32 default_value) {
|
1205
|
-
#if defined(GTEST_GET_INT32_FROM_ENV_)
|
1206
|
-
return GTEST_GET_INT32_FROM_ENV_(flag, default_value);
|
1207
|
-
#endif // defined(GTEST_GET_INT32_FROM_ENV_)
|
1208
|
-
const std::string env_var = FlagToEnvVar(flag);
|
1209
|
-
const char* const string_value = posix::GetEnv(env_var.c_str());
|
1210
|
-
if (string_value == NULL) {
|
1211
|
-
// The environment variable is not set.
|
1212
|
-
return default_value;
|
1213
|
-
}
|
1214
|
-
|
1215
|
-
Int32 result = default_value;
|
1216
|
-
if (!ParseInt32(Message() << "Environment variable " << env_var,
|
1217
|
-
string_value, &result)) {
|
1218
|
-
printf("The default value %s is used.\n",
|
1219
|
-
(Message() << default_value).GetString().c_str());
|
1220
|
-
fflush(stdout);
|
1221
|
-
return default_value;
|
1222
|
-
}
|
1223
|
-
|
1224
|
-
return result;
|
1225
|
-
}
|
1226
|
-
|
1227
|
-
// Reads and returns the string environment variable corresponding to
|
1228
|
-
// the given flag; if it's not set, returns default_value.
|
1229
|
-
std::string StringFromGTestEnv(const char* flag, const char* default_value) {
|
1230
|
-
#if defined(GTEST_GET_STRING_FROM_ENV_)
|
1231
|
-
return GTEST_GET_STRING_FROM_ENV_(flag, default_value);
|
1232
|
-
#endif // defined(GTEST_GET_STRING_FROM_ENV_)
|
1233
|
-
const std::string env_var = FlagToEnvVar(flag);
|
1234
|
-
const char* value = posix::GetEnv(env_var.c_str());
|
1235
|
-
if (value != NULL) {
|
1236
|
-
return value;
|
1237
|
-
}
|
1238
|
-
|
1239
|
-
// As a special case for the 'output' flag, if GTEST_OUTPUT is not
|
1240
|
-
// set, we look for XML_OUTPUT_FILE, which is set by the Bazel build
|
1241
|
-
// system. The value of XML_OUTPUT_FILE is a filename without the
|
1242
|
-
// "xml:" prefix of GTEST_OUTPUT.
|
1243
|
-
//
|
1244
|
-
// The net priority order after flag processing is thus:
|
1245
|
-
// --gtest_output command line flag
|
1246
|
-
// GTEST_OUTPUT environment variable
|
1247
|
-
// XML_OUTPUT_FILE environment variable
|
1248
|
-
// 'default_value'
|
1249
|
-
if (strcmp(flag, "output") == 0) {
|
1250
|
-
value = posix::GetEnv("XML_OUTPUT_FILE");
|
1251
|
-
if (value != NULL) {
|
1252
|
-
return std::string("xml:") + value;
|
1253
|
-
}
|
1254
|
-
}
|
1255
|
-
return default_value;
|
1256
|
-
}
|
1257
|
-
|
1258
|
-
} // namespace internal
|
1259
|
-
} // namespace testing
|