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,183 +0,0 @@
|
|
1
|
-
// Copyright 2008, Google Inc.
|
2
|
-
// All rights reserved.
|
3
|
-
//
|
4
|
-
// Redistribution and use in source and binary forms, with or without
|
5
|
-
// modification, are permitted provided that the following conditions are
|
6
|
-
// met:
|
7
|
-
//
|
8
|
-
// * Redistributions of source code must retain the above copyright
|
9
|
-
// notice, this list of conditions and the following disclaimer.
|
10
|
-
// * Redistributions in binary form must reproduce the above
|
11
|
-
// copyright notice, this list of conditions and the following disclaimer
|
12
|
-
// in the documentation and/or other materials provided with the
|
13
|
-
// distribution.
|
14
|
-
// * Neither the name of Google Inc. nor the names of its
|
15
|
-
// contributors may be used to endorse or promote products derived from
|
16
|
-
// this software without specific prior written permission.
|
17
|
-
//
|
18
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19
|
-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
20
|
-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
21
|
-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
22
|
-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
23
|
-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
24
|
-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
25
|
-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
26
|
-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
27
|
-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
//
|
30
|
-
// Author: wan@google.com (Zhanyong Wan)
|
31
|
-
|
32
|
-
#include "gmock/gmock.h"
|
33
|
-
#include "gmock/internal/gmock-port.h"
|
34
|
-
|
35
|
-
namespace testing {
|
36
|
-
|
37
|
-
// TODO(wan@google.com): support using environment variables to
|
38
|
-
// control the flag values, like what Google Test does.
|
39
|
-
|
40
|
-
GMOCK_DEFINE_bool_(catch_leaked_mocks, true,
|
41
|
-
"true iff Google Mock should report leaked mock objects "
|
42
|
-
"as failures.");
|
43
|
-
|
44
|
-
GMOCK_DEFINE_string_(verbose, internal::kWarningVerbosity,
|
45
|
-
"Controls how verbose Google Mock's output is."
|
46
|
-
" Valid values:\n"
|
47
|
-
" info - prints all messages.\n"
|
48
|
-
" warning - prints warnings and errors.\n"
|
49
|
-
" error - prints errors only.");
|
50
|
-
|
51
|
-
namespace internal {
|
52
|
-
|
53
|
-
// Parses a string as a command line flag. The string should have the
|
54
|
-
// format "--gmock_flag=value". When def_optional is true, the
|
55
|
-
// "=value" part can be omitted.
|
56
|
-
//
|
57
|
-
// Returns the value of the flag, or NULL if the parsing failed.
|
58
|
-
static const char* ParseGoogleMockFlagValue(const char* str,
|
59
|
-
const char* flag,
|
60
|
-
bool def_optional) {
|
61
|
-
// str and flag must not be NULL.
|
62
|
-
if (str == NULL || flag == NULL) return NULL;
|
63
|
-
|
64
|
-
// The flag must start with "--gmock_".
|
65
|
-
const std::string flag_str = std::string("--gmock_") + flag;
|
66
|
-
const size_t flag_len = flag_str.length();
|
67
|
-
if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;
|
68
|
-
|
69
|
-
// Skips the flag name.
|
70
|
-
const char* flag_end = str + flag_len;
|
71
|
-
|
72
|
-
// When def_optional is true, it's OK to not have a "=value" part.
|
73
|
-
if (def_optional && (flag_end[0] == '\0')) {
|
74
|
-
return flag_end;
|
75
|
-
}
|
76
|
-
|
77
|
-
// If def_optional is true and there are more characters after the
|
78
|
-
// flag name, or if def_optional is false, there must be a '=' after
|
79
|
-
// the flag name.
|
80
|
-
if (flag_end[0] != '=') return NULL;
|
81
|
-
|
82
|
-
// Returns the string after "=".
|
83
|
-
return flag_end + 1;
|
84
|
-
}
|
85
|
-
|
86
|
-
// Parses a string for a Google Mock bool flag, in the form of
|
87
|
-
// "--gmock_flag=value".
|
88
|
-
//
|
89
|
-
// On success, stores the value of the flag in *value, and returns
|
90
|
-
// true. On failure, returns false without changing *value.
|
91
|
-
static bool ParseGoogleMockBoolFlag(const char* str, const char* flag,
|
92
|
-
bool* value) {
|
93
|
-
// Gets the value of the flag as a string.
|
94
|
-
const char* const value_str = ParseGoogleMockFlagValue(str, flag, true);
|
95
|
-
|
96
|
-
// Aborts if the parsing failed.
|
97
|
-
if (value_str == NULL) return false;
|
98
|
-
|
99
|
-
// Converts the string value to a bool.
|
100
|
-
*value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
|
101
|
-
return true;
|
102
|
-
}
|
103
|
-
|
104
|
-
// Parses a string for a Google Mock string flag, in the form of
|
105
|
-
// "--gmock_flag=value".
|
106
|
-
//
|
107
|
-
// On success, stores the value of the flag in *value, and returns
|
108
|
-
// true. On failure, returns false without changing *value.
|
109
|
-
template <typename String>
|
110
|
-
static bool ParseGoogleMockStringFlag(const char* str, const char* flag,
|
111
|
-
String* value) {
|
112
|
-
// Gets the value of the flag as a string.
|
113
|
-
const char* const value_str = ParseGoogleMockFlagValue(str, flag, false);
|
114
|
-
|
115
|
-
// Aborts if the parsing failed.
|
116
|
-
if (value_str == NULL) return false;
|
117
|
-
|
118
|
-
// Sets *value to the value of the flag.
|
119
|
-
*value = value_str;
|
120
|
-
return true;
|
121
|
-
}
|
122
|
-
|
123
|
-
// The internal implementation of InitGoogleMock().
|
124
|
-
//
|
125
|
-
// The type parameter CharType can be instantiated to either char or
|
126
|
-
// wchar_t.
|
127
|
-
template <typename CharType>
|
128
|
-
void InitGoogleMockImpl(int* argc, CharType** argv) {
|
129
|
-
// Makes sure Google Test is initialized. InitGoogleTest() is
|
130
|
-
// idempotent, so it's fine if the user has already called it.
|
131
|
-
InitGoogleTest(argc, argv);
|
132
|
-
if (*argc <= 0) return;
|
133
|
-
|
134
|
-
for (int i = 1; i != *argc; i++) {
|
135
|
-
const std::string arg_string = StreamableToString(argv[i]);
|
136
|
-
const char* const arg = arg_string.c_str();
|
137
|
-
|
138
|
-
// Do we see a Google Mock flag?
|
139
|
-
if (ParseGoogleMockBoolFlag(arg, "catch_leaked_mocks",
|
140
|
-
&GMOCK_FLAG(catch_leaked_mocks)) ||
|
141
|
-
ParseGoogleMockStringFlag(arg, "verbose", &GMOCK_FLAG(verbose))) {
|
142
|
-
// Yes. Shift the remainder of the argv list left by one. Note
|
143
|
-
// that argv has (*argc + 1) elements, the last one always being
|
144
|
-
// NULL. The following loop moves the trailing NULL element as
|
145
|
-
// well.
|
146
|
-
for (int j = i; j != *argc; j++) {
|
147
|
-
argv[j] = argv[j + 1];
|
148
|
-
}
|
149
|
-
|
150
|
-
// Decrements the argument count.
|
151
|
-
(*argc)--;
|
152
|
-
|
153
|
-
// We also need to decrement the iterator as we just removed
|
154
|
-
// an element.
|
155
|
-
i--;
|
156
|
-
}
|
157
|
-
}
|
158
|
-
}
|
159
|
-
|
160
|
-
} // namespace internal
|
161
|
-
|
162
|
-
// Initializes Google Mock. This must be called before running the
|
163
|
-
// tests. In particular, it parses a command line for the flags that
|
164
|
-
// Google Mock recognizes. Whenever a Google Mock flag is seen, it is
|
165
|
-
// removed from argv, and *argc is decremented.
|
166
|
-
//
|
167
|
-
// No value is returned. Instead, the Google Mock flag variables are
|
168
|
-
// updated.
|
169
|
-
//
|
170
|
-
// Since Google Test is needed for Google Mock to work, this function
|
171
|
-
// also initializes Google Test and parses its flags, if that hasn't
|
172
|
-
// been done.
|
173
|
-
GTEST_API_ void InitGoogleMock(int* argc, char** argv) {
|
174
|
-
internal::InitGoogleMockImpl(argc, argv);
|
175
|
-
}
|
176
|
-
|
177
|
-
// This overloaded version can be used in Windows programs compiled in
|
178
|
-
// UNICODE mode.
|
179
|
-
GTEST_API_ void InitGoogleMock(int* argc, wchar_t** argv) {
|
180
|
-
internal::InitGoogleMockImpl(argc, argv);
|
181
|
-
}
|
182
|
-
|
183
|
-
} // namespace testing
|
@@ -1,54 +0,0 @@
|
|
1
|
-
// Copyright 2008, Google Inc.
|
2
|
-
// All rights reserved.
|
3
|
-
//
|
4
|
-
// Redistribution and use in source and binary forms, with or without
|
5
|
-
// modification, are permitted provided that the following conditions are
|
6
|
-
// met:
|
7
|
-
//
|
8
|
-
// * Redistributions of source code must retain the above copyright
|
9
|
-
// notice, this list of conditions and the following disclaimer.
|
10
|
-
// * Redistributions in binary form must reproduce the above
|
11
|
-
// copyright notice, this list of conditions and the following disclaimer
|
12
|
-
// in the documentation and/or other materials provided with the
|
13
|
-
// distribution.
|
14
|
-
// * Neither the name of Google Inc. nor the names of its
|
15
|
-
// contributors may be used to endorse or promote products derived from
|
16
|
-
// this software without specific prior written permission.
|
17
|
-
//
|
18
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19
|
-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
20
|
-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
21
|
-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
22
|
-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
23
|
-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
24
|
-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
25
|
-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
26
|
-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
27
|
-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
//
|
30
|
-
// Author: wan@google.com (Zhanyong Wan)
|
31
|
-
|
32
|
-
#include <iostream>
|
33
|
-
#include "gmock/gmock.h"
|
34
|
-
#include "gtest/gtest.h"
|
35
|
-
|
36
|
-
// MS C++ compiler/linker has a bug on Windows (not on Windows CE), which
|
37
|
-
// causes a link error when _tmain is defined in a static library and UNICODE
|
38
|
-
// is enabled. For this reason instead of _tmain, main function is used on
|
39
|
-
// Windows. See the following link to track the current status of this bug:
|
40
|
-
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=394464 // NOLINT
|
41
|
-
#if GTEST_OS_WINDOWS_MOBILE
|
42
|
-
# include <tchar.h> // NOLINT
|
43
|
-
|
44
|
-
GTEST_API_ int _tmain(int argc, TCHAR** argv) {
|
45
|
-
#else
|
46
|
-
GTEST_API_ int main(int argc, char** argv) {
|
47
|
-
#endif // GTEST_OS_WINDOWS_MOBILE
|
48
|
-
std::cout << "Running main() from gmock_main.cc\n";
|
49
|
-
// Since Google Mock depends on Google Test, InitGoogleMock() is
|
50
|
-
// also responsible for initializing Google Test. Therefore there's
|
51
|
-
// no need for calling testing::InitGoogleTest() separately.
|
52
|
-
testing::InitGoogleMock(&argc, argv);
|
53
|
-
return RUN_ALL_TESTS();
|
54
|
-
}
|
@@ -1,1411 +0,0 @@
|
|
1
|
-
// Copyright 2007, Google Inc.
|
2
|
-
// All rights reserved.
|
3
|
-
//
|
4
|
-
// Redistribution and use in source and binary forms, with or without
|
5
|
-
// modification, are permitted provided that the following conditions are
|
6
|
-
// met:
|
7
|
-
//
|
8
|
-
// * Redistributions of source code must retain the above copyright
|
9
|
-
// notice, this list of conditions and the following disclaimer.
|
10
|
-
// * Redistributions in binary form must reproduce the above
|
11
|
-
// copyright notice, this list of conditions and the following disclaimer
|
12
|
-
// in the documentation and/or other materials provided with the
|
13
|
-
// distribution.
|
14
|
-
// * Neither the name of Google Inc. nor the names of its
|
15
|
-
// contributors may be used to endorse or promote products derived from
|
16
|
-
// this software without specific prior written permission.
|
17
|
-
//
|
18
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19
|
-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
20
|
-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
21
|
-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
22
|
-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
23
|
-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
24
|
-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
25
|
-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
26
|
-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
27
|
-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
//
|
30
|
-
// Author: wan@google.com (Zhanyong Wan)
|
31
|
-
|
32
|
-
// Google Mock - a framework for writing C++ mock classes.
|
33
|
-
//
|
34
|
-
// This file tests the built-in actions.
|
35
|
-
|
36
|
-
#include "gmock/gmock-actions.h"
|
37
|
-
#include <algorithm>
|
38
|
-
#include <iterator>
|
39
|
-
#include <memory>
|
40
|
-
#include <string>
|
41
|
-
#include "gmock/gmock.h"
|
42
|
-
#include "gmock/internal/gmock-port.h"
|
43
|
-
#include "gtest/gtest.h"
|
44
|
-
#include "gtest/gtest-spi.h"
|
45
|
-
|
46
|
-
namespace {
|
47
|
-
|
48
|
-
// This list should be kept sorted.
|
49
|
-
using testing::Action;
|
50
|
-
using testing::ActionInterface;
|
51
|
-
using testing::Assign;
|
52
|
-
using testing::ByMove;
|
53
|
-
using testing::ByRef;
|
54
|
-
using testing::DefaultValue;
|
55
|
-
using testing::DoDefault;
|
56
|
-
using testing::IgnoreResult;
|
57
|
-
using testing::Invoke;
|
58
|
-
using testing::InvokeWithoutArgs;
|
59
|
-
using testing::MakePolymorphicAction;
|
60
|
-
using testing::Ne;
|
61
|
-
using testing::PolymorphicAction;
|
62
|
-
using testing::Return;
|
63
|
-
using testing::ReturnNull;
|
64
|
-
using testing::ReturnRef;
|
65
|
-
using testing::ReturnRefOfCopy;
|
66
|
-
using testing::SetArgPointee;
|
67
|
-
using testing::SetArgumentPointee;
|
68
|
-
using testing::_;
|
69
|
-
using testing::get;
|
70
|
-
using testing::internal::BuiltInDefaultValue;
|
71
|
-
using testing::internal::Int64;
|
72
|
-
using testing::internal::UInt64;
|
73
|
-
using testing::make_tuple;
|
74
|
-
using testing::tuple;
|
75
|
-
using testing::tuple_element;
|
76
|
-
|
77
|
-
#if !GTEST_OS_WINDOWS_MOBILE
|
78
|
-
using testing::SetErrnoAndReturn;
|
79
|
-
#endif
|
80
|
-
|
81
|
-
#if GTEST_HAS_PROTOBUF_
|
82
|
-
using testing::internal::TestMessage;
|
83
|
-
#endif // GTEST_HAS_PROTOBUF_
|
84
|
-
|
85
|
-
// Tests that BuiltInDefaultValue<T*>::Get() returns NULL.
|
86
|
-
TEST(BuiltInDefaultValueTest, IsNullForPointerTypes) {
|
87
|
-
EXPECT_TRUE(BuiltInDefaultValue<int*>::Get() == NULL);
|
88
|
-
EXPECT_TRUE(BuiltInDefaultValue<const char*>::Get() == NULL);
|
89
|
-
EXPECT_TRUE(BuiltInDefaultValue<void*>::Get() == NULL);
|
90
|
-
}
|
91
|
-
|
92
|
-
// Tests that BuiltInDefaultValue<T*>::Exists() return true.
|
93
|
-
TEST(BuiltInDefaultValueTest, ExistsForPointerTypes) {
|
94
|
-
EXPECT_TRUE(BuiltInDefaultValue<int*>::Exists());
|
95
|
-
EXPECT_TRUE(BuiltInDefaultValue<const char*>::Exists());
|
96
|
-
EXPECT_TRUE(BuiltInDefaultValue<void*>::Exists());
|
97
|
-
}
|
98
|
-
|
99
|
-
// Tests that BuiltInDefaultValue<T>::Get() returns 0 when T is a
|
100
|
-
// built-in numeric type.
|
101
|
-
TEST(BuiltInDefaultValueTest, IsZeroForNumericTypes) {
|
102
|
-
EXPECT_EQ(0U, BuiltInDefaultValue<unsigned char>::Get());
|
103
|
-
EXPECT_EQ(0, BuiltInDefaultValue<signed char>::Get());
|
104
|
-
EXPECT_EQ(0, BuiltInDefaultValue<char>::Get());
|
105
|
-
#if GMOCK_HAS_SIGNED_WCHAR_T_
|
106
|
-
EXPECT_EQ(0U, BuiltInDefaultValue<unsigned wchar_t>::Get());
|
107
|
-
EXPECT_EQ(0, BuiltInDefaultValue<signed wchar_t>::Get());
|
108
|
-
#endif
|
109
|
-
#if GMOCK_WCHAR_T_IS_NATIVE_
|
110
|
-
EXPECT_EQ(0, BuiltInDefaultValue<wchar_t>::Get());
|
111
|
-
#endif
|
112
|
-
EXPECT_EQ(0U, BuiltInDefaultValue<unsigned short>::Get()); // NOLINT
|
113
|
-
EXPECT_EQ(0, BuiltInDefaultValue<signed short>::Get()); // NOLINT
|
114
|
-
EXPECT_EQ(0, BuiltInDefaultValue<short>::Get()); // NOLINT
|
115
|
-
EXPECT_EQ(0U, BuiltInDefaultValue<unsigned int>::Get());
|
116
|
-
EXPECT_EQ(0, BuiltInDefaultValue<signed int>::Get());
|
117
|
-
EXPECT_EQ(0, BuiltInDefaultValue<int>::Get());
|
118
|
-
EXPECT_EQ(0U, BuiltInDefaultValue<unsigned long>::Get()); // NOLINT
|
119
|
-
EXPECT_EQ(0, BuiltInDefaultValue<signed long>::Get()); // NOLINT
|
120
|
-
EXPECT_EQ(0, BuiltInDefaultValue<long>::Get()); // NOLINT
|
121
|
-
EXPECT_EQ(0U, BuiltInDefaultValue<UInt64>::Get());
|
122
|
-
EXPECT_EQ(0, BuiltInDefaultValue<Int64>::Get());
|
123
|
-
EXPECT_EQ(0, BuiltInDefaultValue<float>::Get());
|
124
|
-
EXPECT_EQ(0, BuiltInDefaultValue<double>::Get());
|
125
|
-
}
|
126
|
-
|
127
|
-
// Tests that BuiltInDefaultValue<T>::Exists() returns true when T is a
|
128
|
-
// built-in numeric type.
|
129
|
-
TEST(BuiltInDefaultValueTest, ExistsForNumericTypes) {
|
130
|
-
EXPECT_TRUE(BuiltInDefaultValue<unsigned char>::Exists());
|
131
|
-
EXPECT_TRUE(BuiltInDefaultValue<signed char>::Exists());
|
132
|
-
EXPECT_TRUE(BuiltInDefaultValue<char>::Exists());
|
133
|
-
#if GMOCK_HAS_SIGNED_WCHAR_T_
|
134
|
-
EXPECT_TRUE(BuiltInDefaultValue<unsigned wchar_t>::Exists());
|
135
|
-
EXPECT_TRUE(BuiltInDefaultValue<signed wchar_t>::Exists());
|
136
|
-
#endif
|
137
|
-
#if GMOCK_WCHAR_T_IS_NATIVE_
|
138
|
-
EXPECT_TRUE(BuiltInDefaultValue<wchar_t>::Exists());
|
139
|
-
#endif
|
140
|
-
EXPECT_TRUE(BuiltInDefaultValue<unsigned short>::Exists()); // NOLINT
|
141
|
-
EXPECT_TRUE(BuiltInDefaultValue<signed short>::Exists()); // NOLINT
|
142
|
-
EXPECT_TRUE(BuiltInDefaultValue<short>::Exists()); // NOLINT
|
143
|
-
EXPECT_TRUE(BuiltInDefaultValue<unsigned int>::Exists());
|
144
|
-
EXPECT_TRUE(BuiltInDefaultValue<signed int>::Exists());
|
145
|
-
EXPECT_TRUE(BuiltInDefaultValue<int>::Exists());
|
146
|
-
EXPECT_TRUE(BuiltInDefaultValue<unsigned long>::Exists()); // NOLINT
|
147
|
-
EXPECT_TRUE(BuiltInDefaultValue<signed long>::Exists()); // NOLINT
|
148
|
-
EXPECT_TRUE(BuiltInDefaultValue<long>::Exists()); // NOLINT
|
149
|
-
EXPECT_TRUE(BuiltInDefaultValue<UInt64>::Exists());
|
150
|
-
EXPECT_TRUE(BuiltInDefaultValue<Int64>::Exists());
|
151
|
-
EXPECT_TRUE(BuiltInDefaultValue<float>::Exists());
|
152
|
-
EXPECT_TRUE(BuiltInDefaultValue<double>::Exists());
|
153
|
-
}
|
154
|
-
|
155
|
-
// Tests that BuiltInDefaultValue<bool>::Get() returns false.
|
156
|
-
TEST(BuiltInDefaultValueTest, IsFalseForBool) {
|
157
|
-
EXPECT_FALSE(BuiltInDefaultValue<bool>::Get());
|
158
|
-
}
|
159
|
-
|
160
|
-
// Tests that BuiltInDefaultValue<bool>::Exists() returns true.
|
161
|
-
TEST(BuiltInDefaultValueTest, BoolExists) {
|
162
|
-
EXPECT_TRUE(BuiltInDefaultValue<bool>::Exists());
|
163
|
-
}
|
164
|
-
|
165
|
-
// Tests that BuiltInDefaultValue<T>::Get() returns "" when T is a
|
166
|
-
// string type.
|
167
|
-
TEST(BuiltInDefaultValueTest, IsEmptyStringForString) {
|
168
|
-
#if GTEST_HAS_GLOBAL_STRING
|
169
|
-
EXPECT_EQ("", BuiltInDefaultValue< ::string>::Get());
|
170
|
-
#endif // GTEST_HAS_GLOBAL_STRING
|
171
|
-
|
172
|
-
EXPECT_EQ("", BuiltInDefaultValue< ::std::string>::Get());
|
173
|
-
}
|
174
|
-
|
175
|
-
// Tests that BuiltInDefaultValue<T>::Exists() returns true when T is a
|
176
|
-
// string type.
|
177
|
-
TEST(BuiltInDefaultValueTest, ExistsForString) {
|
178
|
-
#if GTEST_HAS_GLOBAL_STRING
|
179
|
-
EXPECT_TRUE(BuiltInDefaultValue< ::string>::Exists());
|
180
|
-
#endif // GTEST_HAS_GLOBAL_STRING
|
181
|
-
|
182
|
-
EXPECT_TRUE(BuiltInDefaultValue< ::std::string>::Exists());
|
183
|
-
}
|
184
|
-
|
185
|
-
// Tests that BuiltInDefaultValue<const T>::Get() returns the same
|
186
|
-
// value as BuiltInDefaultValue<T>::Get() does.
|
187
|
-
TEST(BuiltInDefaultValueTest, WorksForConstTypes) {
|
188
|
-
EXPECT_EQ("", BuiltInDefaultValue<const std::string>::Get());
|
189
|
-
EXPECT_EQ(0, BuiltInDefaultValue<const int>::Get());
|
190
|
-
EXPECT_TRUE(BuiltInDefaultValue<char* const>::Get() == NULL);
|
191
|
-
EXPECT_FALSE(BuiltInDefaultValue<const bool>::Get());
|
192
|
-
}
|
193
|
-
|
194
|
-
// A type that's default constructible.
|
195
|
-
class MyDefaultConstructible {
|
196
|
-
public:
|
197
|
-
MyDefaultConstructible() : value_(42) {}
|
198
|
-
|
199
|
-
int value() const { return value_; }
|
200
|
-
|
201
|
-
private:
|
202
|
-
int value_;
|
203
|
-
};
|
204
|
-
|
205
|
-
// A type that's not default constructible.
|
206
|
-
class MyNonDefaultConstructible {
|
207
|
-
public:
|
208
|
-
// Does not have a default ctor.
|
209
|
-
explicit MyNonDefaultConstructible(int a_value) : value_(a_value) {}
|
210
|
-
|
211
|
-
int value() const { return value_; }
|
212
|
-
|
213
|
-
private:
|
214
|
-
int value_;
|
215
|
-
};
|
216
|
-
|
217
|
-
#if GTEST_HAS_STD_TYPE_TRAITS_
|
218
|
-
|
219
|
-
TEST(BuiltInDefaultValueTest, ExistsForDefaultConstructibleType) {
|
220
|
-
EXPECT_TRUE(BuiltInDefaultValue<MyDefaultConstructible>::Exists());
|
221
|
-
}
|
222
|
-
|
223
|
-
TEST(BuiltInDefaultValueTest, IsDefaultConstructedForDefaultConstructibleType) {
|
224
|
-
EXPECT_EQ(42, BuiltInDefaultValue<MyDefaultConstructible>::Get().value());
|
225
|
-
}
|
226
|
-
|
227
|
-
#endif // GTEST_HAS_STD_TYPE_TRAITS_
|
228
|
-
|
229
|
-
TEST(BuiltInDefaultValueTest, DoesNotExistForNonDefaultConstructibleType) {
|
230
|
-
EXPECT_FALSE(BuiltInDefaultValue<MyNonDefaultConstructible>::Exists());
|
231
|
-
}
|
232
|
-
|
233
|
-
// Tests that BuiltInDefaultValue<T&>::Get() aborts the program.
|
234
|
-
TEST(BuiltInDefaultValueDeathTest, IsUndefinedForReferences) {
|
235
|
-
EXPECT_DEATH_IF_SUPPORTED({
|
236
|
-
BuiltInDefaultValue<int&>::Get();
|
237
|
-
}, "");
|
238
|
-
EXPECT_DEATH_IF_SUPPORTED({
|
239
|
-
BuiltInDefaultValue<const char&>::Get();
|
240
|
-
}, "");
|
241
|
-
}
|
242
|
-
|
243
|
-
TEST(BuiltInDefaultValueDeathTest, IsUndefinedForNonDefaultConstructibleType) {
|
244
|
-
EXPECT_DEATH_IF_SUPPORTED({
|
245
|
-
BuiltInDefaultValue<MyNonDefaultConstructible>::Get();
|
246
|
-
}, "");
|
247
|
-
}
|
248
|
-
|
249
|
-
// Tests that DefaultValue<T>::IsSet() is false initially.
|
250
|
-
TEST(DefaultValueTest, IsInitiallyUnset) {
|
251
|
-
EXPECT_FALSE(DefaultValue<int>::IsSet());
|
252
|
-
EXPECT_FALSE(DefaultValue<MyDefaultConstructible>::IsSet());
|
253
|
-
EXPECT_FALSE(DefaultValue<const MyNonDefaultConstructible>::IsSet());
|
254
|
-
}
|
255
|
-
|
256
|
-
// Tests that DefaultValue<T> can be set and then unset.
|
257
|
-
TEST(DefaultValueTest, CanBeSetAndUnset) {
|
258
|
-
EXPECT_TRUE(DefaultValue<int>::Exists());
|
259
|
-
EXPECT_FALSE(DefaultValue<const MyNonDefaultConstructible>::Exists());
|
260
|
-
|
261
|
-
DefaultValue<int>::Set(1);
|
262
|
-
DefaultValue<const MyNonDefaultConstructible>::Set(
|
263
|
-
MyNonDefaultConstructible(42));
|
264
|
-
|
265
|
-
EXPECT_EQ(1, DefaultValue<int>::Get());
|
266
|
-
EXPECT_EQ(42, DefaultValue<const MyNonDefaultConstructible>::Get().value());
|
267
|
-
|
268
|
-
EXPECT_TRUE(DefaultValue<int>::Exists());
|
269
|
-
EXPECT_TRUE(DefaultValue<const MyNonDefaultConstructible>::Exists());
|
270
|
-
|
271
|
-
DefaultValue<int>::Clear();
|
272
|
-
DefaultValue<const MyNonDefaultConstructible>::Clear();
|
273
|
-
|
274
|
-
EXPECT_FALSE(DefaultValue<int>::IsSet());
|
275
|
-
EXPECT_FALSE(DefaultValue<const MyNonDefaultConstructible>::IsSet());
|
276
|
-
|
277
|
-
EXPECT_TRUE(DefaultValue<int>::Exists());
|
278
|
-
EXPECT_FALSE(DefaultValue<const MyNonDefaultConstructible>::Exists());
|
279
|
-
}
|
280
|
-
|
281
|
-
// Tests that DefaultValue<T>::Get() returns the
|
282
|
-
// BuiltInDefaultValue<T>::Get() when DefaultValue<T>::IsSet() is
|
283
|
-
// false.
|
284
|
-
TEST(DefaultValueDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) {
|
285
|
-
EXPECT_FALSE(DefaultValue<int>::IsSet());
|
286
|
-
EXPECT_TRUE(DefaultValue<int>::Exists());
|
287
|
-
EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible>::IsSet());
|
288
|
-
EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible>::Exists());
|
289
|
-
|
290
|
-
EXPECT_EQ(0, DefaultValue<int>::Get());
|
291
|
-
|
292
|
-
EXPECT_DEATH_IF_SUPPORTED({
|
293
|
-
DefaultValue<MyNonDefaultConstructible>::Get();
|
294
|
-
}, "");
|
295
|
-
}
|
296
|
-
|
297
|
-
#if GTEST_HAS_STD_UNIQUE_PTR_
|
298
|
-
TEST(DefaultValueTest, GetWorksForMoveOnlyIfSet) {
|
299
|
-
EXPECT_TRUE(DefaultValue<std::unique_ptr<int>>::Exists());
|
300
|
-
EXPECT_TRUE(DefaultValue<std::unique_ptr<int>>::Get() == NULL);
|
301
|
-
DefaultValue<std::unique_ptr<int>>::SetFactory([] {
|
302
|
-
return std::unique_ptr<int>(new int(42));
|
303
|
-
});
|
304
|
-
EXPECT_TRUE(DefaultValue<std::unique_ptr<int>>::Exists());
|
305
|
-
std::unique_ptr<int> i = DefaultValue<std::unique_ptr<int>>::Get();
|
306
|
-
EXPECT_EQ(42, *i);
|
307
|
-
}
|
308
|
-
#endif // GTEST_HAS_STD_UNIQUE_PTR_
|
309
|
-
|
310
|
-
// Tests that DefaultValue<void>::Get() returns void.
|
311
|
-
TEST(DefaultValueTest, GetWorksForVoid) {
|
312
|
-
return DefaultValue<void>::Get();
|
313
|
-
}
|
314
|
-
|
315
|
-
// Tests using DefaultValue with a reference type.
|
316
|
-
|
317
|
-
// Tests that DefaultValue<T&>::IsSet() is false initially.
|
318
|
-
TEST(DefaultValueOfReferenceTest, IsInitiallyUnset) {
|
319
|
-
EXPECT_FALSE(DefaultValue<int&>::IsSet());
|
320
|
-
EXPECT_FALSE(DefaultValue<MyDefaultConstructible&>::IsSet());
|
321
|
-
EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::IsSet());
|
322
|
-
}
|
323
|
-
|
324
|
-
// Tests that DefaultValue<T&>::Exists is false initiallly.
|
325
|
-
TEST(DefaultValueOfReferenceTest, IsInitiallyNotExisting) {
|
326
|
-
EXPECT_FALSE(DefaultValue<int&>::Exists());
|
327
|
-
EXPECT_FALSE(DefaultValue<MyDefaultConstructible&>::Exists());
|
328
|
-
EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::Exists());
|
329
|
-
}
|
330
|
-
|
331
|
-
// Tests that DefaultValue<T&> can be set and then unset.
|
332
|
-
TEST(DefaultValueOfReferenceTest, CanBeSetAndUnset) {
|
333
|
-
int n = 1;
|
334
|
-
DefaultValue<const int&>::Set(n);
|
335
|
-
MyNonDefaultConstructible x(42);
|
336
|
-
DefaultValue<MyNonDefaultConstructible&>::Set(x);
|
337
|
-
|
338
|
-
EXPECT_TRUE(DefaultValue<const int&>::Exists());
|
339
|
-
EXPECT_TRUE(DefaultValue<MyNonDefaultConstructible&>::Exists());
|
340
|
-
|
341
|
-
EXPECT_EQ(&n, &(DefaultValue<const int&>::Get()));
|
342
|
-
EXPECT_EQ(&x, &(DefaultValue<MyNonDefaultConstructible&>::Get()));
|
343
|
-
|
344
|
-
DefaultValue<const int&>::Clear();
|
345
|
-
DefaultValue<MyNonDefaultConstructible&>::Clear();
|
346
|
-
|
347
|
-
EXPECT_FALSE(DefaultValue<const int&>::Exists());
|
348
|
-
EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::Exists());
|
349
|
-
|
350
|
-
EXPECT_FALSE(DefaultValue<const int&>::IsSet());
|
351
|
-
EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::IsSet());
|
352
|
-
}
|
353
|
-
|
354
|
-
// Tests that DefaultValue<T&>::Get() returns the
|
355
|
-
// BuiltInDefaultValue<T&>::Get() when DefaultValue<T&>::IsSet() is
|
356
|
-
// false.
|
357
|
-
TEST(DefaultValueOfReferenceDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) {
|
358
|
-
EXPECT_FALSE(DefaultValue<int&>::IsSet());
|
359
|
-
EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::IsSet());
|
360
|
-
|
361
|
-
EXPECT_DEATH_IF_SUPPORTED({
|
362
|
-
DefaultValue<int&>::Get();
|
363
|
-
}, "");
|
364
|
-
EXPECT_DEATH_IF_SUPPORTED({
|
365
|
-
DefaultValue<MyNonDefaultConstructible>::Get();
|
366
|
-
}, "");
|
367
|
-
}
|
368
|
-
|
369
|
-
// Tests that ActionInterface can be implemented by defining the
|
370
|
-
// Perform method.
|
371
|
-
|
372
|
-
typedef int MyGlobalFunction(bool, int);
|
373
|
-
|
374
|
-
class MyActionImpl : public ActionInterface<MyGlobalFunction> {
|
375
|
-
public:
|
376
|
-
virtual int Perform(const tuple<bool, int>& args) {
|
377
|
-
return get<0>(args) ? get<1>(args) : 0;
|
378
|
-
}
|
379
|
-
};
|
380
|
-
|
381
|
-
TEST(ActionInterfaceTest, CanBeImplementedByDefiningPerform) {
|
382
|
-
MyActionImpl my_action_impl;
|
383
|
-
(void)my_action_impl;
|
384
|
-
}
|
385
|
-
|
386
|
-
TEST(ActionInterfaceTest, MakeAction) {
|
387
|
-
Action<MyGlobalFunction> action = MakeAction(new MyActionImpl);
|
388
|
-
|
389
|
-
// When exercising the Perform() method of Action<F>, we must pass
|
390
|
-
// it a tuple whose size and type are compatible with F's argument
|
391
|
-
// types. For example, if F is int(), then Perform() takes a
|
392
|
-
// 0-tuple; if F is void(bool, int), then Perform() takes a
|
393
|
-
// tuple<bool, int>, and so on.
|
394
|
-
EXPECT_EQ(5, action.Perform(make_tuple(true, 5)));
|
395
|
-
}
|
396
|
-
|
397
|
-
// Tests that Action<F> can be contructed from a pointer to
|
398
|
-
// ActionInterface<F>.
|
399
|
-
TEST(ActionTest, CanBeConstructedFromActionInterface) {
|
400
|
-
Action<MyGlobalFunction> action(new MyActionImpl);
|
401
|
-
}
|
402
|
-
|
403
|
-
// Tests that Action<F> delegates actual work to ActionInterface<F>.
|
404
|
-
TEST(ActionTest, DelegatesWorkToActionInterface) {
|
405
|
-
const Action<MyGlobalFunction> action(new MyActionImpl);
|
406
|
-
|
407
|
-
EXPECT_EQ(5, action.Perform(make_tuple(true, 5)));
|
408
|
-
EXPECT_EQ(0, action.Perform(make_tuple(false, 1)));
|
409
|
-
}
|
410
|
-
|
411
|
-
// Tests that Action<F> can be copied.
|
412
|
-
TEST(ActionTest, IsCopyable) {
|
413
|
-
Action<MyGlobalFunction> a1(new MyActionImpl);
|
414
|
-
Action<MyGlobalFunction> a2(a1); // Tests the copy constructor.
|
415
|
-
|
416
|
-
// a1 should continue to work after being copied from.
|
417
|
-
EXPECT_EQ(5, a1.Perform(make_tuple(true, 5)));
|
418
|
-
EXPECT_EQ(0, a1.Perform(make_tuple(false, 1)));
|
419
|
-
|
420
|
-
// a2 should work like the action it was copied from.
|
421
|
-
EXPECT_EQ(5, a2.Perform(make_tuple(true, 5)));
|
422
|
-
EXPECT_EQ(0, a2.Perform(make_tuple(false, 1)));
|
423
|
-
|
424
|
-
a2 = a1; // Tests the assignment operator.
|
425
|
-
|
426
|
-
// a1 should continue to work after being copied from.
|
427
|
-
EXPECT_EQ(5, a1.Perform(make_tuple(true, 5)));
|
428
|
-
EXPECT_EQ(0, a1.Perform(make_tuple(false, 1)));
|
429
|
-
|
430
|
-
// a2 should work like the action it was copied from.
|
431
|
-
EXPECT_EQ(5, a2.Perform(make_tuple(true, 5)));
|
432
|
-
EXPECT_EQ(0, a2.Perform(make_tuple(false, 1)));
|
433
|
-
}
|
434
|
-
|
435
|
-
// Tests that an Action<From> object can be converted to a
|
436
|
-
// compatible Action<To> object.
|
437
|
-
|
438
|
-
class IsNotZero : public ActionInterface<bool(int)> { // NOLINT
|
439
|
-
public:
|
440
|
-
virtual bool Perform(const tuple<int>& arg) {
|
441
|
-
return get<0>(arg) != 0;
|
442
|
-
}
|
443
|
-
};
|
444
|
-
|
445
|
-
#if !GTEST_OS_SYMBIAN
|
446
|
-
// Compiling this test on Nokia's Symbian compiler fails with:
|
447
|
-
// 'Result' is not a member of class 'testing::internal::Function<int>'
|
448
|
-
// (point of instantiation: '@unnamed@gmock_actions_test_cc@::
|
449
|
-
// ActionTest_CanBeConvertedToOtherActionType_Test::TestBody()')
|
450
|
-
// with no obvious fix.
|
451
|
-
TEST(ActionTest, CanBeConvertedToOtherActionType) {
|
452
|
-
const Action<bool(int)> a1(new IsNotZero); // NOLINT
|
453
|
-
const Action<int(char)> a2 = Action<int(char)>(a1); // NOLINT
|
454
|
-
EXPECT_EQ(1, a2.Perform(make_tuple('a')));
|
455
|
-
EXPECT_EQ(0, a2.Perform(make_tuple('\0')));
|
456
|
-
}
|
457
|
-
#endif // !GTEST_OS_SYMBIAN
|
458
|
-
|
459
|
-
// The following two classes are for testing MakePolymorphicAction().
|
460
|
-
|
461
|
-
// Implements a polymorphic action that returns the second of the
|
462
|
-
// arguments it receives.
|
463
|
-
class ReturnSecondArgumentAction {
|
464
|
-
public:
|
465
|
-
// We want to verify that MakePolymorphicAction() can work with a
|
466
|
-
// polymorphic action whose Perform() method template is either
|
467
|
-
// const or not. This lets us verify the non-const case.
|
468
|
-
template <typename Result, typename ArgumentTuple>
|
469
|
-
Result Perform(const ArgumentTuple& args) { return get<1>(args); }
|
470
|
-
};
|
471
|
-
|
472
|
-
// Implements a polymorphic action that can be used in a nullary
|
473
|
-
// function to return 0.
|
474
|
-
class ReturnZeroFromNullaryFunctionAction {
|
475
|
-
public:
|
476
|
-
// For testing that MakePolymorphicAction() works when the
|
477
|
-
// implementation class' Perform() method template takes only one
|
478
|
-
// template parameter.
|
479
|
-
//
|
480
|
-
// We want to verify that MakePolymorphicAction() can work with a
|
481
|
-
// polymorphic action whose Perform() method template is either
|
482
|
-
// const or not. This lets us verify the const case.
|
483
|
-
template <typename Result>
|
484
|
-
Result Perform(const tuple<>&) const { return 0; }
|
485
|
-
};
|
486
|
-
|
487
|
-
// These functions verify that MakePolymorphicAction() returns a
|
488
|
-
// PolymorphicAction<T> where T is the argument's type.
|
489
|
-
|
490
|
-
PolymorphicAction<ReturnSecondArgumentAction> ReturnSecondArgument() {
|
491
|
-
return MakePolymorphicAction(ReturnSecondArgumentAction());
|
492
|
-
}
|
493
|
-
|
494
|
-
PolymorphicAction<ReturnZeroFromNullaryFunctionAction>
|
495
|
-
ReturnZeroFromNullaryFunction() {
|
496
|
-
return MakePolymorphicAction(ReturnZeroFromNullaryFunctionAction());
|
497
|
-
}
|
498
|
-
|
499
|
-
// Tests that MakePolymorphicAction() turns a polymorphic action
|
500
|
-
// implementation class into a polymorphic action.
|
501
|
-
TEST(MakePolymorphicActionTest, ConstructsActionFromImpl) {
|
502
|
-
Action<int(bool, int, double)> a1 = ReturnSecondArgument(); // NOLINT
|
503
|
-
EXPECT_EQ(5, a1.Perform(make_tuple(false, 5, 2.0)));
|
504
|
-
}
|
505
|
-
|
506
|
-
// Tests that MakePolymorphicAction() works when the implementation
|
507
|
-
// class' Perform() method template has only one template parameter.
|
508
|
-
TEST(MakePolymorphicActionTest, WorksWhenPerformHasOneTemplateParameter) {
|
509
|
-
Action<int()> a1 = ReturnZeroFromNullaryFunction();
|
510
|
-
EXPECT_EQ(0, a1.Perform(make_tuple()));
|
511
|
-
|
512
|
-
Action<void*()> a2 = ReturnZeroFromNullaryFunction();
|
513
|
-
EXPECT_TRUE(a2.Perform(make_tuple()) == NULL);
|
514
|
-
}
|
515
|
-
|
516
|
-
// Tests that Return() works as an action for void-returning
|
517
|
-
// functions.
|
518
|
-
TEST(ReturnTest, WorksForVoid) {
|
519
|
-
const Action<void(int)> ret = Return(); // NOLINT
|
520
|
-
return ret.Perform(make_tuple(1));
|
521
|
-
}
|
522
|
-
|
523
|
-
// Tests that Return(v) returns v.
|
524
|
-
TEST(ReturnTest, ReturnsGivenValue) {
|
525
|
-
Action<int()> ret = Return(1); // NOLINT
|
526
|
-
EXPECT_EQ(1, ret.Perform(make_tuple()));
|
527
|
-
|
528
|
-
ret = Return(-5);
|
529
|
-
EXPECT_EQ(-5, ret.Perform(make_tuple()));
|
530
|
-
}
|
531
|
-
|
532
|
-
// Tests that Return("string literal") works.
|
533
|
-
TEST(ReturnTest, AcceptsStringLiteral) {
|
534
|
-
Action<const char*()> a1 = Return("Hello");
|
535
|
-
EXPECT_STREQ("Hello", a1.Perform(make_tuple()));
|
536
|
-
|
537
|
-
Action<std::string()> a2 = Return("world");
|
538
|
-
EXPECT_EQ("world", a2.Perform(make_tuple()));
|
539
|
-
}
|
540
|
-
|
541
|
-
// Test struct which wraps a vector of integers. Used in
|
542
|
-
// 'SupportsWrapperReturnType' test.
|
543
|
-
struct IntegerVectorWrapper {
|
544
|
-
std::vector<int> * v;
|
545
|
-
IntegerVectorWrapper(std::vector<int>& _v) : v(&_v) {} // NOLINT
|
546
|
-
};
|
547
|
-
|
548
|
-
// Tests that Return() works when return type is a wrapper type.
|
549
|
-
TEST(ReturnTest, SupportsWrapperReturnType) {
|
550
|
-
// Initialize vector of integers.
|
551
|
-
std::vector<int> v;
|
552
|
-
for (int i = 0; i < 5; ++i) v.push_back(i);
|
553
|
-
|
554
|
-
// Return() called with 'v' as argument. The Action will return the same data
|
555
|
-
// as 'v' (copy) but it will be wrapped in an IntegerVectorWrapper.
|
556
|
-
Action<IntegerVectorWrapper()> a = Return(v);
|
557
|
-
const std::vector<int>& result = *(a.Perform(make_tuple()).v);
|
558
|
-
EXPECT_THAT(result, ::testing::ElementsAre(0, 1, 2, 3, 4));
|
559
|
-
}
|
560
|
-
|
561
|
-
// Tests that Return(v) is covaraint.
|
562
|
-
|
563
|
-
struct Base {
|
564
|
-
bool operator==(const Base&) { return true; }
|
565
|
-
};
|
566
|
-
|
567
|
-
struct Derived : public Base {
|
568
|
-
bool operator==(const Derived&) { return true; }
|
569
|
-
};
|
570
|
-
|
571
|
-
TEST(ReturnTest, IsCovariant) {
|
572
|
-
Base base;
|
573
|
-
Derived derived;
|
574
|
-
Action<Base*()> ret = Return(&base);
|
575
|
-
EXPECT_EQ(&base, ret.Perform(make_tuple()));
|
576
|
-
|
577
|
-
ret = Return(&derived);
|
578
|
-
EXPECT_EQ(&derived, ret.Perform(make_tuple()));
|
579
|
-
}
|
580
|
-
|
581
|
-
// Tests that the type of the value passed into Return is converted into T
|
582
|
-
// when the action is cast to Action<T(...)> rather than when the action is
|
583
|
-
// performed. See comments on testing::internal::ReturnAction in
|
584
|
-
// gmock-actions.h for more information.
|
585
|
-
class FromType {
|
586
|
-
public:
|
587
|
-
explicit FromType(bool* is_converted) : converted_(is_converted) {}
|
588
|
-
bool* converted() const { return converted_; }
|
589
|
-
|
590
|
-
private:
|
591
|
-
bool* const converted_;
|
592
|
-
|
593
|
-
GTEST_DISALLOW_ASSIGN_(FromType);
|
594
|
-
};
|
595
|
-
|
596
|
-
class ToType {
|
597
|
-
public:
|
598
|
-
// Must allow implicit conversion due to use in ImplicitCast_<T>.
|
599
|
-
ToType(const FromType& x) { *x.converted() = true; } // NOLINT
|
600
|
-
};
|
601
|
-
|
602
|
-
TEST(ReturnTest, ConvertsArgumentWhenConverted) {
|
603
|
-
bool converted = false;
|
604
|
-
FromType x(&converted);
|
605
|
-
Action<ToType()> action(Return(x));
|
606
|
-
EXPECT_TRUE(converted) << "Return must convert its argument in its own "
|
607
|
-
<< "conversion operator.";
|
608
|
-
converted = false;
|
609
|
-
action.Perform(tuple<>());
|
610
|
-
EXPECT_FALSE(converted) << "Action must NOT convert its argument "
|
611
|
-
<< "when performed.";
|
612
|
-
}
|
613
|
-
|
614
|
-
class DestinationType {};
|
615
|
-
|
616
|
-
class SourceType {
|
617
|
-
public:
|
618
|
-
// Note: a non-const typecast operator.
|
619
|
-
operator DestinationType() { return DestinationType(); }
|
620
|
-
};
|
621
|
-
|
622
|
-
TEST(ReturnTest, CanConvertArgumentUsingNonConstTypeCastOperator) {
|
623
|
-
SourceType s;
|
624
|
-
Action<DestinationType()> action(Return(s));
|
625
|
-
}
|
626
|
-
|
627
|
-
// Tests that ReturnNull() returns NULL in a pointer-returning function.
|
628
|
-
TEST(ReturnNullTest, WorksInPointerReturningFunction) {
|
629
|
-
const Action<int*()> a1 = ReturnNull();
|
630
|
-
EXPECT_TRUE(a1.Perform(make_tuple()) == NULL);
|
631
|
-
|
632
|
-
const Action<const char*(bool)> a2 = ReturnNull(); // NOLINT
|
633
|
-
EXPECT_TRUE(a2.Perform(make_tuple(true)) == NULL);
|
634
|
-
}
|
635
|
-
|
636
|
-
#if GTEST_HAS_STD_UNIQUE_PTR_
|
637
|
-
// Tests that ReturnNull() returns NULL for shared_ptr and unique_ptr returning
|
638
|
-
// functions.
|
639
|
-
TEST(ReturnNullTest, WorksInSmartPointerReturningFunction) {
|
640
|
-
const Action<std::unique_ptr<const int>()> a1 = ReturnNull();
|
641
|
-
EXPECT_TRUE(a1.Perform(make_tuple()) == nullptr);
|
642
|
-
|
643
|
-
const Action<std::shared_ptr<int>(std::string)> a2 = ReturnNull();
|
644
|
-
EXPECT_TRUE(a2.Perform(make_tuple("foo")) == nullptr);
|
645
|
-
}
|
646
|
-
#endif // GTEST_HAS_STD_UNIQUE_PTR_
|
647
|
-
|
648
|
-
// Tests that ReturnRef(v) works for reference types.
|
649
|
-
TEST(ReturnRefTest, WorksForReference) {
|
650
|
-
const int n = 0;
|
651
|
-
const Action<const int&(bool)> ret = ReturnRef(n); // NOLINT
|
652
|
-
|
653
|
-
EXPECT_EQ(&n, &ret.Perform(make_tuple(true)));
|
654
|
-
}
|
655
|
-
|
656
|
-
// Tests that ReturnRef(v) is covariant.
|
657
|
-
TEST(ReturnRefTest, IsCovariant) {
|
658
|
-
Base base;
|
659
|
-
Derived derived;
|
660
|
-
Action<Base&()> a = ReturnRef(base);
|
661
|
-
EXPECT_EQ(&base, &a.Perform(make_tuple()));
|
662
|
-
|
663
|
-
a = ReturnRef(derived);
|
664
|
-
EXPECT_EQ(&derived, &a.Perform(make_tuple()));
|
665
|
-
}
|
666
|
-
|
667
|
-
// Tests that ReturnRefOfCopy(v) works for reference types.
|
668
|
-
TEST(ReturnRefOfCopyTest, WorksForReference) {
|
669
|
-
int n = 42;
|
670
|
-
const Action<const int&()> ret = ReturnRefOfCopy(n);
|
671
|
-
|
672
|
-
EXPECT_NE(&n, &ret.Perform(make_tuple()));
|
673
|
-
EXPECT_EQ(42, ret.Perform(make_tuple()));
|
674
|
-
|
675
|
-
n = 43;
|
676
|
-
EXPECT_NE(&n, &ret.Perform(make_tuple()));
|
677
|
-
EXPECT_EQ(42, ret.Perform(make_tuple()));
|
678
|
-
}
|
679
|
-
|
680
|
-
// Tests that ReturnRefOfCopy(v) is covariant.
|
681
|
-
TEST(ReturnRefOfCopyTest, IsCovariant) {
|
682
|
-
Base base;
|
683
|
-
Derived derived;
|
684
|
-
Action<Base&()> a = ReturnRefOfCopy(base);
|
685
|
-
EXPECT_NE(&base, &a.Perform(make_tuple()));
|
686
|
-
|
687
|
-
a = ReturnRefOfCopy(derived);
|
688
|
-
EXPECT_NE(&derived, &a.Perform(make_tuple()));
|
689
|
-
}
|
690
|
-
|
691
|
-
// Tests that DoDefault() does the default action for the mock method.
|
692
|
-
|
693
|
-
class MockClass {
|
694
|
-
public:
|
695
|
-
MockClass() {}
|
696
|
-
|
697
|
-
MOCK_METHOD1(IntFunc, int(bool flag)); // NOLINT
|
698
|
-
MOCK_METHOD0(Foo, MyNonDefaultConstructible());
|
699
|
-
#if GTEST_HAS_STD_UNIQUE_PTR_
|
700
|
-
MOCK_METHOD0(MakeUnique, std::unique_ptr<int>());
|
701
|
-
MOCK_METHOD0(MakeUniqueBase, std::unique_ptr<Base>());
|
702
|
-
MOCK_METHOD0(MakeVectorUnique, std::vector<std::unique_ptr<int>>());
|
703
|
-
#endif
|
704
|
-
|
705
|
-
private:
|
706
|
-
GTEST_DISALLOW_COPY_AND_ASSIGN_(MockClass);
|
707
|
-
};
|
708
|
-
|
709
|
-
// Tests that DoDefault() returns the built-in default value for the
|
710
|
-
// return type by default.
|
711
|
-
TEST(DoDefaultTest, ReturnsBuiltInDefaultValueByDefault) {
|
712
|
-
MockClass mock;
|
713
|
-
EXPECT_CALL(mock, IntFunc(_))
|
714
|
-
.WillOnce(DoDefault());
|
715
|
-
EXPECT_EQ(0, mock.IntFunc(true));
|
716
|
-
}
|
717
|
-
|
718
|
-
// Tests that DoDefault() throws (when exceptions are enabled) or aborts
|
719
|
-
// the process when there is no built-in default value for the return type.
|
720
|
-
TEST(DoDefaultDeathTest, DiesForUnknowType) {
|
721
|
-
MockClass mock;
|
722
|
-
EXPECT_CALL(mock, Foo())
|
723
|
-
.WillRepeatedly(DoDefault());
|
724
|
-
#if GTEST_HAS_EXCEPTIONS
|
725
|
-
EXPECT_ANY_THROW(mock.Foo());
|
726
|
-
#else
|
727
|
-
EXPECT_DEATH_IF_SUPPORTED({
|
728
|
-
mock.Foo();
|
729
|
-
}, "");
|
730
|
-
#endif
|
731
|
-
}
|
732
|
-
|
733
|
-
// Tests that using DoDefault() inside a composite action leads to a
|
734
|
-
// run-time error.
|
735
|
-
|
736
|
-
void VoidFunc(bool /* flag */) {}
|
737
|
-
|
738
|
-
TEST(DoDefaultDeathTest, DiesIfUsedInCompositeAction) {
|
739
|
-
MockClass mock;
|
740
|
-
EXPECT_CALL(mock, IntFunc(_))
|
741
|
-
.WillRepeatedly(DoAll(Invoke(VoidFunc),
|
742
|
-
DoDefault()));
|
743
|
-
|
744
|
-
// Ideally we should verify the error message as well. Sadly,
|
745
|
-
// EXPECT_DEATH() can only capture stderr, while Google Mock's
|
746
|
-
// errors are printed on stdout. Therefore we have to settle for
|
747
|
-
// not verifying the message.
|
748
|
-
EXPECT_DEATH_IF_SUPPORTED({
|
749
|
-
mock.IntFunc(true);
|
750
|
-
}, "");
|
751
|
-
}
|
752
|
-
|
753
|
-
// Tests that DoDefault() returns the default value set by
|
754
|
-
// DefaultValue<T>::Set() when it's not overriden by an ON_CALL().
|
755
|
-
TEST(DoDefaultTest, ReturnsUserSpecifiedPerTypeDefaultValueWhenThereIsOne) {
|
756
|
-
DefaultValue<int>::Set(1);
|
757
|
-
MockClass mock;
|
758
|
-
EXPECT_CALL(mock, IntFunc(_))
|
759
|
-
.WillOnce(DoDefault());
|
760
|
-
EXPECT_EQ(1, mock.IntFunc(false));
|
761
|
-
DefaultValue<int>::Clear();
|
762
|
-
}
|
763
|
-
|
764
|
-
// Tests that DoDefault() does the action specified by ON_CALL().
|
765
|
-
TEST(DoDefaultTest, DoesWhatOnCallSpecifies) {
|
766
|
-
MockClass mock;
|
767
|
-
ON_CALL(mock, IntFunc(_))
|
768
|
-
.WillByDefault(Return(2));
|
769
|
-
EXPECT_CALL(mock, IntFunc(_))
|
770
|
-
.WillOnce(DoDefault());
|
771
|
-
EXPECT_EQ(2, mock.IntFunc(false));
|
772
|
-
}
|
773
|
-
|
774
|
-
// Tests that using DoDefault() in ON_CALL() leads to a run-time failure.
|
775
|
-
TEST(DoDefaultTest, CannotBeUsedInOnCall) {
|
776
|
-
MockClass mock;
|
777
|
-
EXPECT_NONFATAL_FAILURE({ // NOLINT
|
778
|
-
ON_CALL(mock, IntFunc(_))
|
779
|
-
.WillByDefault(DoDefault());
|
780
|
-
}, "DoDefault() cannot be used in ON_CALL()");
|
781
|
-
}
|
782
|
-
|
783
|
-
// Tests that SetArgPointee<N>(v) sets the variable pointed to by
|
784
|
-
// the N-th (0-based) argument to v.
|
785
|
-
TEST(SetArgPointeeTest, SetsTheNthPointee) {
|
786
|
-
typedef void MyFunction(bool, int*, char*);
|
787
|
-
Action<MyFunction> a = SetArgPointee<1>(2);
|
788
|
-
|
789
|
-
int n = 0;
|
790
|
-
char ch = '\0';
|
791
|
-
a.Perform(make_tuple(true, &n, &ch));
|
792
|
-
EXPECT_EQ(2, n);
|
793
|
-
EXPECT_EQ('\0', ch);
|
794
|
-
|
795
|
-
a = SetArgPointee<2>('a');
|
796
|
-
n = 0;
|
797
|
-
ch = '\0';
|
798
|
-
a.Perform(make_tuple(true, &n, &ch));
|
799
|
-
EXPECT_EQ(0, n);
|
800
|
-
EXPECT_EQ('a', ch);
|
801
|
-
}
|
802
|
-
|
803
|
-
#if !((GTEST_GCC_VER_ && GTEST_GCC_VER_ < 40000) || GTEST_OS_SYMBIAN)
|
804
|
-
// Tests that SetArgPointee<N>() accepts a string literal.
|
805
|
-
// GCC prior to v4.0 and the Symbian compiler do not support this.
|
806
|
-
TEST(SetArgPointeeTest, AcceptsStringLiteral) {
|
807
|
-
typedef void MyFunction(std::string*, const char**);
|
808
|
-
Action<MyFunction> a = SetArgPointee<0>("hi");
|
809
|
-
std::string str;
|
810
|
-
const char* ptr = NULL;
|
811
|
-
a.Perform(make_tuple(&str, &ptr));
|
812
|
-
EXPECT_EQ("hi", str);
|
813
|
-
EXPECT_TRUE(ptr == NULL);
|
814
|
-
|
815
|
-
a = SetArgPointee<1>("world");
|
816
|
-
str = "";
|
817
|
-
a.Perform(make_tuple(&str, &ptr));
|
818
|
-
EXPECT_EQ("", str);
|
819
|
-
EXPECT_STREQ("world", ptr);
|
820
|
-
}
|
821
|
-
|
822
|
-
TEST(SetArgPointeeTest, AcceptsWideStringLiteral) {
|
823
|
-
typedef void MyFunction(const wchar_t**);
|
824
|
-
Action<MyFunction> a = SetArgPointee<0>(L"world");
|
825
|
-
const wchar_t* ptr = NULL;
|
826
|
-
a.Perform(make_tuple(&ptr));
|
827
|
-
EXPECT_STREQ(L"world", ptr);
|
828
|
-
|
829
|
-
# if GTEST_HAS_STD_WSTRING
|
830
|
-
|
831
|
-
typedef void MyStringFunction(std::wstring*);
|
832
|
-
Action<MyStringFunction> a2 = SetArgPointee<0>(L"world");
|
833
|
-
std::wstring str = L"";
|
834
|
-
a2.Perform(make_tuple(&str));
|
835
|
-
EXPECT_EQ(L"world", str);
|
836
|
-
|
837
|
-
# endif
|
838
|
-
}
|
839
|
-
#endif
|
840
|
-
|
841
|
-
// Tests that SetArgPointee<N>() accepts a char pointer.
|
842
|
-
TEST(SetArgPointeeTest, AcceptsCharPointer) {
|
843
|
-
typedef void MyFunction(bool, std::string*, const char**);
|
844
|
-
const char* const hi = "hi";
|
845
|
-
Action<MyFunction> a = SetArgPointee<1>(hi);
|
846
|
-
std::string str;
|
847
|
-
const char* ptr = NULL;
|
848
|
-
a.Perform(make_tuple(true, &str, &ptr));
|
849
|
-
EXPECT_EQ("hi", str);
|
850
|
-
EXPECT_TRUE(ptr == NULL);
|
851
|
-
|
852
|
-
char world_array[] = "world";
|
853
|
-
char* const world = world_array;
|
854
|
-
a = SetArgPointee<2>(world);
|
855
|
-
str = "";
|
856
|
-
a.Perform(make_tuple(true, &str, &ptr));
|
857
|
-
EXPECT_EQ("", str);
|
858
|
-
EXPECT_EQ(world, ptr);
|
859
|
-
}
|
860
|
-
|
861
|
-
TEST(SetArgPointeeTest, AcceptsWideCharPointer) {
|
862
|
-
typedef void MyFunction(bool, const wchar_t**);
|
863
|
-
const wchar_t* const hi = L"hi";
|
864
|
-
Action<MyFunction> a = SetArgPointee<1>(hi);
|
865
|
-
const wchar_t* ptr = NULL;
|
866
|
-
a.Perform(make_tuple(true, &ptr));
|
867
|
-
EXPECT_EQ(hi, ptr);
|
868
|
-
|
869
|
-
# if GTEST_HAS_STD_WSTRING
|
870
|
-
|
871
|
-
typedef void MyStringFunction(bool, std::wstring*);
|
872
|
-
wchar_t world_array[] = L"world";
|
873
|
-
wchar_t* const world = world_array;
|
874
|
-
Action<MyStringFunction> a2 = SetArgPointee<1>(world);
|
875
|
-
std::wstring str;
|
876
|
-
a2.Perform(make_tuple(true, &str));
|
877
|
-
EXPECT_EQ(world_array, str);
|
878
|
-
# endif
|
879
|
-
}
|
880
|
-
|
881
|
-
#if GTEST_HAS_PROTOBUF_
|
882
|
-
|
883
|
-
// Tests that SetArgPointee<N>(proto_buffer) sets the v1 protobuf
|
884
|
-
// variable pointed to by the N-th (0-based) argument to proto_buffer.
|
885
|
-
TEST(SetArgPointeeTest, SetsTheNthPointeeOfProtoBufferType) {
|
886
|
-
TestMessage* const msg = new TestMessage;
|
887
|
-
msg->set_member("yes");
|
888
|
-
TestMessage orig_msg;
|
889
|
-
orig_msg.CopyFrom(*msg);
|
890
|
-
|
891
|
-
Action<void(bool, TestMessage*)> a = SetArgPointee<1>(*msg);
|
892
|
-
// SetArgPointee<N>(proto_buffer) makes a copy of proto_buffer
|
893
|
-
// s.t. the action works even when the original proto_buffer has
|
894
|
-
// died. We ensure this behavior by deleting msg before using the
|
895
|
-
// action.
|
896
|
-
delete msg;
|
897
|
-
|
898
|
-
TestMessage dest;
|
899
|
-
EXPECT_FALSE(orig_msg.Equals(dest));
|
900
|
-
a.Perform(make_tuple(true, &dest));
|
901
|
-
EXPECT_TRUE(orig_msg.Equals(dest));
|
902
|
-
}
|
903
|
-
|
904
|
-
// Tests that SetArgPointee<N>(proto_buffer) sets the
|
905
|
-
// ::ProtocolMessage variable pointed to by the N-th (0-based)
|
906
|
-
// argument to proto_buffer.
|
907
|
-
TEST(SetArgPointeeTest, SetsTheNthPointeeOfProtoBufferBaseType) {
|
908
|
-
TestMessage* const msg = new TestMessage;
|
909
|
-
msg->set_member("yes");
|
910
|
-
TestMessage orig_msg;
|
911
|
-
orig_msg.CopyFrom(*msg);
|
912
|
-
|
913
|
-
Action<void(bool, ::ProtocolMessage*)> a = SetArgPointee<1>(*msg);
|
914
|
-
// SetArgPointee<N>(proto_buffer) makes a copy of proto_buffer
|
915
|
-
// s.t. the action works even when the original proto_buffer has
|
916
|
-
// died. We ensure this behavior by deleting msg before using the
|
917
|
-
// action.
|
918
|
-
delete msg;
|
919
|
-
|
920
|
-
TestMessage dest;
|
921
|
-
::ProtocolMessage* const dest_base = &dest;
|
922
|
-
EXPECT_FALSE(orig_msg.Equals(dest));
|
923
|
-
a.Perform(make_tuple(true, dest_base));
|
924
|
-
EXPECT_TRUE(orig_msg.Equals(dest));
|
925
|
-
}
|
926
|
-
|
927
|
-
// Tests that SetArgPointee<N>(proto2_buffer) sets the v2
|
928
|
-
// protobuf variable pointed to by the N-th (0-based) argument to
|
929
|
-
// proto2_buffer.
|
930
|
-
TEST(SetArgPointeeTest, SetsTheNthPointeeOfProto2BufferType) {
|
931
|
-
using testing::internal::FooMessage;
|
932
|
-
FooMessage* const msg = new FooMessage;
|
933
|
-
msg->set_int_field(2);
|
934
|
-
msg->set_string_field("hi");
|
935
|
-
FooMessage orig_msg;
|
936
|
-
orig_msg.CopyFrom(*msg);
|
937
|
-
|
938
|
-
Action<void(bool, FooMessage*)> a = SetArgPointee<1>(*msg);
|
939
|
-
// SetArgPointee<N>(proto2_buffer) makes a copy of
|
940
|
-
// proto2_buffer s.t. the action works even when the original
|
941
|
-
// proto2_buffer has died. We ensure this behavior by deleting msg
|
942
|
-
// before using the action.
|
943
|
-
delete msg;
|
944
|
-
|
945
|
-
FooMessage dest;
|
946
|
-
dest.set_int_field(0);
|
947
|
-
a.Perform(make_tuple(true, &dest));
|
948
|
-
EXPECT_EQ(2, dest.int_field());
|
949
|
-
EXPECT_EQ("hi", dest.string_field());
|
950
|
-
}
|
951
|
-
|
952
|
-
// Tests that SetArgPointee<N>(proto2_buffer) sets the
|
953
|
-
// proto2::Message variable pointed to by the N-th (0-based) argument
|
954
|
-
// to proto2_buffer.
|
955
|
-
TEST(SetArgPointeeTest, SetsTheNthPointeeOfProto2BufferBaseType) {
|
956
|
-
using testing::internal::FooMessage;
|
957
|
-
FooMessage* const msg = new FooMessage;
|
958
|
-
msg->set_int_field(2);
|
959
|
-
msg->set_string_field("hi");
|
960
|
-
FooMessage orig_msg;
|
961
|
-
orig_msg.CopyFrom(*msg);
|
962
|
-
|
963
|
-
Action<void(bool, ::proto2::Message*)> a = SetArgPointee<1>(*msg);
|
964
|
-
// SetArgPointee<N>(proto2_buffer) makes a copy of
|
965
|
-
// proto2_buffer s.t. the action works even when the original
|
966
|
-
// proto2_buffer has died. We ensure this behavior by deleting msg
|
967
|
-
// before using the action.
|
968
|
-
delete msg;
|
969
|
-
|
970
|
-
FooMessage dest;
|
971
|
-
dest.set_int_field(0);
|
972
|
-
::proto2::Message* const dest_base = &dest;
|
973
|
-
a.Perform(make_tuple(true, dest_base));
|
974
|
-
EXPECT_EQ(2, dest.int_field());
|
975
|
-
EXPECT_EQ("hi", dest.string_field());
|
976
|
-
}
|
977
|
-
|
978
|
-
#endif // GTEST_HAS_PROTOBUF_
|
979
|
-
|
980
|
-
// Tests that SetArgumentPointee<N>(v) sets the variable pointed to by
|
981
|
-
// the N-th (0-based) argument to v.
|
982
|
-
TEST(SetArgumentPointeeTest, SetsTheNthPointee) {
|
983
|
-
typedef void MyFunction(bool, int*, char*);
|
984
|
-
Action<MyFunction> a = SetArgumentPointee<1>(2);
|
985
|
-
|
986
|
-
int n = 0;
|
987
|
-
char ch = '\0';
|
988
|
-
a.Perform(make_tuple(true, &n, &ch));
|
989
|
-
EXPECT_EQ(2, n);
|
990
|
-
EXPECT_EQ('\0', ch);
|
991
|
-
|
992
|
-
a = SetArgumentPointee<2>('a');
|
993
|
-
n = 0;
|
994
|
-
ch = '\0';
|
995
|
-
a.Perform(make_tuple(true, &n, &ch));
|
996
|
-
EXPECT_EQ(0, n);
|
997
|
-
EXPECT_EQ('a', ch);
|
998
|
-
}
|
999
|
-
|
1000
|
-
#if GTEST_HAS_PROTOBUF_
|
1001
|
-
|
1002
|
-
// Tests that SetArgumentPointee<N>(proto_buffer) sets the v1 protobuf
|
1003
|
-
// variable pointed to by the N-th (0-based) argument to proto_buffer.
|
1004
|
-
TEST(SetArgumentPointeeTest, SetsTheNthPointeeOfProtoBufferType) {
|
1005
|
-
TestMessage* const msg = new TestMessage;
|
1006
|
-
msg->set_member("yes");
|
1007
|
-
TestMessage orig_msg;
|
1008
|
-
orig_msg.CopyFrom(*msg);
|
1009
|
-
|
1010
|
-
Action<void(bool, TestMessage*)> a = SetArgumentPointee<1>(*msg);
|
1011
|
-
// SetArgumentPointee<N>(proto_buffer) makes a copy of proto_buffer
|
1012
|
-
// s.t. the action works even when the original proto_buffer has
|
1013
|
-
// died. We ensure this behavior by deleting msg before using the
|
1014
|
-
// action.
|
1015
|
-
delete msg;
|
1016
|
-
|
1017
|
-
TestMessage dest;
|
1018
|
-
EXPECT_FALSE(orig_msg.Equals(dest));
|
1019
|
-
a.Perform(make_tuple(true, &dest));
|
1020
|
-
EXPECT_TRUE(orig_msg.Equals(dest));
|
1021
|
-
}
|
1022
|
-
|
1023
|
-
// Tests that SetArgumentPointee<N>(proto_buffer) sets the
|
1024
|
-
// ::ProtocolMessage variable pointed to by the N-th (0-based)
|
1025
|
-
// argument to proto_buffer.
|
1026
|
-
TEST(SetArgumentPointeeTest, SetsTheNthPointeeOfProtoBufferBaseType) {
|
1027
|
-
TestMessage* const msg = new TestMessage;
|
1028
|
-
msg->set_member("yes");
|
1029
|
-
TestMessage orig_msg;
|
1030
|
-
orig_msg.CopyFrom(*msg);
|
1031
|
-
|
1032
|
-
Action<void(bool, ::ProtocolMessage*)> a = SetArgumentPointee<1>(*msg);
|
1033
|
-
// SetArgumentPointee<N>(proto_buffer) makes a copy of proto_buffer
|
1034
|
-
// s.t. the action works even when the original proto_buffer has
|
1035
|
-
// died. We ensure this behavior by deleting msg before using the
|
1036
|
-
// action.
|
1037
|
-
delete msg;
|
1038
|
-
|
1039
|
-
TestMessage dest;
|
1040
|
-
::ProtocolMessage* const dest_base = &dest;
|
1041
|
-
EXPECT_FALSE(orig_msg.Equals(dest));
|
1042
|
-
a.Perform(make_tuple(true, dest_base));
|
1043
|
-
EXPECT_TRUE(orig_msg.Equals(dest));
|
1044
|
-
}
|
1045
|
-
|
1046
|
-
// Tests that SetArgumentPointee<N>(proto2_buffer) sets the v2
|
1047
|
-
// protobuf variable pointed to by the N-th (0-based) argument to
|
1048
|
-
// proto2_buffer.
|
1049
|
-
TEST(SetArgumentPointeeTest, SetsTheNthPointeeOfProto2BufferType) {
|
1050
|
-
using testing::internal::FooMessage;
|
1051
|
-
FooMessage* const msg = new FooMessage;
|
1052
|
-
msg->set_int_field(2);
|
1053
|
-
msg->set_string_field("hi");
|
1054
|
-
FooMessage orig_msg;
|
1055
|
-
orig_msg.CopyFrom(*msg);
|
1056
|
-
|
1057
|
-
Action<void(bool, FooMessage*)> a = SetArgumentPointee<1>(*msg);
|
1058
|
-
// SetArgumentPointee<N>(proto2_buffer) makes a copy of
|
1059
|
-
// proto2_buffer s.t. the action works even when the original
|
1060
|
-
// proto2_buffer has died. We ensure this behavior by deleting msg
|
1061
|
-
// before using the action.
|
1062
|
-
delete msg;
|
1063
|
-
|
1064
|
-
FooMessage dest;
|
1065
|
-
dest.set_int_field(0);
|
1066
|
-
a.Perform(make_tuple(true, &dest));
|
1067
|
-
EXPECT_EQ(2, dest.int_field());
|
1068
|
-
EXPECT_EQ("hi", dest.string_field());
|
1069
|
-
}
|
1070
|
-
|
1071
|
-
// Tests that SetArgumentPointee<N>(proto2_buffer) sets the
|
1072
|
-
// proto2::Message variable pointed to by the N-th (0-based) argument
|
1073
|
-
// to proto2_buffer.
|
1074
|
-
TEST(SetArgumentPointeeTest, SetsTheNthPointeeOfProto2BufferBaseType) {
|
1075
|
-
using testing::internal::FooMessage;
|
1076
|
-
FooMessage* const msg = new FooMessage;
|
1077
|
-
msg->set_int_field(2);
|
1078
|
-
msg->set_string_field("hi");
|
1079
|
-
FooMessage orig_msg;
|
1080
|
-
orig_msg.CopyFrom(*msg);
|
1081
|
-
|
1082
|
-
Action<void(bool, ::proto2::Message*)> a = SetArgumentPointee<1>(*msg);
|
1083
|
-
// SetArgumentPointee<N>(proto2_buffer) makes a copy of
|
1084
|
-
// proto2_buffer s.t. the action works even when the original
|
1085
|
-
// proto2_buffer has died. We ensure this behavior by deleting msg
|
1086
|
-
// before using the action.
|
1087
|
-
delete msg;
|
1088
|
-
|
1089
|
-
FooMessage dest;
|
1090
|
-
dest.set_int_field(0);
|
1091
|
-
::proto2::Message* const dest_base = &dest;
|
1092
|
-
a.Perform(make_tuple(true, dest_base));
|
1093
|
-
EXPECT_EQ(2, dest.int_field());
|
1094
|
-
EXPECT_EQ("hi", dest.string_field());
|
1095
|
-
}
|
1096
|
-
|
1097
|
-
#endif // GTEST_HAS_PROTOBUF_
|
1098
|
-
|
1099
|
-
// Sample functions and functors for testing Invoke() and etc.
|
1100
|
-
int Nullary() { return 1; }
|
1101
|
-
|
1102
|
-
class NullaryFunctor {
|
1103
|
-
public:
|
1104
|
-
int operator()() { return 2; }
|
1105
|
-
};
|
1106
|
-
|
1107
|
-
bool g_done = false;
|
1108
|
-
void VoidNullary() { g_done = true; }
|
1109
|
-
|
1110
|
-
class VoidNullaryFunctor {
|
1111
|
-
public:
|
1112
|
-
void operator()() { g_done = true; }
|
1113
|
-
};
|
1114
|
-
|
1115
|
-
class Foo {
|
1116
|
-
public:
|
1117
|
-
Foo() : value_(123) {}
|
1118
|
-
|
1119
|
-
int Nullary() const { return value_; }
|
1120
|
-
|
1121
|
-
private:
|
1122
|
-
int value_;
|
1123
|
-
};
|
1124
|
-
|
1125
|
-
// Tests InvokeWithoutArgs(function).
|
1126
|
-
TEST(InvokeWithoutArgsTest, Function) {
|
1127
|
-
// As an action that takes one argument.
|
1128
|
-
Action<int(int)> a = InvokeWithoutArgs(Nullary); // NOLINT
|
1129
|
-
EXPECT_EQ(1, a.Perform(make_tuple(2)));
|
1130
|
-
|
1131
|
-
// As an action that takes two arguments.
|
1132
|
-
Action<int(int, double)> a2 = InvokeWithoutArgs(Nullary); // NOLINT
|
1133
|
-
EXPECT_EQ(1, a2.Perform(make_tuple(2, 3.5)));
|
1134
|
-
|
1135
|
-
// As an action that returns void.
|
1136
|
-
Action<void(int)> a3 = InvokeWithoutArgs(VoidNullary); // NOLINT
|
1137
|
-
g_done = false;
|
1138
|
-
a3.Perform(make_tuple(1));
|
1139
|
-
EXPECT_TRUE(g_done);
|
1140
|
-
}
|
1141
|
-
|
1142
|
-
// Tests InvokeWithoutArgs(functor).
|
1143
|
-
TEST(InvokeWithoutArgsTest, Functor) {
|
1144
|
-
// As an action that takes no argument.
|
1145
|
-
Action<int()> a = InvokeWithoutArgs(NullaryFunctor()); // NOLINT
|
1146
|
-
EXPECT_EQ(2, a.Perform(make_tuple()));
|
1147
|
-
|
1148
|
-
// As an action that takes three arguments.
|
1149
|
-
Action<int(int, double, char)> a2 = // NOLINT
|
1150
|
-
InvokeWithoutArgs(NullaryFunctor());
|
1151
|
-
EXPECT_EQ(2, a2.Perform(make_tuple(3, 3.5, 'a')));
|
1152
|
-
|
1153
|
-
// As an action that returns void.
|
1154
|
-
Action<void()> a3 = InvokeWithoutArgs(VoidNullaryFunctor());
|
1155
|
-
g_done = false;
|
1156
|
-
a3.Perform(make_tuple());
|
1157
|
-
EXPECT_TRUE(g_done);
|
1158
|
-
}
|
1159
|
-
|
1160
|
-
// Tests InvokeWithoutArgs(obj_ptr, method).
|
1161
|
-
TEST(InvokeWithoutArgsTest, Method) {
|
1162
|
-
Foo foo;
|
1163
|
-
Action<int(bool, char)> a = // NOLINT
|
1164
|
-
InvokeWithoutArgs(&foo, &Foo::Nullary);
|
1165
|
-
EXPECT_EQ(123, a.Perform(make_tuple(true, 'a')));
|
1166
|
-
}
|
1167
|
-
|
1168
|
-
// Tests using IgnoreResult() on a polymorphic action.
|
1169
|
-
TEST(IgnoreResultTest, PolymorphicAction) {
|
1170
|
-
Action<void(int)> a = IgnoreResult(Return(5)); // NOLINT
|
1171
|
-
a.Perform(make_tuple(1));
|
1172
|
-
}
|
1173
|
-
|
1174
|
-
// Tests using IgnoreResult() on a monomorphic action.
|
1175
|
-
|
1176
|
-
int ReturnOne() {
|
1177
|
-
g_done = true;
|
1178
|
-
return 1;
|
1179
|
-
}
|
1180
|
-
|
1181
|
-
TEST(IgnoreResultTest, MonomorphicAction) {
|
1182
|
-
g_done = false;
|
1183
|
-
Action<void()> a = IgnoreResult(Invoke(ReturnOne));
|
1184
|
-
a.Perform(make_tuple());
|
1185
|
-
EXPECT_TRUE(g_done);
|
1186
|
-
}
|
1187
|
-
|
1188
|
-
// Tests using IgnoreResult() on an action that returns a class type.
|
1189
|
-
|
1190
|
-
MyNonDefaultConstructible ReturnMyNonDefaultConstructible(double /* x */) {
|
1191
|
-
g_done = true;
|
1192
|
-
return MyNonDefaultConstructible(42);
|
1193
|
-
}
|
1194
|
-
|
1195
|
-
TEST(IgnoreResultTest, ActionReturningClass) {
|
1196
|
-
g_done = false;
|
1197
|
-
Action<void(int)> a =
|
1198
|
-
IgnoreResult(Invoke(ReturnMyNonDefaultConstructible)); // NOLINT
|
1199
|
-
a.Perform(make_tuple(2));
|
1200
|
-
EXPECT_TRUE(g_done);
|
1201
|
-
}
|
1202
|
-
|
1203
|
-
TEST(AssignTest, Int) {
|
1204
|
-
int x = 0;
|
1205
|
-
Action<void(int)> a = Assign(&x, 5);
|
1206
|
-
a.Perform(make_tuple(0));
|
1207
|
-
EXPECT_EQ(5, x);
|
1208
|
-
}
|
1209
|
-
|
1210
|
-
TEST(AssignTest, String) {
|
1211
|
-
::std::string x;
|
1212
|
-
Action<void(void)> a = Assign(&x, "Hello, world");
|
1213
|
-
a.Perform(make_tuple());
|
1214
|
-
EXPECT_EQ("Hello, world", x);
|
1215
|
-
}
|
1216
|
-
|
1217
|
-
TEST(AssignTest, CompatibleTypes) {
|
1218
|
-
double x = 0;
|
1219
|
-
Action<void(int)> a = Assign(&x, 5);
|
1220
|
-
a.Perform(make_tuple(0));
|
1221
|
-
EXPECT_DOUBLE_EQ(5, x);
|
1222
|
-
}
|
1223
|
-
|
1224
|
-
#if !GTEST_OS_WINDOWS_MOBILE
|
1225
|
-
|
1226
|
-
class SetErrnoAndReturnTest : public testing::Test {
|
1227
|
-
protected:
|
1228
|
-
virtual void SetUp() { errno = 0; }
|
1229
|
-
virtual void TearDown() { errno = 0; }
|
1230
|
-
};
|
1231
|
-
|
1232
|
-
TEST_F(SetErrnoAndReturnTest, Int) {
|
1233
|
-
Action<int(void)> a = SetErrnoAndReturn(ENOTTY, -5);
|
1234
|
-
EXPECT_EQ(-5, a.Perform(make_tuple()));
|
1235
|
-
EXPECT_EQ(ENOTTY, errno);
|
1236
|
-
}
|
1237
|
-
|
1238
|
-
TEST_F(SetErrnoAndReturnTest, Ptr) {
|
1239
|
-
int x;
|
1240
|
-
Action<int*(void)> a = SetErrnoAndReturn(ENOTTY, &x);
|
1241
|
-
EXPECT_EQ(&x, a.Perform(make_tuple()));
|
1242
|
-
EXPECT_EQ(ENOTTY, errno);
|
1243
|
-
}
|
1244
|
-
|
1245
|
-
TEST_F(SetErrnoAndReturnTest, CompatibleTypes) {
|
1246
|
-
Action<double()> a = SetErrnoAndReturn(EINVAL, 5);
|
1247
|
-
EXPECT_DOUBLE_EQ(5.0, a.Perform(make_tuple()));
|
1248
|
-
EXPECT_EQ(EINVAL, errno);
|
1249
|
-
}
|
1250
|
-
|
1251
|
-
#endif // !GTEST_OS_WINDOWS_MOBILE
|
1252
|
-
|
1253
|
-
// Tests ByRef().
|
1254
|
-
|
1255
|
-
// Tests that ReferenceWrapper<T> is copyable.
|
1256
|
-
TEST(ByRefTest, IsCopyable) {
|
1257
|
-
const std::string s1 = "Hi";
|
1258
|
-
const std::string s2 = "Hello";
|
1259
|
-
|
1260
|
-
::testing::internal::ReferenceWrapper<const std::string> ref_wrapper =
|
1261
|
-
ByRef(s1);
|
1262
|
-
const std::string& r1 = ref_wrapper;
|
1263
|
-
EXPECT_EQ(&s1, &r1);
|
1264
|
-
|
1265
|
-
// Assigns a new value to ref_wrapper.
|
1266
|
-
ref_wrapper = ByRef(s2);
|
1267
|
-
const std::string& r2 = ref_wrapper;
|
1268
|
-
EXPECT_EQ(&s2, &r2);
|
1269
|
-
|
1270
|
-
::testing::internal::ReferenceWrapper<const std::string> ref_wrapper1 =
|
1271
|
-
ByRef(s1);
|
1272
|
-
// Copies ref_wrapper1 to ref_wrapper.
|
1273
|
-
ref_wrapper = ref_wrapper1;
|
1274
|
-
const std::string& r3 = ref_wrapper;
|
1275
|
-
EXPECT_EQ(&s1, &r3);
|
1276
|
-
}
|
1277
|
-
|
1278
|
-
// Tests using ByRef() on a const value.
|
1279
|
-
TEST(ByRefTest, ConstValue) {
|
1280
|
-
const int n = 0;
|
1281
|
-
// int& ref = ByRef(n); // This shouldn't compile - we have a
|
1282
|
-
// negative compilation test to catch it.
|
1283
|
-
const int& const_ref = ByRef(n);
|
1284
|
-
EXPECT_EQ(&n, &const_ref);
|
1285
|
-
}
|
1286
|
-
|
1287
|
-
// Tests using ByRef() on a non-const value.
|
1288
|
-
TEST(ByRefTest, NonConstValue) {
|
1289
|
-
int n = 0;
|
1290
|
-
|
1291
|
-
// ByRef(n) can be used as either an int&,
|
1292
|
-
int& ref = ByRef(n);
|
1293
|
-
EXPECT_EQ(&n, &ref);
|
1294
|
-
|
1295
|
-
// or a const int&.
|
1296
|
-
const int& const_ref = ByRef(n);
|
1297
|
-
EXPECT_EQ(&n, &const_ref);
|
1298
|
-
}
|
1299
|
-
|
1300
|
-
// Tests explicitly specifying the type when using ByRef().
|
1301
|
-
TEST(ByRefTest, ExplicitType) {
|
1302
|
-
int n = 0;
|
1303
|
-
const int& r1 = ByRef<const int>(n);
|
1304
|
-
EXPECT_EQ(&n, &r1);
|
1305
|
-
|
1306
|
-
// ByRef<char>(n); // This shouldn't compile - we have a negative
|
1307
|
-
// compilation test to catch it.
|
1308
|
-
|
1309
|
-
Derived d;
|
1310
|
-
Derived& r2 = ByRef<Derived>(d);
|
1311
|
-
EXPECT_EQ(&d, &r2);
|
1312
|
-
|
1313
|
-
const Derived& r3 = ByRef<const Derived>(d);
|
1314
|
-
EXPECT_EQ(&d, &r3);
|
1315
|
-
|
1316
|
-
Base& r4 = ByRef<Base>(d);
|
1317
|
-
EXPECT_EQ(&d, &r4);
|
1318
|
-
|
1319
|
-
const Base& r5 = ByRef<const Base>(d);
|
1320
|
-
EXPECT_EQ(&d, &r5);
|
1321
|
-
|
1322
|
-
// The following shouldn't compile - we have a negative compilation
|
1323
|
-
// test for it.
|
1324
|
-
//
|
1325
|
-
// Base b;
|
1326
|
-
// ByRef<Derived>(b);
|
1327
|
-
}
|
1328
|
-
|
1329
|
-
// Tests that Google Mock prints expression ByRef(x) as a reference to x.
|
1330
|
-
TEST(ByRefTest, PrintsCorrectly) {
|
1331
|
-
int n = 42;
|
1332
|
-
::std::stringstream expected, actual;
|
1333
|
-
testing::internal::UniversalPrinter<const int&>::Print(n, &expected);
|
1334
|
-
testing::internal::UniversalPrint(ByRef(n), &actual);
|
1335
|
-
EXPECT_EQ(expected.str(), actual.str());
|
1336
|
-
}
|
1337
|
-
|
1338
|
-
#if GTEST_HAS_STD_UNIQUE_PTR_
|
1339
|
-
|
1340
|
-
std::unique_ptr<int> UniquePtrSource() {
|
1341
|
-
return std::unique_ptr<int>(new int(19));
|
1342
|
-
}
|
1343
|
-
|
1344
|
-
std::vector<std::unique_ptr<int>> VectorUniquePtrSource() {
|
1345
|
-
std::vector<std::unique_ptr<int>> out;
|
1346
|
-
out.emplace_back(new int(7));
|
1347
|
-
return out;
|
1348
|
-
}
|
1349
|
-
|
1350
|
-
TEST(MockMethodTest, CanReturnMoveOnlyValue_Return) {
|
1351
|
-
MockClass mock;
|
1352
|
-
std::unique_ptr<int> i(new int(19));
|
1353
|
-
EXPECT_CALL(mock, MakeUnique()).WillOnce(Return(ByMove(std::move(i))));
|
1354
|
-
EXPECT_CALL(mock, MakeVectorUnique())
|
1355
|
-
.WillOnce(Return(ByMove(VectorUniquePtrSource())));
|
1356
|
-
Derived* d = new Derived;
|
1357
|
-
EXPECT_CALL(mock, MakeUniqueBase())
|
1358
|
-
.WillOnce(Return(ByMove(std::unique_ptr<Derived>(d))));
|
1359
|
-
|
1360
|
-
std::unique_ptr<int> result1 = mock.MakeUnique();
|
1361
|
-
EXPECT_EQ(19, *result1);
|
1362
|
-
|
1363
|
-
std::vector<std::unique_ptr<int>> vresult = mock.MakeVectorUnique();
|
1364
|
-
EXPECT_EQ(1u, vresult.size());
|
1365
|
-
EXPECT_NE(nullptr, vresult[0]);
|
1366
|
-
EXPECT_EQ(7, *vresult[0]);
|
1367
|
-
|
1368
|
-
std::unique_ptr<Base> result2 = mock.MakeUniqueBase();
|
1369
|
-
EXPECT_EQ(d, result2.get());
|
1370
|
-
}
|
1371
|
-
|
1372
|
-
TEST(MockMethodTest, CanReturnMoveOnlyValue_DoAllReturn) {
|
1373
|
-
testing::MockFunction<void()> mock_function;
|
1374
|
-
MockClass mock;
|
1375
|
-
std::unique_ptr<int> i(new int(19));
|
1376
|
-
EXPECT_CALL(mock_function, Call());
|
1377
|
-
EXPECT_CALL(mock, MakeUnique()).WillOnce(DoAll(
|
1378
|
-
InvokeWithoutArgs(&mock_function, &testing::MockFunction<void()>::Call),
|
1379
|
-
Return(ByMove(std::move(i)))));
|
1380
|
-
|
1381
|
-
std::unique_ptr<int> result1 = mock.MakeUnique();
|
1382
|
-
EXPECT_EQ(19, *result1);
|
1383
|
-
}
|
1384
|
-
|
1385
|
-
TEST(MockMethodTest, CanReturnMoveOnlyValue_Invoke) {
|
1386
|
-
MockClass mock;
|
1387
|
-
|
1388
|
-
// Check default value
|
1389
|
-
DefaultValue<std::unique_ptr<int>>::SetFactory([] {
|
1390
|
-
return std::unique_ptr<int>(new int(42));
|
1391
|
-
});
|
1392
|
-
EXPECT_EQ(42, *mock.MakeUnique());
|
1393
|
-
|
1394
|
-
EXPECT_CALL(mock, MakeUnique()).WillRepeatedly(Invoke(UniquePtrSource));
|
1395
|
-
EXPECT_CALL(mock, MakeVectorUnique())
|
1396
|
-
.WillRepeatedly(Invoke(VectorUniquePtrSource));
|
1397
|
-
std::unique_ptr<int> result1 = mock.MakeUnique();
|
1398
|
-
EXPECT_EQ(19, *result1);
|
1399
|
-
std::unique_ptr<int> result2 = mock.MakeUnique();
|
1400
|
-
EXPECT_EQ(19, *result2);
|
1401
|
-
EXPECT_NE(result1, result2);
|
1402
|
-
|
1403
|
-
std::vector<std::unique_ptr<int>> vresult = mock.MakeVectorUnique();
|
1404
|
-
EXPECT_EQ(1u, vresult.size());
|
1405
|
-
EXPECT_NE(nullptr, vresult[0]);
|
1406
|
-
EXPECT_EQ(7, *vresult[0]);
|
1407
|
-
}
|
1408
|
-
|
1409
|
-
#endif // GTEST_HAS_STD_UNIQUE_PTR_
|
1410
|
-
|
1411
|
-
} // Unnamed namespace
|