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,159 +0,0 @@
|
|
1
|
-
// Copyright 2005, 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
|
-
// Tests for the Message class.
|
33
|
-
|
34
|
-
#include "gtest/gtest-message.h"
|
35
|
-
|
36
|
-
#include "gtest/gtest.h"
|
37
|
-
|
38
|
-
namespace {
|
39
|
-
|
40
|
-
using ::testing::Message;
|
41
|
-
|
42
|
-
// Tests the testing::Message class
|
43
|
-
|
44
|
-
// Tests the default constructor.
|
45
|
-
TEST(MessageTest, DefaultConstructor) {
|
46
|
-
const Message msg;
|
47
|
-
EXPECT_EQ("", msg.GetString());
|
48
|
-
}
|
49
|
-
|
50
|
-
// Tests the copy constructor.
|
51
|
-
TEST(MessageTest, CopyConstructor) {
|
52
|
-
const Message msg1("Hello");
|
53
|
-
const Message msg2(msg1);
|
54
|
-
EXPECT_EQ("Hello", msg2.GetString());
|
55
|
-
}
|
56
|
-
|
57
|
-
// Tests constructing a Message from a C-string.
|
58
|
-
TEST(MessageTest, ConstructsFromCString) {
|
59
|
-
Message msg("Hello");
|
60
|
-
EXPECT_EQ("Hello", msg.GetString());
|
61
|
-
}
|
62
|
-
|
63
|
-
// Tests streaming a float.
|
64
|
-
TEST(MessageTest, StreamsFloat) {
|
65
|
-
const std::string s = (Message() << 1.23456F << " " << 2.34567F).GetString();
|
66
|
-
// Both numbers should be printed with enough precision.
|
67
|
-
EXPECT_PRED_FORMAT2(testing::IsSubstring, "1.234560", s.c_str());
|
68
|
-
EXPECT_PRED_FORMAT2(testing::IsSubstring, " 2.345669", s.c_str());
|
69
|
-
}
|
70
|
-
|
71
|
-
// Tests streaming a double.
|
72
|
-
TEST(MessageTest, StreamsDouble) {
|
73
|
-
const std::string s = (Message() << 1260570880.4555497 << " "
|
74
|
-
<< 1260572265.1954534).GetString();
|
75
|
-
// Both numbers should be printed with enough precision.
|
76
|
-
EXPECT_PRED_FORMAT2(testing::IsSubstring, "1260570880.45", s.c_str());
|
77
|
-
EXPECT_PRED_FORMAT2(testing::IsSubstring, " 1260572265.19", s.c_str());
|
78
|
-
}
|
79
|
-
|
80
|
-
// Tests streaming a non-char pointer.
|
81
|
-
TEST(MessageTest, StreamsPointer) {
|
82
|
-
int n = 0;
|
83
|
-
int* p = &n;
|
84
|
-
EXPECT_NE("(null)", (Message() << p).GetString());
|
85
|
-
}
|
86
|
-
|
87
|
-
// Tests streaming a NULL non-char pointer.
|
88
|
-
TEST(MessageTest, StreamsNullPointer) {
|
89
|
-
int* p = NULL;
|
90
|
-
EXPECT_EQ("(null)", (Message() << p).GetString());
|
91
|
-
}
|
92
|
-
|
93
|
-
// Tests streaming a C string.
|
94
|
-
TEST(MessageTest, StreamsCString) {
|
95
|
-
EXPECT_EQ("Foo", (Message() << "Foo").GetString());
|
96
|
-
}
|
97
|
-
|
98
|
-
// Tests streaming a NULL C string.
|
99
|
-
TEST(MessageTest, StreamsNullCString) {
|
100
|
-
char* p = NULL;
|
101
|
-
EXPECT_EQ("(null)", (Message() << p).GetString());
|
102
|
-
}
|
103
|
-
|
104
|
-
// Tests streaming std::string.
|
105
|
-
TEST(MessageTest, StreamsString) {
|
106
|
-
const ::std::string str("Hello");
|
107
|
-
EXPECT_EQ("Hello", (Message() << str).GetString());
|
108
|
-
}
|
109
|
-
|
110
|
-
// Tests that we can output strings containing embedded NULs.
|
111
|
-
TEST(MessageTest, StreamsStringWithEmbeddedNUL) {
|
112
|
-
const char char_array_with_nul[] =
|
113
|
-
"Here's a NUL\0 and some more string";
|
114
|
-
const ::std::string string_with_nul(char_array_with_nul,
|
115
|
-
sizeof(char_array_with_nul) - 1);
|
116
|
-
EXPECT_EQ("Here's a NUL\\0 and some more string",
|
117
|
-
(Message() << string_with_nul).GetString());
|
118
|
-
}
|
119
|
-
|
120
|
-
// Tests streaming a NUL char.
|
121
|
-
TEST(MessageTest, StreamsNULChar) {
|
122
|
-
EXPECT_EQ("\\0", (Message() << '\0').GetString());
|
123
|
-
}
|
124
|
-
|
125
|
-
// Tests streaming int.
|
126
|
-
TEST(MessageTest, StreamsInt) {
|
127
|
-
EXPECT_EQ("123", (Message() << 123).GetString());
|
128
|
-
}
|
129
|
-
|
130
|
-
// Tests that basic IO manipulators (endl, ends, and flush) can be
|
131
|
-
// streamed to Message.
|
132
|
-
TEST(MessageTest, StreamsBasicIoManip) {
|
133
|
-
EXPECT_EQ("Line 1.\nA NUL char \\0 in line 2.",
|
134
|
-
(Message() << "Line 1." << std::endl
|
135
|
-
<< "A NUL char " << std::ends << std::flush
|
136
|
-
<< " in line 2.").GetString());
|
137
|
-
}
|
138
|
-
|
139
|
-
// Tests Message::GetString()
|
140
|
-
TEST(MessageTest, GetString) {
|
141
|
-
Message msg;
|
142
|
-
msg << 1 << " lamb";
|
143
|
-
EXPECT_EQ("1 lamb", msg.GetString());
|
144
|
-
}
|
145
|
-
|
146
|
-
// Tests streaming a Message object to an ostream.
|
147
|
-
TEST(MessageTest, StreamsToOStream) {
|
148
|
-
Message msg("Hello");
|
149
|
-
::std::stringstream ss;
|
150
|
-
ss << msg;
|
151
|
-
EXPECT_EQ("Hello", testing::internal::StringStreamToString(&ss));
|
152
|
-
}
|
153
|
-
|
154
|
-
// Tests that a Message object doesn't take up too much stack space.
|
155
|
-
TEST(MessageTest, DoesNotTakeUpMuchStackSpace) {
|
156
|
-
EXPECT_LE(sizeof(Message), 16U);
|
157
|
-
}
|
158
|
-
|
159
|
-
} // namespace
|
@@ -1,215 +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
|
-
// Authors: keith.ray@gmail.com (Keith Ray)
|
31
|
-
//
|
32
|
-
// Google Test UnitTestOptions tests
|
33
|
-
//
|
34
|
-
// This file tests classes and functions used internally by
|
35
|
-
// Google Test. They are subject to change without notice.
|
36
|
-
//
|
37
|
-
// This file is #included from gtest.cc, to avoid changing build or
|
38
|
-
// make-files on Windows and other platforms. Do not #include this file
|
39
|
-
// anywhere else!
|
40
|
-
|
41
|
-
#include "gtest/gtest.h"
|
42
|
-
|
43
|
-
#if GTEST_OS_WINDOWS_MOBILE
|
44
|
-
# include <windows.h>
|
45
|
-
#elif GTEST_OS_WINDOWS
|
46
|
-
# include <direct.h>
|
47
|
-
#endif // GTEST_OS_WINDOWS_MOBILE
|
48
|
-
|
49
|
-
// Indicates that this translation unit is part of Google Test's
|
50
|
-
// implementation. It must come before gtest-internal-inl.h is
|
51
|
-
// included, or there will be a compiler error. This trick is to
|
52
|
-
// prevent a user from accidentally including gtest-internal-inl.h in
|
53
|
-
// his code.
|
54
|
-
#define GTEST_IMPLEMENTATION_ 1
|
55
|
-
#include "src/gtest-internal-inl.h"
|
56
|
-
#undef GTEST_IMPLEMENTATION_
|
57
|
-
|
58
|
-
namespace testing {
|
59
|
-
namespace internal {
|
60
|
-
namespace {
|
61
|
-
|
62
|
-
// Turns the given relative path into an absolute path.
|
63
|
-
FilePath GetAbsolutePathOf(const FilePath& relative_path) {
|
64
|
-
return FilePath::ConcatPaths(FilePath::GetCurrentDir(), relative_path);
|
65
|
-
}
|
66
|
-
|
67
|
-
// Testing UnitTestOptions::GetOutputFormat/GetOutputFile.
|
68
|
-
|
69
|
-
TEST(XmlOutputTest, GetOutputFormatDefault) {
|
70
|
-
GTEST_FLAG(output) = "";
|
71
|
-
EXPECT_STREQ("", UnitTestOptions::GetOutputFormat().c_str());
|
72
|
-
}
|
73
|
-
|
74
|
-
TEST(XmlOutputTest, GetOutputFormat) {
|
75
|
-
GTEST_FLAG(output) = "xml:filename";
|
76
|
-
EXPECT_STREQ("xml", UnitTestOptions::GetOutputFormat().c_str());
|
77
|
-
}
|
78
|
-
|
79
|
-
TEST(XmlOutputTest, GetOutputFileDefault) {
|
80
|
-
GTEST_FLAG(output) = "";
|
81
|
-
EXPECT_EQ(GetAbsolutePathOf(FilePath("test_detail.xml")).string(),
|
82
|
-
UnitTestOptions::GetAbsolutePathToOutputFile());
|
83
|
-
}
|
84
|
-
|
85
|
-
TEST(XmlOutputTest, GetOutputFileSingleFile) {
|
86
|
-
GTEST_FLAG(output) = "xml:filename.abc";
|
87
|
-
EXPECT_EQ(GetAbsolutePathOf(FilePath("filename.abc")).string(),
|
88
|
-
UnitTestOptions::GetAbsolutePathToOutputFile());
|
89
|
-
}
|
90
|
-
|
91
|
-
TEST(XmlOutputTest, GetOutputFileFromDirectoryPath) {
|
92
|
-
GTEST_FLAG(output) = "xml:path" GTEST_PATH_SEP_;
|
93
|
-
const std::string expected_output_file =
|
94
|
-
GetAbsolutePathOf(
|
95
|
-
FilePath(std::string("path") + GTEST_PATH_SEP_ +
|
96
|
-
GetCurrentExecutableName().string() + ".xml")).string();
|
97
|
-
const std::string& output_file =
|
98
|
-
UnitTestOptions::GetAbsolutePathToOutputFile();
|
99
|
-
#if GTEST_OS_WINDOWS
|
100
|
-
EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
|
101
|
-
#else
|
102
|
-
EXPECT_EQ(expected_output_file, output_file.c_str());
|
103
|
-
#endif
|
104
|
-
}
|
105
|
-
|
106
|
-
TEST(OutputFileHelpersTest, GetCurrentExecutableName) {
|
107
|
-
const std::string exe_str = GetCurrentExecutableName().string();
|
108
|
-
#if GTEST_OS_WINDOWS
|
109
|
-
const bool success =
|
110
|
-
_strcmpi("gtest-options_test", exe_str.c_str()) == 0 ||
|
111
|
-
_strcmpi("gtest-options-ex_test", exe_str.c_str()) == 0 ||
|
112
|
-
_strcmpi("gtest_all_test", exe_str.c_str()) == 0 ||
|
113
|
-
_strcmpi("gtest_dll_test", exe_str.c_str()) == 0;
|
114
|
-
#else
|
115
|
-
// TODO(wan@google.com): remove the hard-coded "lt-" prefix when
|
116
|
-
// Chandler Carruth's libtool replacement is ready.
|
117
|
-
const bool success =
|
118
|
-
exe_str == "gtest-options_test" ||
|
119
|
-
exe_str == "gtest_all_test" ||
|
120
|
-
exe_str == "lt-gtest_all_test" ||
|
121
|
-
exe_str == "gtest_dll_test";
|
122
|
-
#endif // GTEST_OS_WINDOWS
|
123
|
-
if (!success)
|
124
|
-
FAIL() << "GetCurrentExecutableName() returns " << exe_str;
|
125
|
-
}
|
126
|
-
|
127
|
-
class XmlOutputChangeDirTest : public Test {
|
128
|
-
protected:
|
129
|
-
virtual void SetUp() {
|
130
|
-
original_working_dir_ = FilePath::GetCurrentDir();
|
131
|
-
posix::ChDir("..");
|
132
|
-
// This will make the test fail if run from the root directory.
|
133
|
-
EXPECT_NE(original_working_dir_.string(),
|
134
|
-
FilePath::GetCurrentDir().string());
|
135
|
-
}
|
136
|
-
|
137
|
-
virtual void TearDown() {
|
138
|
-
posix::ChDir(original_working_dir_.string().c_str());
|
139
|
-
}
|
140
|
-
|
141
|
-
FilePath original_working_dir_;
|
142
|
-
};
|
143
|
-
|
144
|
-
TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefault) {
|
145
|
-
GTEST_FLAG(output) = "";
|
146
|
-
EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
|
147
|
-
FilePath("test_detail.xml")).string(),
|
148
|
-
UnitTestOptions::GetAbsolutePathToOutputFile());
|
149
|
-
}
|
150
|
-
|
151
|
-
TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefaultXML) {
|
152
|
-
GTEST_FLAG(output) = "xml";
|
153
|
-
EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
|
154
|
-
FilePath("test_detail.xml")).string(),
|
155
|
-
UnitTestOptions::GetAbsolutePathToOutputFile());
|
156
|
-
}
|
157
|
-
|
158
|
-
TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativeFile) {
|
159
|
-
GTEST_FLAG(output) = "xml:filename.abc";
|
160
|
-
EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
|
161
|
-
FilePath("filename.abc")).string(),
|
162
|
-
UnitTestOptions::GetAbsolutePathToOutputFile());
|
163
|
-
}
|
164
|
-
|
165
|
-
TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativePath) {
|
166
|
-
GTEST_FLAG(output) = "xml:path" GTEST_PATH_SEP_;
|
167
|
-
const std::string expected_output_file =
|
168
|
-
FilePath::ConcatPaths(
|
169
|
-
original_working_dir_,
|
170
|
-
FilePath(std::string("path") + GTEST_PATH_SEP_ +
|
171
|
-
GetCurrentExecutableName().string() + ".xml")).string();
|
172
|
-
const std::string& output_file =
|
173
|
-
UnitTestOptions::GetAbsolutePathToOutputFile();
|
174
|
-
#if GTEST_OS_WINDOWS
|
175
|
-
EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
|
176
|
-
#else
|
177
|
-
EXPECT_EQ(expected_output_file, output_file.c_str());
|
178
|
-
#endif
|
179
|
-
}
|
180
|
-
|
181
|
-
TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsoluteFile) {
|
182
|
-
#if GTEST_OS_WINDOWS
|
183
|
-
GTEST_FLAG(output) = "xml:c:\\tmp\\filename.abc";
|
184
|
-
EXPECT_EQ(FilePath("c:\\tmp\\filename.abc").string(),
|
185
|
-
UnitTestOptions::GetAbsolutePathToOutputFile());
|
186
|
-
#else
|
187
|
-
GTEST_FLAG(output) ="xml:/tmp/filename.abc";
|
188
|
-
EXPECT_EQ(FilePath("/tmp/filename.abc").string(),
|
189
|
-
UnitTestOptions::GetAbsolutePathToOutputFile());
|
190
|
-
#endif
|
191
|
-
}
|
192
|
-
|
193
|
-
TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsolutePath) {
|
194
|
-
#if GTEST_OS_WINDOWS
|
195
|
-
const std::string path = "c:\\tmp\\";
|
196
|
-
#else
|
197
|
-
const std::string path = "/tmp/";
|
198
|
-
#endif
|
199
|
-
|
200
|
-
GTEST_FLAG(output) = "xml:" + path;
|
201
|
-
const std::string expected_output_file =
|
202
|
-
path + GetCurrentExecutableName().string() + ".xml";
|
203
|
-
const std::string& output_file =
|
204
|
-
UnitTestOptions::GetAbsolutePathToOutputFile();
|
205
|
-
|
206
|
-
#if GTEST_OS_WINDOWS
|
207
|
-
EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
|
208
|
-
#else
|
209
|
-
EXPECT_EQ(expected_output_file, output_file.c_str());
|
210
|
-
#endif
|
211
|
-
}
|
212
|
-
|
213
|
-
} // namespace
|
214
|
-
} // namespace internal
|
215
|
-
} // namespace testing
|
@@ -1,65 +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: vladl@google.com (Vlad Losev)
|
31
|
-
//
|
32
|
-
// Tests for Google Test itself. This verifies that the basic constructs of
|
33
|
-
// Google Test work.
|
34
|
-
|
35
|
-
#include "gtest/gtest.h"
|
36
|
-
|
37
|
-
#include "test/gtest-param-test_test.h"
|
38
|
-
|
39
|
-
#if GTEST_HAS_PARAM_TEST
|
40
|
-
|
41
|
-
using ::testing::Values;
|
42
|
-
using ::testing::internal::ParamGenerator;
|
43
|
-
|
44
|
-
// Tests that generators defined in a different translation unit
|
45
|
-
// are functional. The test using extern_gen is defined
|
46
|
-
// in gtest-param-test_test.cc.
|
47
|
-
ParamGenerator<int> extern_gen = Values(33);
|
48
|
-
|
49
|
-
// Tests that a parameterized test case can be defined in one translation unit
|
50
|
-
// and instantiated in another. The test is defined in gtest-param-test_test.cc
|
51
|
-
// and ExternalInstantiationTest fixture class is defined in
|
52
|
-
// gtest-param-test_test.h.
|
53
|
-
INSTANTIATE_TEST_CASE_P(MultiplesOf33,
|
54
|
-
ExternalInstantiationTest,
|
55
|
-
Values(33, 66));
|
56
|
-
|
57
|
-
// Tests that a parameterized test case can be instantiated
|
58
|
-
// in multiple translation units. Another instantiation is defined
|
59
|
-
// in gtest-param-test_test.cc and InstantiationInMultipleTranslaionUnitsTest
|
60
|
-
// fixture is defined in gtest-param-test_test.h
|
61
|
-
INSTANTIATE_TEST_CASE_P(Sequence2,
|
62
|
-
InstantiationInMultipleTranslaionUnitsTest,
|
63
|
-
Values(42*3, 42*4, 42*5));
|
64
|
-
|
65
|
-
#endif // GTEST_HAS_PARAM_TEST
|
@@ -1,1055 +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: vladl@google.com (Vlad Losev)
|
31
|
-
//
|
32
|
-
// Tests for Google Test itself. This file verifies that the parameter
|
33
|
-
// generators objects produce correct parameter sequences and that
|
34
|
-
// Google Test runtime instantiates correct tests from those sequences.
|
35
|
-
|
36
|
-
#include "gtest/gtest.h"
|
37
|
-
|
38
|
-
#if GTEST_HAS_PARAM_TEST
|
39
|
-
|
40
|
-
# include <algorithm>
|
41
|
-
# include <iostream>
|
42
|
-
# include <list>
|
43
|
-
# include <sstream>
|
44
|
-
# include <string>
|
45
|
-
# include <vector>
|
46
|
-
|
47
|
-
// To include gtest-internal-inl.h.
|
48
|
-
# define GTEST_IMPLEMENTATION_ 1
|
49
|
-
# include "src/gtest-internal-inl.h" // for UnitTestOptions
|
50
|
-
# undef GTEST_IMPLEMENTATION_
|
51
|
-
|
52
|
-
# include "test/gtest-param-test_test.h"
|
53
|
-
|
54
|
-
using ::std::vector;
|
55
|
-
using ::std::sort;
|
56
|
-
|
57
|
-
using ::testing::AddGlobalTestEnvironment;
|
58
|
-
using ::testing::Bool;
|
59
|
-
using ::testing::Message;
|
60
|
-
using ::testing::Range;
|
61
|
-
using ::testing::TestWithParam;
|
62
|
-
using ::testing::Values;
|
63
|
-
using ::testing::ValuesIn;
|
64
|
-
|
65
|
-
# if GTEST_HAS_COMBINE
|
66
|
-
using ::testing::Combine;
|
67
|
-
using ::testing::get;
|
68
|
-
using ::testing::make_tuple;
|
69
|
-
using ::testing::tuple;
|
70
|
-
# endif // GTEST_HAS_COMBINE
|
71
|
-
|
72
|
-
using ::testing::internal::ParamGenerator;
|
73
|
-
using ::testing::internal::UnitTestOptions;
|
74
|
-
|
75
|
-
// Prints a value to a string.
|
76
|
-
//
|
77
|
-
// TODO(wan@google.com): remove PrintValue() when we move matchers and
|
78
|
-
// EXPECT_THAT() from Google Mock to Google Test. At that time, we
|
79
|
-
// can write EXPECT_THAT(x, Eq(y)) to compare two tuples x and y, as
|
80
|
-
// EXPECT_THAT() and the matchers know how to print tuples.
|
81
|
-
template <typename T>
|
82
|
-
::std::string PrintValue(const T& value) {
|
83
|
-
::std::stringstream stream;
|
84
|
-
stream << value;
|
85
|
-
return stream.str();
|
86
|
-
}
|
87
|
-
|
88
|
-
# if GTEST_HAS_COMBINE
|
89
|
-
|
90
|
-
// These overloads allow printing tuples in our tests. We cannot
|
91
|
-
// define an operator<< for tuples, as that definition needs to be in
|
92
|
-
// the std namespace in order to be picked up by Google Test via
|
93
|
-
// Argument-Dependent Lookup, yet defining anything in the std
|
94
|
-
// namespace in non-STL code is undefined behavior.
|
95
|
-
|
96
|
-
template <typename T1, typename T2>
|
97
|
-
::std::string PrintValue(const tuple<T1, T2>& value) {
|
98
|
-
::std::stringstream stream;
|
99
|
-
stream << "(" << get<0>(value) << ", " << get<1>(value) << ")";
|
100
|
-
return stream.str();
|
101
|
-
}
|
102
|
-
|
103
|
-
template <typename T1, typename T2, typename T3>
|
104
|
-
::std::string PrintValue(const tuple<T1, T2, T3>& value) {
|
105
|
-
::std::stringstream stream;
|
106
|
-
stream << "(" << get<0>(value) << ", " << get<1>(value)
|
107
|
-
<< ", "<< get<2>(value) << ")";
|
108
|
-
return stream.str();
|
109
|
-
}
|
110
|
-
|
111
|
-
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
112
|
-
typename T6, typename T7, typename T8, typename T9, typename T10>
|
113
|
-
::std::string PrintValue(
|
114
|
-
const tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& value) {
|
115
|
-
::std::stringstream stream;
|
116
|
-
stream << "(" << get<0>(value) << ", " << get<1>(value)
|
117
|
-
<< ", "<< get<2>(value) << ", " << get<3>(value)
|
118
|
-
<< ", "<< get<4>(value) << ", " << get<5>(value)
|
119
|
-
<< ", "<< get<6>(value) << ", " << get<7>(value)
|
120
|
-
<< ", "<< get<8>(value) << ", " << get<9>(value) << ")";
|
121
|
-
return stream.str();
|
122
|
-
}
|
123
|
-
|
124
|
-
# endif // GTEST_HAS_COMBINE
|
125
|
-
|
126
|
-
// Verifies that a sequence generated by the generator and accessed
|
127
|
-
// via the iterator object matches the expected one using Google Test
|
128
|
-
// assertions.
|
129
|
-
template <typename T, size_t N>
|
130
|
-
void VerifyGenerator(const ParamGenerator<T>& generator,
|
131
|
-
const T (&expected_values)[N]) {
|
132
|
-
typename ParamGenerator<T>::iterator it = generator.begin();
|
133
|
-
for (size_t i = 0; i < N; ++i) {
|
134
|
-
ASSERT_FALSE(it == generator.end())
|
135
|
-
<< "At element " << i << " when accessing via an iterator "
|
136
|
-
<< "created with the copy constructor.\n";
|
137
|
-
// We cannot use EXPECT_EQ() here as the values may be tuples,
|
138
|
-
// which don't support <<.
|
139
|
-
EXPECT_TRUE(expected_values[i] == *it)
|
140
|
-
<< "where i is " << i
|
141
|
-
<< ", expected_values[i] is " << PrintValue(expected_values[i])
|
142
|
-
<< ", *it is " << PrintValue(*it)
|
143
|
-
<< ", and 'it' is an iterator created with the copy constructor.\n";
|
144
|
-
it++;
|
145
|
-
}
|
146
|
-
EXPECT_TRUE(it == generator.end())
|
147
|
-
<< "At the presumed end of sequence when accessing via an iterator "
|
148
|
-
<< "created with the copy constructor.\n";
|
149
|
-
|
150
|
-
// Test the iterator assignment. The following lines verify that
|
151
|
-
// the sequence accessed via an iterator initialized via the
|
152
|
-
// assignment operator (as opposed to a copy constructor) matches
|
153
|
-
// just the same.
|
154
|
-
it = generator.begin();
|
155
|
-
for (size_t i = 0; i < N; ++i) {
|
156
|
-
ASSERT_FALSE(it == generator.end())
|
157
|
-
<< "At element " << i << " when accessing via an iterator "
|
158
|
-
<< "created with the assignment operator.\n";
|
159
|
-
EXPECT_TRUE(expected_values[i] == *it)
|
160
|
-
<< "where i is " << i
|
161
|
-
<< ", expected_values[i] is " << PrintValue(expected_values[i])
|
162
|
-
<< ", *it is " << PrintValue(*it)
|
163
|
-
<< ", and 'it' is an iterator created with the copy constructor.\n";
|
164
|
-
it++;
|
165
|
-
}
|
166
|
-
EXPECT_TRUE(it == generator.end())
|
167
|
-
<< "At the presumed end of sequence when accessing via an iterator "
|
168
|
-
<< "created with the assignment operator.\n";
|
169
|
-
}
|
170
|
-
|
171
|
-
template <typename T>
|
172
|
-
void VerifyGeneratorIsEmpty(const ParamGenerator<T>& generator) {
|
173
|
-
typename ParamGenerator<T>::iterator it = generator.begin();
|
174
|
-
EXPECT_TRUE(it == generator.end());
|
175
|
-
|
176
|
-
it = generator.begin();
|
177
|
-
EXPECT_TRUE(it == generator.end());
|
178
|
-
}
|
179
|
-
|
180
|
-
// Generator tests. They test that each of the provided generator functions
|
181
|
-
// generates an expected sequence of values. The general test pattern
|
182
|
-
// instantiates a generator using one of the generator functions,
|
183
|
-
// checks the sequence produced by the generator using its iterator API,
|
184
|
-
// and then resets the iterator back to the beginning of the sequence
|
185
|
-
// and checks the sequence again.
|
186
|
-
|
187
|
-
// Tests that iterators produced by generator functions conform to the
|
188
|
-
// ForwardIterator concept.
|
189
|
-
TEST(IteratorTest, ParamIteratorConformsToForwardIteratorConcept) {
|
190
|
-
const ParamGenerator<int> gen = Range(0, 10);
|
191
|
-
ParamGenerator<int>::iterator it = gen.begin();
|
192
|
-
|
193
|
-
// Verifies that iterator initialization works as expected.
|
194
|
-
ParamGenerator<int>::iterator it2 = it;
|
195
|
-
EXPECT_TRUE(*it == *it2) << "Initialized iterators must point to the "
|
196
|
-
<< "element same as its source points to";
|
197
|
-
|
198
|
-
// Verifies that iterator assignment works as expected.
|
199
|
-
it++;
|
200
|
-
EXPECT_FALSE(*it == *it2);
|
201
|
-
it2 = it;
|
202
|
-
EXPECT_TRUE(*it == *it2) << "Assigned iterators must point to the "
|
203
|
-
<< "element same as its source points to";
|
204
|
-
|
205
|
-
// Verifies that prefix operator++() returns *this.
|
206
|
-
EXPECT_EQ(&it, &(++it)) << "Result of the prefix operator++ must be "
|
207
|
-
<< "refer to the original object";
|
208
|
-
|
209
|
-
// Verifies that the result of the postfix operator++ points to the value
|
210
|
-
// pointed to by the original iterator.
|
211
|
-
int original_value = *it; // Have to compute it outside of macro call to be
|
212
|
-
// unaffected by the parameter evaluation order.
|
213
|
-
EXPECT_EQ(original_value, *(it++));
|
214
|
-
|
215
|
-
// Verifies that prefix and postfix operator++() advance an iterator
|
216
|
-
// all the same.
|
217
|
-
it2 = it;
|
218
|
-
it++;
|
219
|
-
++it2;
|
220
|
-
EXPECT_TRUE(*it == *it2);
|
221
|
-
}
|
222
|
-
|
223
|
-
// Tests that Range() generates the expected sequence.
|
224
|
-
TEST(RangeTest, IntRangeWithDefaultStep) {
|
225
|
-
const ParamGenerator<int> gen = Range(0, 3);
|
226
|
-
const int expected_values[] = {0, 1, 2};
|
227
|
-
VerifyGenerator(gen, expected_values);
|
228
|
-
}
|
229
|
-
|
230
|
-
// Edge case. Tests that Range() generates the single element sequence
|
231
|
-
// as expected when provided with range limits that are equal.
|
232
|
-
TEST(RangeTest, IntRangeSingleValue) {
|
233
|
-
const ParamGenerator<int> gen = Range(0, 1);
|
234
|
-
const int expected_values[] = {0};
|
235
|
-
VerifyGenerator(gen, expected_values);
|
236
|
-
}
|
237
|
-
|
238
|
-
// Edge case. Tests that Range() with generates empty sequence when
|
239
|
-
// supplied with an empty range.
|
240
|
-
TEST(RangeTest, IntRangeEmpty) {
|
241
|
-
const ParamGenerator<int> gen = Range(0, 0);
|
242
|
-
VerifyGeneratorIsEmpty(gen);
|
243
|
-
}
|
244
|
-
|
245
|
-
// Tests that Range() with custom step (greater then one) generates
|
246
|
-
// the expected sequence.
|
247
|
-
TEST(RangeTest, IntRangeWithCustomStep) {
|
248
|
-
const ParamGenerator<int> gen = Range(0, 9, 3);
|
249
|
-
const int expected_values[] = {0, 3, 6};
|
250
|
-
VerifyGenerator(gen, expected_values);
|
251
|
-
}
|
252
|
-
|
253
|
-
// Tests that Range() with custom step (greater then one) generates
|
254
|
-
// the expected sequence when the last element does not fall on the
|
255
|
-
// upper range limit. Sequences generated by Range() must not have
|
256
|
-
// elements beyond the range limits.
|
257
|
-
TEST(RangeTest, IntRangeWithCustomStepOverUpperBound) {
|
258
|
-
const ParamGenerator<int> gen = Range(0, 4, 3);
|
259
|
-
const int expected_values[] = {0, 3};
|
260
|
-
VerifyGenerator(gen, expected_values);
|
261
|
-
}
|
262
|
-
|
263
|
-
// Verifies that Range works with user-defined types that define
|
264
|
-
// copy constructor, operator=(), operator+(), and operator<().
|
265
|
-
class DogAdder {
|
266
|
-
public:
|
267
|
-
explicit DogAdder(const char* a_value) : value_(a_value) {}
|
268
|
-
DogAdder(const DogAdder& other) : value_(other.value_.c_str()) {}
|
269
|
-
|
270
|
-
DogAdder operator=(const DogAdder& other) {
|
271
|
-
if (this != &other)
|
272
|
-
value_ = other.value_;
|
273
|
-
return *this;
|
274
|
-
}
|
275
|
-
DogAdder operator+(const DogAdder& other) const {
|
276
|
-
Message msg;
|
277
|
-
msg << value_.c_str() << other.value_.c_str();
|
278
|
-
return DogAdder(msg.GetString().c_str());
|
279
|
-
}
|
280
|
-
bool operator<(const DogAdder& other) const {
|
281
|
-
return value_ < other.value_;
|
282
|
-
}
|
283
|
-
const std::string& value() const { return value_; }
|
284
|
-
|
285
|
-
private:
|
286
|
-
std::string value_;
|
287
|
-
};
|
288
|
-
|
289
|
-
TEST(RangeTest, WorksWithACustomType) {
|
290
|
-
const ParamGenerator<DogAdder> gen =
|
291
|
-
Range(DogAdder("cat"), DogAdder("catdogdog"), DogAdder("dog"));
|
292
|
-
ParamGenerator<DogAdder>::iterator it = gen.begin();
|
293
|
-
|
294
|
-
ASSERT_FALSE(it == gen.end());
|
295
|
-
EXPECT_STREQ("cat", it->value().c_str());
|
296
|
-
|
297
|
-
ASSERT_FALSE(++it == gen.end());
|
298
|
-
EXPECT_STREQ("catdog", it->value().c_str());
|
299
|
-
|
300
|
-
EXPECT_TRUE(++it == gen.end());
|
301
|
-
}
|
302
|
-
|
303
|
-
class IntWrapper {
|
304
|
-
public:
|
305
|
-
explicit IntWrapper(int a_value) : value_(a_value) {}
|
306
|
-
IntWrapper(const IntWrapper& other) : value_(other.value_) {}
|
307
|
-
|
308
|
-
IntWrapper operator=(const IntWrapper& other) {
|
309
|
-
value_ = other.value_;
|
310
|
-
return *this;
|
311
|
-
}
|
312
|
-
// operator+() adds a different type.
|
313
|
-
IntWrapper operator+(int other) const { return IntWrapper(value_ + other); }
|
314
|
-
bool operator<(const IntWrapper& other) const {
|
315
|
-
return value_ < other.value_;
|
316
|
-
}
|
317
|
-
int value() const { return value_; }
|
318
|
-
|
319
|
-
private:
|
320
|
-
int value_;
|
321
|
-
};
|
322
|
-
|
323
|
-
TEST(RangeTest, WorksWithACustomTypeWithDifferentIncrementType) {
|
324
|
-
const ParamGenerator<IntWrapper> gen = Range(IntWrapper(0), IntWrapper(2));
|
325
|
-
ParamGenerator<IntWrapper>::iterator it = gen.begin();
|
326
|
-
|
327
|
-
ASSERT_FALSE(it == gen.end());
|
328
|
-
EXPECT_EQ(0, it->value());
|
329
|
-
|
330
|
-
ASSERT_FALSE(++it == gen.end());
|
331
|
-
EXPECT_EQ(1, it->value());
|
332
|
-
|
333
|
-
EXPECT_TRUE(++it == gen.end());
|
334
|
-
}
|
335
|
-
|
336
|
-
// Tests that ValuesIn() with an array parameter generates
|
337
|
-
// the expected sequence.
|
338
|
-
TEST(ValuesInTest, ValuesInArray) {
|
339
|
-
int array[] = {3, 5, 8};
|
340
|
-
const ParamGenerator<int> gen = ValuesIn(array);
|
341
|
-
VerifyGenerator(gen, array);
|
342
|
-
}
|
343
|
-
|
344
|
-
// Tests that ValuesIn() with a const array parameter generates
|
345
|
-
// the expected sequence.
|
346
|
-
TEST(ValuesInTest, ValuesInConstArray) {
|
347
|
-
const int array[] = {3, 5, 8};
|
348
|
-
const ParamGenerator<int> gen = ValuesIn(array);
|
349
|
-
VerifyGenerator(gen, array);
|
350
|
-
}
|
351
|
-
|
352
|
-
// Edge case. Tests that ValuesIn() with an array parameter containing a
|
353
|
-
// single element generates the single element sequence.
|
354
|
-
TEST(ValuesInTest, ValuesInSingleElementArray) {
|
355
|
-
int array[] = {42};
|
356
|
-
const ParamGenerator<int> gen = ValuesIn(array);
|
357
|
-
VerifyGenerator(gen, array);
|
358
|
-
}
|
359
|
-
|
360
|
-
// Tests that ValuesIn() generates the expected sequence for an STL
|
361
|
-
// container (vector).
|
362
|
-
TEST(ValuesInTest, ValuesInVector) {
|
363
|
-
typedef ::std::vector<int> ContainerType;
|
364
|
-
ContainerType values;
|
365
|
-
values.push_back(3);
|
366
|
-
values.push_back(5);
|
367
|
-
values.push_back(8);
|
368
|
-
const ParamGenerator<int> gen = ValuesIn(values);
|
369
|
-
|
370
|
-
const int expected_values[] = {3, 5, 8};
|
371
|
-
VerifyGenerator(gen, expected_values);
|
372
|
-
}
|
373
|
-
|
374
|
-
// Tests that ValuesIn() generates the expected sequence.
|
375
|
-
TEST(ValuesInTest, ValuesInIteratorRange) {
|
376
|
-
typedef ::std::vector<int> ContainerType;
|
377
|
-
ContainerType values;
|
378
|
-
values.push_back(3);
|
379
|
-
values.push_back(5);
|
380
|
-
values.push_back(8);
|
381
|
-
const ParamGenerator<int> gen = ValuesIn(values.begin(), values.end());
|
382
|
-
|
383
|
-
const int expected_values[] = {3, 5, 8};
|
384
|
-
VerifyGenerator(gen, expected_values);
|
385
|
-
}
|
386
|
-
|
387
|
-
// Edge case. Tests that ValuesIn() provided with an iterator range specifying a
|
388
|
-
// single value generates a single-element sequence.
|
389
|
-
TEST(ValuesInTest, ValuesInSingleElementIteratorRange) {
|
390
|
-
typedef ::std::vector<int> ContainerType;
|
391
|
-
ContainerType values;
|
392
|
-
values.push_back(42);
|
393
|
-
const ParamGenerator<int> gen = ValuesIn(values.begin(), values.end());
|
394
|
-
|
395
|
-
const int expected_values[] = {42};
|
396
|
-
VerifyGenerator(gen, expected_values);
|
397
|
-
}
|
398
|
-
|
399
|
-
// Edge case. Tests that ValuesIn() provided with an empty iterator range
|
400
|
-
// generates an empty sequence.
|
401
|
-
TEST(ValuesInTest, ValuesInEmptyIteratorRange) {
|
402
|
-
typedef ::std::vector<int> ContainerType;
|
403
|
-
ContainerType values;
|
404
|
-
const ParamGenerator<int> gen = ValuesIn(values.begin(), values.end());
|
405
|
-
|
406
|
-
VerifyGeneratorIsEmpty(gen);
|
407
|
-
}
|
408
|
-
|
409
|
-
// Tests that the Values() generates the expected sequence.
|
410
|
-
TEST(ValuesTest, ValuesWorks) {
|
411
|
-
const ParamGenerator<int> gen = Values(3, 5, 8);
|
412
|
-
|
413
|
-
const int expected_values[] = {3, 5, 8};
|
414
|
-
VerifyGenerator(gen, expected_values);
|
415
|
-
}
|
416
|
-
|
417
|
-
// Tests that Values() generates the expected sequences from elements of
|
418
|
-
// different types convertible to ParamGenerator's parameter type.
|
419
|
-
TEST(ValuesTest, ValuesWorksForValuesOfCompatibleTypes) {
|
420
|
-
const ParamGenerator<double> gen = Values(3, 5.0f, 8.0);
|
421
|
-
|
422
|
-
const double expected_values[] = {3.0, 5.0, 8.0};
|
423
|
-
VerifyGenerator(gen, expected_values);
|
424
|
-
}
|
425
|
-
|
426
|
-
TEST(ValuesTest, ValuesWorksForMaxLengthList) {
|
427
|
-
const ParamGenerator<int> gen = Values(
|
428
|
-
10, 20, 30, 40, 50, 60, 70, 80, 90, 100,
|
429
|
-
110, 120, 130, 140, 150, 160, 170, 180, 190, 200,
|
430
|
-
210, 220, 230, 240, 250, 260, 270, 280, 290, 300,
|
431
|
-
310, 320, 330, 340, 350, 360, 370, 380, 390, 400,
|
432
|
-
410, 420, 430, 440, 450, 460, 470, 480, 490, 500);
|
433
|
-
|
434
|
-
const int expected_values[] = {
|
435
|
-
10, 20, 30, 40, 50, 60, 70, 80, 90, 100,
|
436
|
-
110, 120, 130, 140, 150, 160, 170, 180, 190, 200,
|
437
|
-
210, 220, 230, 240, 250, 260, 270, 280, 290, 300,
|
438
|
-
310, 320, 330, 340, 350, 360, 370, 380, 390, 400,
|
439
|
-
410, 420, 430, 440, 450, 460, 470, 480, 490, 500};
|
440
|
-
VerifyGenerator(gen, expected_values);
|
441
|
-
}
|
442
|
-
|
443
|
-
// Edge case test. Tests that single-parameter Values() generates the sequence
|
444
|
-
// with the single value.
|
445
|
-
TEST(ValuesTest, ValuesWithSingleParameter) {
|
446
|
-
const ParamGenerator<int> gen = Values(42);
|
447
|
-
|
448
|
-
const int expected_values[] = {42};
|
449
|
-
VerifyGenerator(gen, expected_values);
|
450
|
-
}
|
451
|
-
|
452
|
-
// Tests that Bool() generates sequence (false, true).
|
453
|
-
TEST(BoolTest, BoolWorks) {
|
454
|
-
const ParamGenerator<bool> gen = Bool();
|
455
|
-
|
456
|
-
const bool expected_values[] = {false, true};
|
457
|
-
VerifyGenerator(gen, expected_values);
|
458
|
-
}
|
459
|
-
|
460
|
-
# if GTEST_HAS_COMBINE
|
461
|
-
|
462
|
-
// Tests that Combine() with two parameters generates the expected sequence.
|
463
|
-
TEST(CombineTest, CombineWithTwoParameters) {
|
464
|
-
const char* foo = "foo";
|
465
|
-
const char* bar = "bar";
|
466
|
-
const ParamGenerator<tuple<const char*, int> > gen =
|
467
|
-
Combine(Values(foo, bar), Values(3, 4));
|
468
|
-
|
469
|
-
tuple<const char*, int> expected_values[] = {
|
470
|
-
make_tuple(foo, 3), make_tuple(foo, 4),
|
471
|
-
make_tuple(bar, 3), make_tuple(bar, 4)};
|
472
|
-
VerifyGenerator(gen, expected_values);
|
473
|
-
}
|
474
|
-
|
475
|
-
// Tests that Combine() with three parameters generates the expected sequence.
|
476
|
-
TEST(CombineTest, CombineWithThreeParameters) {
|
477
|
-
const ParamGenerator<tuple<int, int, int> > gen = Combine(Values(0, 1),
|
478
|
-
Values(3, 4),
|
479
|
-
Values(5, 6));
|
480
|
-
tuple<int, int, int> expected_values[] = {
|
481
|
-
make_tuple(0, 3, 5), make_tuple(0, 3, 6),
|
482
|
-
make_tuple(0, 4, 5), make_tuple(0, 4, 6),
|
483
|
-
make_tuple(1, 3, 5), make_tuple(1, 3, 6),
|
484
|
-
make_tuple(1, 4, 5), make_tuple(1, 4, 6)};
|
485
|
-
VerifyGenerator(gen, expected_values);
|
486
|
-
}
|
487
|
-
|
488
|
-
// Tests that the Combine() with the first parameter generating a single value
|
489
|
-
// sequence generates a sequence with the number of elements equal to the
|
490
|
-
// number of elements in the sequence generated by the second parameter.
|
491
|
-
TEST(CombineTest, CombineWithFirstParameterSingleValue) {
|
492
|
-
const ParamGenerator<tuple<int, int> > gen = Combine(Values(42),
|
493
|
-
Values(0, 1));
|
494
|
-
|
495
|
-
tuple<int, int> expected_values[] = {make_tuple(42, 0), make_tuple(42, 1)};
|
496
|
-
VerifyGenerator(gen, expected_values);
|
497
|
-
}
|
498
|
-
|
499
|
-
// Tests that the Combine() with the second parameter generating a single value
|
500
|
-
// sequence generates a sequence with the number of elements equal to the
|
501
|
-
// number of elements in the sequence generated by the first parameter.
|
502
|
-
TEST(CombineTest, CombineWithSecondParameterSingleValue) {
|
503
|
-
const ParamGenerator<tuple<int, int> > gen = Combine(Values(0, 1),
|
504
|
-
Values(42));
|
505
|
-
|
506
|
-
tuple<int, int> expected_values[] = {make_tuple(0, 42), make_tuple(1, 42)};
|
507
|
-
VerifyGenerator(gen, expected_values);
|
508
|
-
}
|
509
|
-
|
510
|
-
// Tests that when the first parameter produces an empty sequence,
|
511
|
-
// Combine() produces an empty sequence, too.
|
512
|
-
TEST(CombineTest, CombineWithFirstParameterEmptyRange) {
|
513
|
-
const ParamGenerator<tuple<int, int> > gen = Combine(Range(0, 0),
|
514
|
-
Values(0, 1));
|
515
|
-
VerifyGeneratorIsEmpty(gen);
|
516
|
-
}
|
517
|
-
|
518
|
-
// Tests that when the second parameter produces an empty sequence,
|
519
|
-
// Combine() produces an empty sequence, too.
|
520
|
-
TEST(CombineTest, CombineWithSecondParameterEmptyRange) {
|
521
|
-
const ParamGenerator<tuple<int, int> > gen = Combine(Values(0, 1),
|
522
|
-
Range(1, 1));
|
523
|
-
VerifyGeneratorIsEmpty(gen);
|
524
|
-
}
|
525
|
-
|
526
|
-
// Edge case. Tests that combine works with the maximum number
|
527
|
-
// of parameters supported by Google Test (currently 10).
|
528
|
-
TEST(CombineTest, CombineWithMaxNumberOfParameters) {
|
529
|
-
const char* foo = "foo";
|
530
|
-
const char* bar = "bar";
|
531
|
-
const ParamGenerator<tuple<const char*, int, int, int, int, int, int, int,
|
532
|
-
int, int> > gen = Combine(Values(foo, bar),
|
533
|
-
Values(1), Values(2),
|
534
|
-
Values(3), Values(4),
|
535
|
-
Values(5), Values(6),
|
536
|
-
Values(7), Values(8),
|
537
|
-
Values(9));
|
538
|
-
|
539
|
-
tuple<const char*, int, int, int, int, int, int, int, int, int>
|
540
|
-
expected_values[] = {make_tuple(foo, 1, 2, 3, 4, 5, 6, 7, 8, 9),
|
541
|
-
make_tuple(bar, 1, 2, 3, 4, 5, 6, 7, 8, 9)};
|
542
|
-
VerifyGenerator(gen, expected_values);
|
543
|
-
}
|
544
|
-
|
545
|
-
# endif // GTEST_HAS_COMBINE
|
546
|
-
|
547
|
-
// Tests that an generator produces correct sequence after being
|
548
|
-
// assigned from another generator.
|
549
|
-
TEST(ParamGeneratorTest, AssignmentWorks) {
|
550
|
-
ParamGenerator<int> gen = Values(1, 2);
|
551
|
-
const ParamGenerator<int> gen2 = Values(3, 4);
|
552
|
-
gen = gen2;
|
553
|
-
|
554
|
-
const int expected_values[] = {3, 4};
|
555
|
-
VerifyGenerator(gen, expected_values);
|
556
|
-
}
|
557
|
-
|
558
|
-
// This test verifies that the tests are expanded and run as specified:
|
559
|
-
// one test per element from the sequence produced by the generator
|
560
|
-
// specified in INSTANTIATE_TEST_CASE_P. It also verifies that the test's
|
561
|
-
// fixture constructor, SetUp(), and TearDown() have run and have been
|
562
|
-
// supplied with the correct parameters.
|
563
|
-
|
564
|
-
// The use of environment object allows detection of the case where no test
|
565
|
-
// case functionality is run at all. In this case TestCaseTearDown will not
|
566
|
-
// be able to detect missing tests, naturally.
|
567
|
-
template <int kExpectedCalls>
|
568
|
-
class TestGenerationEnvironment : public ::testing::Environment {
|
569
|
-
public:
|
570
|
-
static TestGenerationEnvironment* Instance() {
|
571
|
-
static TestGenerationEnvironment* instance = new TestGenerationEnvironment;
|
572
|
-
return instance;
|
573
|
-
}
|
574
|
-
|
575
|
-
void FixtureConstructorExecuted() { fixture_constructor_count_++; }
|
576
|
-
void SetUpExecuted() { set_up_count_++; }
|
577
|
-
void TearDownExecuted() { tear_down_count_++; }
|
578
|
-
void TestBodyExecuted() { test_body_count_++; }
|
579
|
-
|
580
|
-
virtual void TearDown() {
|
581
|
-
// If all MultipleTestGenerationTest tests have been de-selected
|
582
|
-
// by the filter flag, the following checks make no sense.
|
583
|
-
bool perform_check = false;
|
584
|
-
|
585
|
-
for (int i = 0; i < kExpectedCalls; ++i) {
|
586
|
-
Message msg;
|
587
|
-
msg << "TestsExpandedAndRun/" << i;
|
588
|
-
if (UnitTestOptions::FilterMatchesTest(
|
589
|
-
"TestExpansionModule/MultipleTestGenerationTest",
|
590
|
-
msg.GetString().c_str())) {
|
591
|
-
perform_check = true;
|
592
|
-
}
|
593
|
-
}
|
594
|
-
if (perform_check) {
|
595
|
-
EXPECT_EQ(kExpectedCalls, fixture_constructor_count_)
|
596
|
-
<< "Fixture constructor of ParamTestGenerationTest test case "
|
597
|
-
<< "has not been run as expected.";
|
598
|
-
EXPECT_EQ(kExpectedCalls, set_up_count_)
|
599
|
-
<< "Fixture SetUp method of ParamTestGenerationTest test case "
|
600
|
-
<< "has not been run as expected.";
|
601
|
-
EXPECT_EQ(kExpectedCalls, tear_down_count_)
|
602
|
-
<< "Fixture TearDown method of ParamTestGenerationTest test case "
|
603
|
-
<< "has not been run as expected.";
|
604
|
-
EXPECT_EQ(kExpectedCalls, test_body_count_)
|
605
|
-
<< "Test in ParamTestGenerationTest test case "
|
606
|
-
<< "has not been run as expected.";
|
607
|
-
}
|
608
|
-
}
|
609
|
-
|
610
|
-
private:
|
611
|
-
TestGenerationEnvironment() : fixture_constructor_count_(0), set_up_count_(0),
|
612
|
-
tear_down_count_(0), test_body_count_(0) {}
|
613
|
-
|
614
|
-
int fixture_constructor_count_;
|
615
|
-
int set_up_count_;
|
616
|
-
int tear_down_count_;
|
617
|
-
int test_body_count_;
|
618
|
-
|
619
|
-
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestGenerationEnvironment);
|
620
|
-
};
|
621
|
-
|
622
|
-
const int test_generation_params[] = {36, 42, 72};
|
623
|
-
|
624
|
-
class TestGenerationTest : public TestWithParam<int> {
|
625
|
-
public:
|
626
|
-
enum {
|
627
|
-
PARAMETER_COUNT =
|
628
|
-
sizeof(test_generation_params)/sizeof(test_generation_params[0])
|
629
|
-
};
|
630
|
-
|
631
|
-
typedef TestGenerationEnvironment<PARAMETER_COUNT> Environment;
|
632
|
-
|
633
|
-
TestGenerationTest() {
|
634
|
-
Environment::Instance()->FixtureConstructorExecuted();
|
635
|
-
current_parameter_ = GetParam();
|
636
|
-
}
|
637
|
-
virtual void SetUp() {
|
638
|
-
Environment::Instance()->SetUpExecuted();
|
639
|
-
EXPECT_EQ(current_parameter_, GetParam());
|
640
|
-
}
|
641
|
-
virtual void TearDown() {
|
642
|
-
Environment::Instance()->TearDownExecuted();
|
643
|
-
EXPECT_EQ(current_parameter_, GetParam());
|
644
|
-
}
|
645
|
-
|
646
|
-
static void SetUpTestCase() {
|
647
|
-
bool all_tests_in_test_case_selected = true;
|
648
|
-
|
649
|
-
for (int i = 0; i < PARAMETER_COUNT; ++i) {
|
650
|
-
Message test_name;
|
651
|
-
test_name << "TestsExpandedAndRun/" << i;
|
652
|
-
if ( !UnitTestOptions::FilterMatchesTest(
|
653
|
-
"TestExpansionModule/MultipleTestGenerationTest",
|
654
|
-
test_name.GetString())) {
|
655
|
-
all_tests_in_test_case_selected = false;
|
656
|
-
}
|
657
|
-
}
|
658
|
-
EXPECT_TRUE(all_tests_in_test_case_selected)
|
659
|
-
<< "When running the TestGenerationTest test case all of its tests\n"
|
660
|
-
<< "must be selected by the filter flag for the test case to pass.\n"
|
661
|
-
<< "If not all of them are enabled, we can't reliably conclude\n"
|
662
|
-
<< "that the correct number of tests have been generated.";
|
663
|
-
|
664
|
-
collected_parameters_.clear();
|
665
|
-
}
|
666
|
-
|
667
|
-
static void TearDownTestCase() {
|
668
|
-
vector<int> expected_values(test_generation_params,
|
669
|
-
test_generation_params + PARAMETER_COUNT);
|
670
|
-
// Test execution order is not guaranteed by Google Test,
|
671
|
-
// so the order of values in collected_parameters_ can be
|
672
|
-
// different and we have to sort to compare.
|
673
|
-
sort(expected_values.begin(), expected_values.end());
|
674
|
-
sort(collected_parameters_.begin(), collected_parameters_.end());
|
675
|
-
|
676
|
-
EXPECT_TRUE(collected_parameters_ == expected_values);
|
677
|
-
}
|
678
|
-
|
679
|
-
protected:
|
680
|
-
int current_parameter_;
|
681
|
-
static vector<int> collected_parameters_;
|
682
|
-
|
683
|
-
private:
|
684
|
-
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestGenerationTest);
|
685
|
-
};
|
686
|
-
vector<int> TestGenerationTest::collected_parameters_;
|
687
|
-
|
688
|
-
TEST_P(TestGenerationTest, TestsExpandedAndRun) {
|
689
|
-
Environment::Instance()->TestBodyExecuted();
|
690
|
-
EXPECT_EQ(current_parameter_, GetParam());
|
691
|
-
collected_parameters_.push_back(GetParam());
|
692
|
-
}
|
693
|
-
INSTANTIATE_TEST_CASE_P(TestExpansionModule, TestGenerationTest,
|
694
|
-
ValuesIn(test_generation_params));
|
695
|
-
|
696
|
-
// This test verifies that the element sequence (third parameter of
|
697
|
-
// INSTANTIATE_TEST_CASE_P) is evaluated in InitGoogleTest() and neither at
|
698
|
-
// the call site of INSTANTIATE_TEST_CASE_P nor in RUN_ALL_TESTS(). For
|
699
|
-
// that, we declare param_value_ to be a static member of
|
700
|
-
// GeneratorEvaluationTest and initialize it to 0. We set it to 1 in
|
701
|
-
// main(), just before invocation of InitGoogleTest(). After calling
|
702
|
-
// InitGoogleTest(), we set the value to 2. If the sequence is evaluated
|
703
|
-
// before or after InitGoogleTest, INSTANTIATE_TEST_CASE_P will create a
|
704
|
-
// test with parameter other than 1, and the test body will fail the
|
705
|
-
// assertion.
|
706
|
-
class GeneratorEvaluationTest : public TestWithParam<int> {
|
707
|
-
public:
|
708
|
-
static int param_value() { return param_value_; }
|
709
|
-
static void set_param_value(int param_value) { param_value_ = param_value; }
|
710
|
-
|
711
|
-
private:
|
712
|
-
static int param_value_;
|
713
|
-
};
|
714
|
-
int GeneratorEvaluationTest::param_value_ = 0;
|
715
|
-
|
716
|
-
TEST_P(GeneratorEvaluationTest, GeneratorsEvaluatedInMain) {
|
717
|
-
EXPECT_EQ(1, GetParam());
|
718
|
-
}
|
719
|
-
INSTANTIATE_TEST_CASE_P(GenEvalModule,
|
720
|
-
GeneratorEvaluationTest,
|
721
|
-
Values(GeneratorEvaluationTest::param_value()));
|
722
|
-
|
723
|
-
// Tests that generators defined in a different translation unit are
|
724
|
-
// functional. Generator extern_gen is defined in gtest-param-test_test2.cc.
|
725
|
-
extern ParamGenerator<int> extern_gen;
|
726
|
-
class ExternalGeneratorTest : public TestWithParam<int> {};
|
727
|
-
TEST_P(ExternalGeneratorTest, ExternalGenerator) {
|
728
|
-
// Sequence produced by extern_gen contains only a single value
|
729
|
-
// which we verify here.
|
730
|
-
EXPECT_EQ(GetParam(), 33);
|
731
|
-
}
|
732
|
-
INSTANTIATE_TEST_CASE_P(ExternalGeneratorModule,
|
733
|
-
ExternalGeneratorTest,
|
734
|
-
extern_gen);
|
735
|
-
|
736
|
-
// Tests that a parameterized test case can be defined in one translation
|
737
|
-
// unit and instantiated in another. This test will be instantiated in
|
738
|
-
// gtest-param-test_test2.cc. ExternalInstantiationTest fixture class is
|
739
|
-
// defined in gtest-param-test_test.h.
|
740
|
-
TEST_P(ExternalInstantiationTest, IsMultipleOf33) {
|
741
|
-
EXPECT_EQ(0, GetParam() % 33);
|
742
|
-
}
|
743
|
-
|
744
|
-
// Tests that a parameterized test case can be instantiated with multiple
|
745
|
-
// generators.
|
746
|
-
class MultipleInstantiationTest : public TestWithParam<int> {};
|
747
|
-
TEST_P(MultipleInstantiationTest, AllowsMultipleInstances) {
|
748
|
-
}
|
749
|
-
INSTANTIATE_TEST_CASE_P(Sequence1, MultipleInstantiationTest, Values(1, 2));
|
750
|
-
INSTANTIATE_TEST_CASE_P(Sequence2, MultipleInstantiationTest, Range(3, 5));
|
751
|
-
|
752
|
-
// Tests that a parameterized test case can be instantiated
|
753
|
-
// in multiple translation units. This test will be instantiated
|
754
|
-
// here and in gtest-param-test_test2.cc.
|
755
|
-
// InstantiationInMultipleTranslationUnitsTest fixture class
|
756
|
-
// is defined in gtest-param-test_test.h.
|
757
|
-
TEST_P(InstantiationInMultipleTranslaionUnitsTest, IsMultipleOf42) {
|
758
|
-
EXPECT_EQ(0, GetParam() % 42);
|
759
|
-
}
|
760
|
-
INSTANTIATE_TEST_CASE_P(Sequence1,
|
761
|
-
InstantiationInMultipleTranslaionUnitsTest,
|
762
|
-
Values(42, 42*2));
|
763
|
-
|
764
|
-
// Tests that each iteration of parameterized test runs in a separate test
|
765
|
-
// object.
|
766
|
-
class SeparateInstanceTest : public TestWithParam<int> {
|
767
|
-
public:
|
768
|
-
SeparateInstanceTest() : count_(0) {}
|
769
|
-
|
770
|
-
static void TearDownTestCase() {
|
771
|
-
EXPECT_GE(global_count_, 2)
|
772
|
-
<< "If some (but not all) SeparateInstanceTest tests have been "
|
773
|
-
<< "filtered out this test will fail. Make sure that all "
|
774
|
-
<< "GeneratorEvaluationTest are selected or de-selected together "
|
775
|
-
<< "by the test filter.";
|
776
|
-
}
|
777
|
-
|
778
|
-
protected:
|
779
|
-
int count_;
|
780
|
-
static int global_count_;
|
781
|
-
};
|
782
|
-
int SeparateInstanceTest::global_count_ = 0;
|
783
|
-
|
784
|
-
TEST_P(SeparateInstanceTest, TestsRunInSeparateInstances) {
|
785
|
-
EXPECT_EQ(0, count_++);
|
786
|
-
global_count_++;
|
787
|
-
}
|
788
|
-
INSTANTIATE_TEST_CASE_P(FourElemSequence, SeparateInstanceTest, Range(1, 4));
|
789
|
-
|
790
|
-
// Tests that all instantiations of a test have named appropriately. Test
|
791
|
-
// defined with TEST_P(TestCaseName, TestName) and instantiated with
|
792
|
-
// INSTANTIATE_TEST_CASE_P(SequenceName, TestCaseName, generator) must be named
|
793
|
-
// SequenceName/TestCaseName.TestName/i, where i is the 0-based index of the
|
794
|
-
// sequence element used to instantiate the test.
|
795
|
-
class NamingTest : public TestWithParam<int> {};
|
796
|
-
|
797
|
-
TEST_P(NamingTest, TestsReportCorrectNamesAndParameters) {
|
798
|
-
const ::testing::TestInfo* const test_info =
|
799
|
-
::testing::UnitTest::GetInstance()->current_test_info();
|
800
|
-
|
801
|
-
EXPECT_STREQ("ZeroToFiveSequence/NamingTest", test_info->test_case_name());
|
802
|
-
|
803
|
-
Message index_stream;
|
804
|
-
index_stream << "TestsReportCorrectNamesAndParameters/" << GetParam();
|
805
|
-
EXPECT_STREQ(index_stream.GetString().c_str(), test_info->name());
|
806
|
-
|
807
|
-
EXPECT_EQ(::testing::PrintToString(GetParam()), test_info->value_param());
|
808
|
-
}
|
809
|
-
|
810
|
-
INSTANTIATE_TEST_CASE_P(ZeroToFiveSequence, NamingTest, Range(0, 5));
|
811
|
-
|
812
|
-
// Tests that user supplied custom parameter names are working correctly.
|
813
|
-
// Runs the test with a builtin helper method which uses PrintToString,
|
814
|
-
// as well as a custom function and custom functor to ensure all possible
|
815
|
-
// uses work correctly.
|
816
|
-
class CustomFunctorNamingTest : public TestWithParam<std::string> {};
|
817
|
-
TEST_P(CustomFunctorNamingTest, CustomTestNames) {}
|
818
|
-
|
819
|
-
struct CustomParamNameFunctor {
|
820
|
-
std::string operator()(const ::testing::TestParamInfo<std::string>& info) {
|
821
|
-
return info.param;
|
822
|
-
}
|
823
|
-
};
|
824
|
-
|
825
|
-
INSTANTIATE_TEST_CASE_P(CustomParamNameFunctor,
|
826
|
-
CustomFunctorNamingTest,
|
827
|
-
Values(std::string("FunctorName")),
|
828
|
-
CustomParamNameFunctor());
|
829
|
-
|
830
|
-
INSTANTIATE_TEST_CASE_P(AllAllowedCharacters,
|
831
|
-
CustomFunctorNamingTest,
|
832
|
-
Values("abcdefghijklmnopqrstuvwxyz",
|
833
|
-
"ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
834
|
-
"01234567890_"),
|
835
|
-
CustomParamNameFunctor());
|
836
|
-
|
837
|
-
inline std::string CustomParamNameFunction(
|
838
|
-
const ::testing::TestParamInfo<std::string>& info) {
|
839
|
-
return info.param;
|
840
|
-
}
|
841
|
-
|
842
|
-
class CustomFunctionNamingTest : public TestWithParam<std::string> {};
|
843
|
-
TEST_P(CustomFunctionNamingTest, CustomTestNames) {}
|
844
|
-
|
845
|
-
INSTANTIATE_TEST_CASE_P(CustomParamNameFunction,
|
846
|
-
CustomFunctionNamingTest,
|
847
|
-
Values(std::string("FunctionName")),
|
848
|
-
CustomParamNameFunction);
|
849
|
-
|
850
|
-
#if GTEST_LANG_CXX11
|
851
|
-
|
852
|
-
// Test custom naming with a lambda
|
853
|
-
|
854
|
-
class CustomLambdaNamingTest : public TestWithParam<std::string> {};
|
855
|
-
TEST_P(CustomLambdaNamingTest, CustomTestNames) {}
|
856
|
-
|
857
|
-
INSTANTIATE_TEST_CASE_P(CustomParamNameLambda,
|
858
|
-
CustomLambdaNamingTest,
|
859
|
-
Values(std::string("LambdaName")),
|
860
|
-
[](const ::testing::TestParamInfo<std::string>& info) {
|
861
|
-
return info.param;
|
862
|
-
});
|
863
|
-
|
864
|
-
#endif // GTEST_LANG_CXX11
|
865
|
-
|
866
|
-
TEST(CustomNamingTest, CheckNameRegistry) {
|
867
|
-
::testing::UnitTest* unit_test = ::testing::UnitTest::GetInstance();
|
868
|
-
std::set<std::string> test_names;
|
869
|
-
for (int case_num = 0;
|
870
|
-
case_num < unit_test->total_test_case_count();
|
871
|
-
++case_num) {
|
872
|
-
const ::testing::TestCase* test_case = unit_test->GetTestCase(case_num);
|
873
|
-
for (int test_num = 0;
|
874
|
-
test_num < test_case->total_test_count();
|
875
|
-
++test_num) {
|
876
|
-
const ::testing::TestInfo* test_info = test_case->GetTestInfo(test_num);
|
877
|
-
test_names.insert(std::string(test_info->name()));
|
878
|
-
}
|
879
|
-
}
|
880
|
-
EXPECT_EQ(1u, test_names.count("CustomTestNames/FunctorName"));
|
881
|
-
EXPECT_EQ(1u, test_names.count("CustomTestNames/FunctionName"));
|
882
|
-
#if GTEST_LANG_CXX11
|
883
|
-
EXPECT_EQ(1u, test_names.count("CustomTestNames/LambdaName"));
|
884
|
-
#endif // GTEST_LANG_CXX11
|
885
|
-
}
|
886
|
-
|
887
|
-
// Test a numeric name to ensure PrintToStringParamName works correctly.
|
888
|
-
|
889
|
-
class CustomIntegerNamingTest : public TestWithParam<int> {};
|
890
|
-
|
891
|
-
TEST_P(CustomIntegerNamingTest, TestsReportCorrectNames) {
|
892
|
-
const ::testing::TestInfo* const test_info =
|
893
|
-
::testing::UnitTest::GetInstance()->current_test_info();
|
894
|
-
Message test_name_stream;
|
895
|
-
test_name_stream << "TestsReportCorrectNames/" << GetParam();
|
896
|
-
EXPECT_STREQ(test_name_stream.GetString().c_str(), test_info->name());
|
897
|
-
}
|
898
|
-
|
899
|
-
INSTANTIATE_TEST_CASE_P(PrintToString,
|
900
|
-
CustomIntegerNamingTest,
|
901
|
-
Range(0, 5),
|
902
|
-
::testing::PrintToStringParamName());
|
903
|
-
|
904
|
-
// Test a custom struct with PrintToString.
|
905
|
-
|
906
|
-
struct CustomStruct {
|
907
|
-
explicit CustomStruct(int value) : x(value) {}
|
908
|
-
int x;
|
909
|
-
};
|
910
|
-
|
911
|
-
std::ostream& operator<<(std::ostream& stream, const CustomStruct& val) {
|
912
|
-
stream << val.x;
|
913
|
-
return stream;
|
914
|
-
}
|
915
|
-
|
916
|
-
class CustomStructNamingTest : public TestWithParam<CustomStruct> {};
|
917
|
-
|
918
|
-
TEST_P(CustomStructNamingTest, TestsReportCorrectNames) {
|
919
|
-
const ::testing::TestInfo* const test_info =
|
920
|
-
::testing::UnitTest::GetInstance()->current_test_info();
|
921
|
-
Message test_name_stream;
|
922
|
-
test_name_stream << "TestsReportCorrectNames/" << GetParam();
|
923
|
-
EXPECT_STREQ(test_name_stream.GetString().c_str(), test_info->name());
|
924
|
-
}
|
925
|
-
|
926
|
-
INSTANTIATE_TEST_CASE_P(PrintToString,
|
927
|
-
CustomStructNamingTest,
|
928
|
-
Values(CustomStruct(0), CustomStruct(1)),
|
929
|
-
::testing::PrintToStringParamName());
|
930
|
-
|
931
|
-
// Test that using a stateful parameter naming function works as expected.
|
932
|
-
|
933
|
-
struct StatefulNamingFunctor {
|
934
|
-
StatefulNamingFunctor() : sum(0) {}
|
935
|
-
std::string operator()(const ::testing::TestParamInfo<int>& info) {
|
936
|
-
int value = info.param + sum;
|
937
|
-
sum += info.param;
|
938
|
-
return ::testing::PrintToString(value);
|
939
|
-
}
|
940
|
-
int sum;
|
941
|
-
};
|
942
|
-
|
943
|
-
class StatefulNamingTest : public ::testing::TestWithParam<int> {
|
944
|
-
protected:
|
945
|
-
StatefulNamingTest() : sum_(0) {}
|
946
|
-
int sum_;
|
947
|
-
};
|
948
|
-
|
949
|
-
TEST_P(StatefulNamingTest, TestsReportCorrectNames) {
|
950
|
-
const ::testing::TestInfo* const test_info =
|
951
|
-
::testing::UnitTest::GetInstance()->current_test_info();
|
952
|
-
sum_ += GetParam();
|
953
|
-
Message test_name_stream;
|
954
|
-
test_name_stream << "TestsReportCorrectNames/" << sum_;
|
955
|
-
EXPECT_STREQ(test_name_stream.GetString().c_str(), test_info->name());
|
956
|
-
}
|
957
|
-
|
958
|
-
INSTANTIATE_TEST_CASE_P(StatefulNamingFunctor,
|
959
|
-
StatefulNamingTest,
|
960
|
-
Range(0, 5),
|
961
|
-
StatefulNamingFunctor());
|
962
|
-
|
963
|
-
// Class that cannot be streamed into an ostream. It needs to be copyable
|
964
|
-
// (and, in case of MSVC, also assignable) in order to be a test parameter
|
965
|
-
// type. Its default copy constructor and assignment operator do exactly
|
966
|
-
// what we need.
|
967
|
-
class Unstreamable {
|
968
|
-
public:
|
969
|
-
explicit Unstreamable(int value) : value_(value) {}
|
970
|
-
|
971
|
-
private:
|
972
|
-
int value_;
|
973
|
-
};
|
974
|
-
|
975
|
-
class CommentTest : public TestWithParam<Unstreamable> {};
|
976
|
-
|
977
|
-
TEST_P(CommentTest, TestsCorrectlyReportUnstreamableParams) {
|
978
|
-
const ::testing::TestInfo* const test_info =
|
979
|
-
::testing::UnitTest::GetInstance()->current_test_info();
|
980
|
-
|
981
|
-
EXPECT_EQ(::testing::PrintToString(GetParam()), test_info->value_param());
|
982
|
-
}
|
983
|
-
|
984
|
-
INSTANTIATE_TEST_CASE_P(InstantiationWithComments,
|
985
|
-
CommentTest,
|
986
|
-
Values(Unstreamable(1)));
|
987
|
-
|
988
|
-
// Verify that we can create a hierarchy of test fixtures, where the base
|
989
|
-
// class fixture is not parameterized and the derived class is. In this case
|
990
|
-
// ParameterizedDerivedTest inherits from NonParameterizedBaseTest. We
|
991
|
-
// perform simple tests on both.
|
992
|
-
class NonParameterizedBaseTest : public ::testing::Test {
|
993
|
-
public:
|
994
|
-
NonParameterizedBaseTest() : n_(17) { }
|
995
|
-
protected:
|
996
|
-
int n_;
|
997
|
-
};
|
998
|
-
|
999
|
-
class ParameterizedDerivedTest : public NonParameterizedBaseTest,
|
1000
|
-
public ::testing::WithParamInterface<int> {
|
1001
|
-
protected:
|
1002
|
-
ParameterizedDerivedTest() : count_(0) { }
|
1003
|
-
int count_;
|
1004
|
-
static int global_count_;
|
1005
|
-
};
|
1006
|
-
|
1007
|
-
int ParameterizedDerivedTest::global_count_ = 0;
|
1008
|
-
|
1009
|
-
TEST_F(NonParameterizedBaseTest, FixtureIsInitialized) {
|
1010
|
-
EXPECT_EQ(17, n_);
|
1011
|
-
}
|
1012
|
-
|
1013
|
-
TEST_P(ParameterizedDerivedTest, SeesSequence) {
|
1014
|
-
EXPECT_EQ(17, n_);
|
1015
|
-
EXPECT_EQ(0, count_++);
|
1016
|
-
EXPECT_EQ(GetParam(), global_count_++);
|
1017
|
-
}
|
1018
|
-
|
1019
|
-
class ParameterizedDeathTest : public ::testing::TestWithParam<int> { };
|
1020
|
-
|
1021
|
-
TEST_F(ParameterizedDeathTest, GetParamDiesFromTestF) {
|
1022
|
-
EXPECT_DEATH_IF_SUPPORTED(GetParam(),
|
1023
|
-
".* value-parameterized test .*");
|
1024
|
-
}
|
1025
|
-
|
1026
|
-
INSTANTIATE_TEST_CASE_P(RangeZeroToFive, ParameterizedDerivedTest, Range(0, 5));
|
1027
|
-
|
1028
|
-
#endif // GTEST_HAS_PARAM_TEST
|
1029
|
-
|
1030
|
-
TEST(CompileTest, CombineIsDefinedOnlyWhenGtestHasParamTestIsDefined) {
|
1031
|
-
#if GTEST_HAS_COMBINE && !GTEST_HAS_PARAM_TEST
|
1032
|
-
FAIL() << "GTEST_HAS_COMBINE is defined while GTEST_HAS_PARAM_TEST is not\n"
|
1033
|
-
#endif
|
1034
|
-
}
|
1035
|
-
|
1036
|
-
int main(int argc, char **argv) {
|
1037
|
-
#if GTEST_HAS_PARAM_TEST
|
1038
|
-
// Used in TestGenerationTest test case.
|
1039
|
-
AddGlobalTestEnvironment(TestGenerationTest::Environment::Instance());
|
1040
|
-
// Used in GeneratorEvaluationTest test case. Tests that the updated value
|
1041
|
-
// will be picked up for instantiating tests in GeneratorEvaluationTest.
|
1042
|
-
GeneratorEvaluationTest::set_param_value(1);
|
1043
|
-
#endif // GTEST_HAS_PARAM_TEST
|
1044
|
-
|
1045
|
-
::testing::InitGoogleTest(&argc, argv);
|
1046
|
-
|
1047
|
-
#if GTEST_HAS_PARAM_TEST
|
1048
|
-
// Used in GeneratorEvaluationTest test case. Tests that value updated
|
1049
|
-
// here will NOT be used for instantiating tests in
|
1050
|
-
// GeneratorEvaluationTest.
|
1051
|
-
GeneratorEvaluationTest::set_param_value(2);
|
1052
|
-
#endif // GTEST_HAS_PARAM_TEST
|
1053
|
-
|
1054
|
-
return RUN_ALL_TESTS();
|
1055
|
-
}
|