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,1205 +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 implements some commonly used actions.
|
35
|
-
|
36
|
-
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
|
37
|
-
#define GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
|
38
|
-
|
39
|
-
#ifndef _WIN32_WCE
|
40
|
-
# include <errno.h>
|
41
|
-
#endif
|
42
|
-
|
43
|
-
#include <algorithm>
|
44
|
-
#include <string>
|
45
|
-
|
46
|
-
#include "gmock/internal/gmock-internal-utils.h"
|
47
|
-
#include "gmock/internal/gmock-port.h"
|
48
|
-
|
49
|
-
#if GTEST_HAS_STD_TYPE_TRAITS_ // Defined by gtest-port.h via gmock-port.h.
|
50
|
-
#include <type_traits>
|
51
|
-
#endif
|
52
|
-
|
53
|
-
namespace testing {
|
54
|
-
|
55
|
-
// To implement an action Foo, define:
|
56
|
-
// 1. a class FooAction that implements the ActionInterface interface, and
|
57
|
-
// 2. a factory function that creates an Action object from a
|
58
|
-
// const FooAction*.
|
59
|
-
//
|
60
|
-
// The two-level delegation design follows that of Matcher, providing
|
61
|
-
// consistency for extension developers. It also eases ownership
|
62
|
-
// management as Action objects can now be copied like plain values.
|
63
|
-
|
64
|
-
namespace internal {
|
65
|
-
|
66
|
-
template <typename F1, typename F2>
|
67
|
-
class ActionAdaptor;
|
68
|
-
|
69
|
-
// BuiltInDefaultValueGetter<T, true>::Get() returns a
|
70
|
-
// default-constructed T value. BuiltInDefaultValueGetter<T,
|
71
|
-
// false>::Get() crashes with an error.
|
72
|
-
//
|
73
|
-
// This primary template is used when kDefaultConstructible is true.
|
74
|
-
template <typename T, bool kDefaultConstructible>
|
75
|
-
struct BuiltInDefaultValueGetter {
|
76
|
-
static T Get() { return T(); }
|
77
|
-
};
|
78
|
-
template <typename T>
|
79
|
-
struct BuiltInDefaultValueGetter<T, false> {
|
80
|
-
static T Get() {
|
81
|
-
Assert(false, __FILE__, __LINE__,
|
82
|
-
"Default action undefined for the function return type.");
|
83
|
-
return internal::Invalid<T>();
|
84
|
-
// The above statement will never be reached, but is required in
|
85
|
-
// order for this function to compile.
|
86
|
-
}
|
87
|
-
};
|
88
|
-
|
89
|
-
// BuiltInDefaultValue<T>::Get() returns the "built-in" default value
|
90
|
-
// for type T, which is NULL when T is a raw pointer type, 0 when T is
|
91
|
-
// a numeric type, false when T is bool, or "" when T is string or
|
92
|
-
// std::string. In addition, in C++11 and above, it turns a
|
93
|
-
// default-constructed T value if T is default constructible. For any
|
94
|
-
// other type T, the built-in default T value is undefined, and the
|
95
|
-
// function will abort the process.
|
96
|
-
template <typename T>
|
97
|
-
class BuiltInDefaultValue {
|
98
|
-
public:
|
99
|
-
#if GTEST_HAS_STD_TYPE_TRAITS_
|
100
|
-
// This function returns true iff type T has a built-in default value.
|
101
|
-
static bool Exists() {
|
102
|
-
return ::std::is_default_constructible<T>::value;
|
103
|
-
}
|
104
|
-
|
105
|
-
static T Get() {
|
106
|
-
return BuiltInDefaultValueGetter<
|
107
|
-
T, ::std::is_default_constructible<T>::value>::Get();
|
108
|
-
}
|
109
|
-
|
110
|
-
#else // GTEST_HAS_STD_TYPE_TRAITS_
|
111
|
-
// This function returns true iff type T has a built-in default value.
|
112
|
-
static bool Exists() {
|
113
|
-
return false;
|
114
|
-
}
|
115
|
-
|
116
|
-
static T Get() {
|
117
|
-
return BuiltInDefaultValueGetter<T, false>::Get();
|
118
|
-
}
|
119
|
-
|
120
|
-
#endif // GTEST_HAS_STD_TYPE_TRAITS_
|
121
|
-
};
|
122
|
-
|
123
|
-
// This partial specialization says that we use the same built-in
|
124
|
-
// default value for T and const T.
|
125
|
-
template <typename T>
|
126
|
-
class BuiltInDefaultValue<const T> {
|
127
|
-
public:
|
128
|
-
static bool Exists() { return BuiltInDefaultValue<T>::Exists(); }
|
129
|
-
static T Get() { return BuiltInDefaultValue<T>::Get(); }
|
130
|
-
};
|
131
|
-
|
132
|
-
// This partial specialization defines the default values for pointer
|
133
|
-
// types.
|
134
|
-
template <typename T>
|
135
|
-
class BuiltInDefaultValue<T*> {
|
136
|
-
public:
|
137
|
-
static bool Exists() { return true; }
|
138
|
-
static T* Get() { return NULL; }
|
139
|
-
};
|
140
|
-
|
141
|
-
// The following specializations define the default values for
|
142
|
-
// specific types we care about.
|
143
|
-
#define GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(type, value) \
|
144
|
-
template <> \
|
145
|
-
class BuiltInDefaultValue<type> { \
|
146
|
-
public: \
|
147
|
-
static bool Exists() { return true; } \
|
148
|
-
static type Get() { return value; } \
|
149
|
-
}
|
150
|
-
|
151
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(void, ); // NOLINT
|
152
|
-
#if GTEST_HAS_GLOBAL_STRING
|
153
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::string, "");
|
154
|
-
#endif // GTEST_HAS_GLOBAL_STRING
|
155
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::std::string, "");
|
156
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(bool, false);
|
157
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned char, '\0');
|
158
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed char, '\0');
|
159
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(char, '\0');
|
160
|
-
|
161
|
-
// There's no need for a default action for signed wchar_t, as that
|
162
|
-
// type is the same as wchar_t for gcc, and invalid for MSVC.
|
163
|
-
//
|
164
|
-
// There's also no need for a default action for unsigned wchar_t, as
|
165
|
-
// that type is the same as unsigned int for gcc, and invalid for
|
166
|
-
// MSVC.
|
167
|
-
#if GMOCK_WCHAR_T_IS_NATIVE_
|
168
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(wchar_t, 0U); // NOLINT
|
169
|
-
#endif
|
170
|
-
|
171
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned short, 0U); // NOLINT
|
172
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed short, 0); // NOLINT
|
173
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned int, 0U);
|
174
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed int, 0);
|
175
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned long, 0UL); // NOLINT
|
176
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed long, 0L); // NOLINT
|
177
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(UInt64, 0);
|
178
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(Int64, 0);
|
179
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(float, 0);
|
180
|
-
GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(double, 0);
|
181
|
-
|
182
|
-
#undef GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_
|
183
|
-
|
184
|
-
} // namespace internal
|
185
|
-
|
186
|
-
// When an unexpected function call is encountered, Google Mock will
|
187
|
-
// let it return a default value if the user has specified one for its
|
188
|
-
// return type, or if the return type has a built-in default value;
|
189
|
-
// otherwise Google Mock won't know what value to return and will have
|
190
|
-
// to abort the process.
|
191
|
-
//
|
192
|
-
// The DefaultValue<T> class allows a user to specify the
|
193
|
-
// default value for a type T that is both copyable and publicly
|
194
|
-
// destructible (i.e. anything that can be used as a function return
|
195
|
-
// type). The usage is:
|
196
|
-
//
|
197
|
-
// // Sets the default value for type T to be foo.
|
198
|
-
// DefaultValue<T>::Set(foo);
|
199
|
-
template <typename T>
|
200
|
-
class DefaultValue {
|
201
|
-
public:
|
202
|
-
// Sets the default value for type T; requires T to be
|
203
|
-
// copy-constructable and have a public destructor.
|
204
|
-
static void Set(T x) {
|
205
|
-
delete producer_;
|
206
|
-
producer_ = new FixedValueProducer(x);
|
207
|
-
}
|
208
|
-
|
209
|
-
// Provides a factory function to be called to generate the default value.
|
210
|
-
// This method can be used even if T is only move-constructible, but it is not
|
211
|
-
// limited to that case.
|
212
|
-
typedef T (*FactoryFunction)();
|
213
|
-
static void SetFactory(FactoryFunction factory) {
|
214
|
-
delete producer_;
|
215
|
-
producer_ = new FactoryValueProducer(factory);
|
216
|
-
}
|
217
|
-
|
218
|
-
// Unsets the default value for type T.
|
219
|
-
static void Clear() {
|
220
|
-
delete producer_;
|
221
|
-
producer_ = NULL;
|
222
|
-
}
|
223
|
-
|
224
|
-
// Returns true iff the user has set the default value for type T.
|
225
|
-
static bool IsSet() { return producer_ != NULL; }
|
226
|
-
|
227
|
-
// Returns true if T has a default return value set by the user or there
|
228
|
-
// exists a built-in default value.
|
229
|
-
static bool Exists() {
|
230
|
-
return IsSet() || internal::BuiltInDefaultValue<T>::Exists();
|
231
|
-
}
|
232
|
-
|
233
|
-
// Returns the default value for type T if the user has set one;
|
234
|
-
// otherwise returns the built-in default value. Requires that Exists()
|
235
|
-
// is true, which ensures that the return value is well-defined.
|
236
|
-
static T Get() {
|
237
|
-
return producer_ == NULL ?
|
238
|
-
internal::BuiltInDefaultValue<T>::Get() : producer_->Produce();
|
239
|
-
}
|
240
|
-
|
241
|
-
private:
|
242
|
-
class ValueProducer {
|
243
|
-
public:
|
244
|
-
virtual ~ValueProducer() {}
|
245
|
-
virtual T Produce() = 0;
|
246
|
-
};
|
247
|
-
|
248
|
-
class FixedValueProducer : public ValueProducer {
|
249
|
-
public:
|
250
|
-
explicit FixedValueProducer(T value) : value_(value) {}
|
251
|
-
virtual T Produce() { return value_; }
|
252
|
-
|
253
|
-
private:
|
254
|
-
const T value_;
|
255
|
-
GTEST_DISALLOW_COPY_AND_ASSIGN_(FixedValueProducer);
|
256
|
-
};
|
257
|
-
|
258
|
-
class FactoryValueProducer : public ValueProducer {
|
259
|
-
public:
|
260
|
-
explicit FactoryValueProducer(FactoryFunction factory)
|
261
|
-
: factory_(factory) {}
|
262
|
-
virtual T Produce() { return factory_(); }
|
263
|
-
|
264
|
-
private:
|
265
|
-
const FactoryFunction factory_;
|
266
|
-
GTEST_DISALLOW_COPY_AND_ASSIGN_(FactoryValueProducer);
|
267
|
-
};
|
268
|
-
|
269
|
-
static ValueProducer* producer_;
|
270
|
-
};
|
271
|
-
|
272
|
-
// This partial specialization allows a user to set default values for
|
273
|
-
// reference types.
|
274
|
-
template <typename T>
|
275
|
-
class DefaultValue<T&> {
|
276
|
-
public:
|
277
|
-
// Sets the default value for type T&.
|
278
|
-
static void Set(T& x) { // NOLINT
|
279
|
-
address_ = &x;
|
280
|
-
}
|
281
|
-
|
282
|
-
// Unsets the default value for type T&.
|
283
|
-
static void Clear() {
|
284
|
-
address_ = NULL;
|
285
|
-
}
|
286
|
-
|
287
|
-
// Returns true iff the user has set the default value for type T&.
|
288
|
-
static bool IsSet() { return address_ != NULL; }
|
289
|
-
|
290
|
-
// Returns true if T has a default return value set by the user or there
|
291
|
-
// exists a built-in default value.
|
292
|
-
static bool Exists() {
|
293
|
-
return IsSet() || internal::BuiltInDefaultValue<T&>::Exists();
|
294
|
-
}
|
295
|
-
|
296
|
-
// Returns the default value for type T& if the user has set one;
|
297
|
-
// otherwise returns the built-in default value if there is one;
|
298
|
-
// otherwise aborts the process.
|
299
|
-
static T& Get() {
|
300
|
-
return address_ == NULL ?
|
301
|
-
internal::BuiltInDefaultValue<T&>::Get() : *address_;
|
302
|
-
}
|
303
|
-
|
304
|
-
private:
|
305
|
-
static T* address_;
|
306
|
-
};
|
307
|
-
|
308
|
-
// This specialization allows DefaultValue<void>::Get() to
|
309
|
-
// compile.
|
310
|
-
template <>
|
311
|
-
class DefaultValue<void> {
|
312
|
-
public:
|
313
|
-
static bool Exists() { return true; }
|
314
|
-
static void Get() {}
|
315
|
-
};
|
316
|
-
|
317
|
-
// Points to the user-set default value for type T.
|
318
|
-
template <typename T>
|
319
|
-
typename DefaultValue<T>::ValueProducer* DefaultValue<T>::producer_ = NULL;
|
320
|
-
|
321
|
-
// Points to the user-set default value for type T&.
|
322
|
-
template <typename T>
|
323
|
-
T* DefaultValue<T&>::address_ = NULL;
|
324
|
-
|
325
|
-
// Implement this interface to define an action for function type F.
|
326
|
-
template <typename F>
|
327
|
-
class ActionInterface {
|
328
|
-
public:
|
329
|
-
typedef typename internal::Function<F>::Result Result;
|
330
|
-
typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
|
331
|
-
|
332
|
-
ActionInterface() {}
|
333
|
-
virtual ~ActionInterface() {}
|
334
|
-
|
335
|
-
// Performs the action. This method is not const, as in general an
|
336
|
-
// action can have side effects and be stateful. For example, a
|
337
|
-
// get-the-next-element-from-the-collection action will need to
|
338
|
-
// remember the current element.
|
339
|
-
virtual Result Perform(const ArgumentTuple& args) = 0;
|
340
|
-
|
341
|
-
private:
|
342
|
-
GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionInterface);
|
343
|
-
};
|
344
|
-
|
345
|
-
// An Action<F> is a copyable and IMMUTABLE (except by assignment)
|
346
|
-
// object that represents an action to be taken when a mock function
|
347
|
-
// of type F is called. The implementation of Action<T> is just a
|
348
|
-
// linked_ptr to const ActionInterface<T>, so copying is fairly cheap.
|
349
|
-
// Don't inherit from Action!
|
350
|
-
//
|
351
|
-
// You can view an object implementing ActionInterface<F> as a
|
352
|
-
// concrete action (including its current state), and an Action<F>
|
353
|
-
// object as a handle to it.
|
354
|
-
template <typename F>
|
355
|
-
class Action {
|
356
|
-
public:
|
357
|
-
typedef typename internal::Function<F>::Result Result;
|
358
|
-
typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
|
359
|
-
|
360
|
-
// Constructs a null Action. Needed for storing Action objects in
|
361
|
-
// STL containers.
|
362
|
-
Action() : impl_(NULL) {}
|
363
|
-
|
364
|
-
// Constructs an Action from its implementation. A NULL impl is
|
365
|
-
// used to represent the "do-default" action.
|
366
|
-
explicit Action(ActionInterface<F>* impl) : impl_(impl) {}
|
367
|
-
|
368
|
-
// Copy constructor.
|
369
|
-
Action(const Action& action) : impl_(action.impl_) {}
|
370
|
-
|
371
|
-
// This constructor allows us to turn an Action<Func> object into an
|
372
|
-
// Action<F>, as long as F's arguments can be implicitly converted
|
373
|
-
// to Func's and Func's return type can be implicitly converted to
|
374
|
-
// F's.
|
375
|
-
template <typename Func>
|
376
|
-
explicit Action(const Action<Func>& action);
|
377
|
-
|
378
|
-
// Returns true iff this is the DoDefault() action.
|
379
|
-
bool IsDoDefault() const { return impl_.get() == NULL; }
|
380
|
-
|
381
|
-
// Performs the action. Note that this method is const even though
|
382
|
-
// the corresponding method in ActionInterface is not. The reason
|
383
|
-
// is that a const Action<F> means that it cannot be re-bound to
|
384
|
-
// another concrete action, not that the concrete action it binds to
|
385
|
-
// cannot change state. (Think of the difference between a const
|
386
|
-
// pointer and a pointer to const.)
|
387
|
-
Result Perform(const ArgumentTuple& args) const {
|
388
|
-
internal::Assert(
|
389
|
-
!IsDoDefault(), __FILE__, __LINE__,
|
390
|
-
"You are using DoDefault() inside a composite action like "
|
391
|
-
"DoAll() or WithArgs(). This is not supported for technical "
|
392
|
-
"reasons. Please instead spell out the default action, or "
|
393
|
-
"assign the default action to an Action variable and use "
|
394
|
-
"the variable in various places.");
|
395
|
-
return impl_->Perform(args);
|
396
|
-
}
|
397
|
-
|
398
|
-
private:
|
399
|
-
template <typename F1, typename F2>
|
400
|
-
friend class internal::ActionAdaptor;
|
401
|
-
|
402
|
-
internal::linked_ptr<ActionInterface<F> > impl_;
|
403
|
-
};
|
404
|
-
|
405
|
-
// The PolymorphicAction class template makes it easy to implement a
|
406
|
-
// polymorphic action (i.e. an action that can be used in mock
|
407
|
-
// functions of than one type, e.g. Return()).
|
408
|
-
//
|
409
|
-
// To define a polymorphic action, a user first provides a COPYABLE
|
410
|
-
// implementation class that has a Perform() method template:
|
411
|
-
//
|
412
|
-
// class FooAction {
|
413
|
-
// public:
|
414
|
-
// template <typename Result, typename ArgumentTuple>
|
415
|
-
// Result Perform(const ArgumentTuple& args) const {
|
416
|
-
// // Processes the arguments and returns a result, using
|
417
|
-
// // tr1::get<N>(args) to get the N-th (0-based) argument in the tuple.
|
418
|
-
// }
|
419
|
-
// ...
|
420
|
-
// };
|
421
|
-
//
|
422
|
-
// Then the user creates the polymorphic action using
|
423
|
-
// MakePolymorphicAction(object) where object has type FooAction. See
|
424
|
-
// the definition of Return(void) and SetArgumentPointee<N>(value) for
|
425
|
-
// complete examples.
|
426
|
-
template <typename Impl>
|
427
|
-
class PolymorphicAction {
|
428
|
-
public:
|
429
|
-
explicit PolymorphicAction(const Impl& impl) : impl_(impl) {}
|
430
|
-
|
431
|
-
template <typename F>
|
432
|
-
operator Action<F>() const {
|
433
|
-
return Action<F>(new MonomorphicImpl<F>(impl_));
|
434
|
-
}
|
435
|
-
|
436
|
-
private:
|
437
|
-
template <typename F>
|
438
|
-
class MonomorphicImpl : public ActionInterface<F> {
|
439
|
-
public:
|
440
|
-
typedef typename internal::Function<F>::Result Result;
|
441
|
-
typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
|
442
|
-
|
443
|
-
explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
|
444
|
-
|
445
|
-
virtual Result Perform(const ArgumentTuple& args) {
|
446
|
-
return impl_.template Perform<Result>(args);
|
447
|
-
}
|
448
|
-
|
449
|
-
private:
|
450
|
-
Impl impl_;
|
451
|
-
|
452
|
-
GTEST_DISALLOW_ASSIGN_(MonomorphicImpl);
|
453
|
-
};
|
454
|
-
|
455
|
-
Impl impl_;
|
456
|
-
|
457
|
-
GTEST_DISALLOW_ASSIGN_(PolymorphicAction);
|
458
|
-
};
|
459
|
-
|
460
|
-
// Creates an Action from its implementation and returns it. The
|
461
|
-
// created Action object owns the implementation.
|
462
|
-
template <typename F>
|
463
|
-
Action<F> MakeAction(ActionInterface<F>* impl) {
|
464
|
-
return Action<F>(impl);
|
465
|
-
}
|
466
|
-
|
467
|
-
// Creates a polymorphic action from its implementation. This is
|
468
|
-
// easier to use than the PolymorphicAction<Impl> constructor as it
|
469
|
-
// doesn't require you to explicitly write the template argument, e.g.
|
470
|
-
//
|
471
|
-
// MakePolymorphicAction(foo);
|
472
|
-
// vs
|
473
|
-
// PolymorphicAction<TypeOfFoo>(foo);
|
474
|
-
template <typename Impl>
|
475
|
-
inline PolymorphicAction<Impl> MakePolymorphicAction(const Impl& impl) {
|
476
|
-
return PolymorphicAction<Impl>(impl);
|
477
|
-
}
|
478
|
-
|
479
|
-
namespace internal {
|
480
|
-
|
481
|
-
// Allows an Action<F2> object to pose as an Action<F1>, as long as F2
|
482
|
-
// and F1 are compatible.
|
483
|
-
template <typename F1, typename F2>
|
484
|
-
class ActionAdaptor : public ActionInterface<F1> {
|
485
|
-
public:
|
486
|
-
typedef typename internal::Function<F1>::Result Result;
|
487
|
-
typedef typename internal::Function<F1>::ArgumentTuple ArgumentTuple;
|
488
|
-
|
489
|
-
explicit ActionAdaptor(const Action<F2>& from) : impl_(from.impl_) {}
|
490
|
-
|
491
|
-
virtual Result Perform(const ArgumentTuple& args) {
|
492
|
-
return impl_->Perform(args);
|
493
|
-
}
|
494
|
-
|
495
|
-
private:
|
496
|
-
const internal::linked_ptr<ActionInterface<F2> > impl_;
|
497
|
-
|
498
|
-
GTEST_DISALLOW_ASSIGN_(ActionAdaptor);
|
499
|
-
};
|
500
|
-
|
501
|
-
// Helper struct to specialize ReturnAction to execute a move instead of a copy
|
502
|
-
// on return. Useful for move-only types, but could be used on any type.
|
503
|
-
template <typename T>
|
504
|
-
struct ByMoveWrapper {
|
505
|
-
explicit ByMoveWrapper(T value) : payload(internal::move(value)) {}
|
506
|
-
T payload;
|
507
|
-
};
|
508
|
-
|
509
|
-
// Implements the polymorphic Return(x) action, which can be used in
|
510
|
-
// any function that returns the type of x, regardless of the argument
|
511
|
-
// types.
|
512
|
-
//
|
513
|
-
// Note: The value passed into Return must be converted into
|
514
|
-
// Function<F>::Result when this action is cast to Action<F> rather than
|
515
|
-
// when that action is performed. This is important in scenarios like
|
516
|
-
//
|
517
|
-
// MOCK_METHOD1(Method, T(U));
|
518
|
-
// ...
|
519
|
-
// {
|
520
|
-
// Foo foo;
|
521
|
-
// X x(&foo);
|
522
|
-
// EXPECT_CALL(mock, Method(_)).WillOnce(Return(x));
|
523
|
-
// }
|
524
|
-
//
|
525
|
-
// In the example above the variable x holds reference to foo which leaves
|
526
|
-
// scope and gets destroyed. If copying X just copies a reference to foo,
|
527
|
-
// that copy will be left with a hanging reference. If conversion to T
|
528
|
-
// makes a copy of foo, the above code is safe. To support that scenario, we
|
529
|
-
// need to make sure that the type conversion happens inside the EXPECT_CALL
|
530
|
-
// statement, and conversion of the result of Return to Action<T(U)> is a
|
531
|
-
// good place for that.
|
532
|
-
//
|
533
|
-
template <typename R>
|
534
|
-
class ReturnAction {
|
535
|
-
public:
|
536
|
-
// Constructs a ReturnAction object from the value to be returned.
|
537
|
-
// 'value' is passed by value instead of by const reference in order
|
538
|
-
// to allow Return("string literal") to compile.
|
539
|
-
explicit ReturnAction(R value) : value_(new R(internal::move(value))) {}
|
540
|
-
|
541
|
-
// This template type conversion operator allows Return(x) to be
|
542
|
-
// used in ANY function that returns x's type.
|
543
|
-
template <typename F>
|
544
|
-
operator Action<F>() const {
|
545
|
-
// Assert statement belongs here because this is the best place to verify
|
546
|
-
// conditions on F. It produces the clearest error messages
|
547
|
-
// in most compilers.
|
548
|
-
// Impl really belongs in this scope as a local class but can't
|
549
|
-
// because MSVC produces duplicate symbols in different translation units
|
550
|
-
// in this case. Until MS fixes that bug we put Impl into the class scope
|
551
|
-
// and put the typedef both here (for use in assert statement) and
|
552
|
-
// in the Impl class. But both definitions must be the same.
|
553
|
-
typedef typename Function<F>::Result Result;
|
554
|
-
GTEST_COMPILE_ASSERT_(
|
555
|
-
!is_reference<Result>::value,
|
556
|
-
use_ReturnRef_instead_of_Return_to_return_a_reference);
|
557
|
-
return Action<F>(new Impl<R, F>(value_));
|
558
|
-
}
|
559
|
-
|
560
|
-
private:
|
561
|
-
// Implements the Return(x) action for a particular function type F.
|
562
|
-
template <typename R_, typename F>
|
563
|
-
class Impl : public ActionInterface<F> {
|
564
|
-
public:
|
565
|
-
typedef typename Function<F>::Result Result;
|
566
|
-
typedef typename Function<F>::ArgumentTuple ArgumentTuple;
|
567
|
-
|
568
|
-
// The implicit cast is necessary when Result has more than one
|
569
|
-
// single-argument constructor (e.g. Result is std::vector<int>) and R
|
570
|
-
// has a type conversion operator template. In that case, value_(value)
|
571
|
-
// won't compile as the compiler doesn't known which constructor of
|
572
|
-
// Result to call. ImplicitCast_ forces the compiler to convert R to
|
573
|
-
// Result without considering explicit constructors, thus resolving the
|
574
|
-
// ambiguity. value_ is then initialized using its copy constructor.
|
575
|
-
explicit Impl(const linked_ptr<R>& value)
|
576
|
-
: value_before_cast_(*value),
|
577
|
-
value_(ImplicitCast_<Result>(value_before_cast_)) {}
|
578
|
-
|
579
|
-
virtual Result Perform(const ArgumentTuple&) { return value_; }
|
580
|
-
|
581
|
-
private:
|
582
|
-
GTEST_COMPILE_ASSERT_(!is_reference<Result>::value,
|
583
|
-
Result_cannot_be_a_reference_type);
|
584
|
-
// We save the value before casting just in case it is being cast to a
|
585
|
-
// wrapper type.
|
586
|
-
R value_before_cast_;
|
587
|
-
Result value_;
|
588
|
-
|
589
|
-
GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl);
|
590
|
-
};
|
591
|
-
|
592
|
-
// Partially specialize for ByMoveWrapper. This version of ReturnAction will
|
593
|
-
// move its contents instead.
|
594
|
-
template <typename R_, typename F>
|
595
|
-
class Impl<ByMoveWrapper<R_>, F> : public ActionInterface<F> {
|
596
|
-
public:
|
597
|
-
typedef typename Function<F>::Result Result;
|
598
|
-
typedef typename Function<F>::ArgumentTuple ArgumentTuple;
|
599
|
-
|
600
|
-
explicit Impl(const linked_ptr<R>& wrapper)
|
601
|
-
: performed_(false), wrapper_(wrapper) {}
|
602
|
-
|
603
|
-
virtual Result Perform(const ArgumentTuple&) {
|
604
|
-
GTEST_CHECK_(!performed_)
|
605
|
-
<< "A ByMove() action should only be performed once.";
|
606
|
-
performed_ = true;
|
607
|
-
return internal::move(wrapper_->payload);
|
608
|
-
}
|
609
|
-
|
610
|
-
private:
|
611
|
-
bool performed_;
|
612
|
-
const linked_ptr<R> wrapper_;
|
613
|
-
|
614
|
-
GTEST_DISALLOW_ASSIGN_(Impl);
|
615
|
-
};
|
616
|
-
|
617
|
-
const linked_ptr<R> value_;
|
618
|
-
|
619
|
-
GTEST_DISALLOW_ASSIGN_(ReturnAction);
|
620
|
-
};
|
621
|
-
|
622
|
-
// Implements the ReturnNull() action.
|
623
|
-
class ReturnNullAction {
|
624
|
-
public:
|
625
|
-
// Allows ReturnNull() to be used in any pointer-returning function. In C++11
|
626
|
-
// this is enforced by returning nullptr, and in non-C++11 by asserting a
|
627
|
-
// pointer type on compile time.
|
628
|
-
template <typename Result, typename ArgumentTuple>
|
629
|
-
static Result Perform(const ArgumentTuple&) {
|
630
|
-
#if GTEST_LANG_CXX11
|
631
|
-
return nullptr;
|
632
|
-
#else
|
633
|
-
GTEST_COMPILE_ASSERT_(internal::is_pointer<Result>::value,
|
634
|
-
ReturnNull_can_be_used_to_return_a_pointer_only);
|
635
|
-
return NULL;
|
636
|
-
#endif // GTEST_LANG_CXX11
|
637
|
-
}
|
638
|
-
};
|
639
|
-
|
640
|
-
// Implements the Return() action.
|
641
|
-
class ReturnVoidAction {
|
642
|
-
public:
|
643
|
-
// Allows Return() to be used in any void-returning function.
|
644
|
-
template <typename Result, typename ArgumentTuple>
|
645
|
-
static void Perform(const ArgumentTuple&) {
|
646
|
-
CompileAssertTypesEqual<void, Result>();
|
647
|
-
}
|
648
|
-
};
|
649
|
-
|
650
|
-
// Implements the polymorphic ReturnRef(x) action, which can be used
|
651
|
-
// in any function that returns a reference to the type of x,
|
652
|
-
// regardless of the argument types.
|
653
|
-
template <typename T>
|
654
|
-
class ReturnRefAction {
|
655
|
-
public:
|
656
|
-
// Constructs a ReturnRefAction object from the reference to be returned.
|
657
|
-
explicit ReturnRefAction(T& ref) : ref_(ref) {} // NOLINT
|
658
|
-
|
659
|
-
// This template type conversion operator allows ReturnRef(x) to be
|
660
|
-
// used in ANY function that returns a reference to x's type.
|
661
|
-
template <typename F>
|
662
|
-
operator Action<F>() const {
|
663
|
-
typedef typename Function<F>::Result Result;
|
664
|
-
// Asserts that the function return type is a reference. This
|
665
|
-
// catches the user error of using ReturnRef(x) when Return(x)
|
666
|
-
// should be used, and generates some helpful error message.
|
667
|
-
GTEST_COMPILE_ASSERT_(internal::is_reference<Result>::value,
|
668
|
-
use_Return_instead_of_ReturnRef_to_return_a_value);
|
669
|
-
return Action<F>(new Impl<F>(ref_));
|
670
|
-
}
|
671
|
-
|
672
|
-
private:
|
673
|
-
// Implements the ReturnRef(x) action for a particular function type F.
|
674
|
-
template <typename F>
|
675
|
-
class Impl : public ActionInterface<F> {
|
676
|
-
public:
|
677
|
-
typedef typename Function<F>::Result Result;
|
678
|
-
typedef typename Function<F>::ArgumentTuple ArgumentTuple;
|
679
|
-
|
680
|
-
explicit Impl(T& ref) : ref_(ref) {} // NOLINT
|
681
|
-
|
682
|
-
virtual Result Perform(const ArgumentTuple&) {
|
683
|
-
return ref_;
|
684
|
-
}
|
685
|
-
|
686
|
-
private:
|
687
|
-
T& ref_;
|
688
|
-
|
689
|
-
GTEST_DISALLOW_ASSIGN_(Impl);
|
690
|
-
};
|
691
|
-
|
692
|
-
T& ref_;
|
693
|
-
|
694
|
-
GTEST_DISALLOW_ASSIGN_(ReturnRefAction);
|
695
|
-
};
|
696
|
-
|
697
|
-
// Implements the polymorphic ReturnRefOfCopy(x) action, which can be
|
698
|
-
// used in any function that returns a reference to the type of x,
|
699
|
-
// regardless of the argument types.
|
700
|
-
template <typename T>
|
701
|
-
class ReturnRefOfCopyAction {
|
702
|
-
public:
|
703
|
-
// Constructs a ReturnRefOfCopyAction object from the reference to
|
704
|
-
// be returned.
|
705
|
-
explicit ReturnRefOfCopyAction(const T& value) : value_(value) {} // NOLINT
|
706
|
-
|
707
|
-
// This template type conversion operator allows ReturnRefOfCopy(x) to be
|
708
|
-
// used in ANY function that returns a reference to x's type.
|
709
|
-
template <typename F>
|
710
|
-
operator Action<F>() const {
|
711
|
-
typedef typename Function<F>::Result Result;
|
712
|
-
// Asserts that the function return type is a reference. This
|
713
|
-
// catches the user error of using ReturnRefOfCopy(x) when Return(x)
|
714
|
-
// should be used, and generates some helpful error message.
|
715
|
-
GTEST_COMPILE_ASSERT_(
|
716
|
-
internal::is_reference<Result>::value,
|
717
|
-
use_Return_instead_of_ReturnRefOfCopy_to_return_a_value);
|
718
|
-
return Action<F>(new Impl<F>(value_));
|
719
|
-
}
|
720
|
-
|
721
|
-
private:
|
722
|
-
// Implements the ReturnRefOfCopy(x) action for a particular function type F.
|
723
|
-
template <typename F>
|
724
|
-
class Impl : public ActionInterface<F> {
|
725
|
-
public:
|
726
|
-
typedef typename Function<F>::Result Result;
|
727
|
-
typedef typename Function<F>::ArgumentTuple ArgumentTuple;
|
728
|
-
|
729
|
-
explicit Impl(const T& value) : value_(value) {} // NOLINT
|
730
|
-
|
731
|
-
virtual Result Perform(const ArgumentTuple&) {
|
732
|
-
return value_;
|
733
|
-
}
|
734
|
-
|
735
|
-
private:
|
736
|
-
T value_;
|
737
|
-
|
738
|
-
GTEST_DISALLOW_ASSIGN_(Impl);
|
739
|
-
};
|
740
|
-
|
741
|
-
const T value_;
|
742
|
-
|
743
|
-
GTEST_DISALLOW_ASSIGN_(ReturnRefOfCopyAction);
|
744
|
-
};
|
745
|
-
|
746
|
-
// Implements the polymorphic DoDefault() action.
|
747
|
-
class DoDefaultAction {
|
748
|
-
public:
|
749
|
-
// This template type conversion operator allows DoDefault() to be
|
750
|
-
// used in any function.
|
751
|
-
template <typename F>
|
752
|
-
operator Action<F>() const { return Action<F>(NULL); }
|
753
|
-
};
|
754
|
-
|
755
|
-
// Implements the Assign action to set a given pointer referent to a
|
756
|
-
// particular value.
|
757
|
-
template <typename T1, typename T2>
|
758
|
-
class AssignAction {
|
759
|
-
public:
|
760
|
-
AssignAction(T1* ptr, T2 value) : ptr_(ptr), value_(value) {}
|
761
|
-
|
762
|
-
template <typename Result, typename ArgumentTuple>
|
763
|
-
void Perform(const ArgumentTuple& /* args */) const {
|
764
|
-
*ptr_ = value_;
|
765
|
-
}
|
766
|
-
|
767
|
-
private:
|
768
|
-
T1* const ptr_;
|
769
|
-
const T2 value_;
|
770
|
-
|
771
|
-
GTEST_DISALLOW_ASSIGN_(AssignAction);
|
772
|
-
};
|
773
|
-
|
774
|
-
#if !GTEST_OS_WINDOWS_MOBILE
|
775
|
-
|
776
|
-
// Implements the SetErrnoAndReturn action to simulate return from
|
777
|
-
// various system calls and libc functions.
|
778
|
-
template <typename T>
|
779
|
-
class SetErrnoAndReturnAction {
|
780
|
-
public:
|
781
|
-
SetErrnoAndReturnAction(int errno_value, T result)
|
782
|
-
: errno_(errno_value),
|
783
|
-
result_(result) {}
|
784
|
-
template <typename Result, typename ArgumentTuple>
|
785
|
-
Result Perform(const ArgumentTuple& /* args */) const {
|
786
|
-
errno = errno_;
|
787
|
-
return result_;
|
788
|
-
}
|
789
|
-
|
790
|
-
private:
|
791
|
-
const int errno_;
|
792
|
-
const T result_;
|
793
|
-
|
794
|
-
GTEST_DISALLOW_ASSIGN_(SetErrnoAndReturnAction);
|
795
|
-
};
|
796
|
-
|
797
|
-
#endif // !GTEST_OS_WINDOWS_MOBILE
|
798
|
-
|
799
|
-
// Implements the SetArgumentPointee<N>(x) action for any function
|
800
|
-
// whose N-th argument (0-based) is a pointer to x's type. The
|
801
|
-
// template parameter kIsProto is true iff type A is ProtocolMessage,
|
802
|
-
// proto2::Message, or a sub-class of those.
|
803
|
-
template <size_t N, typename A, bool kIsProto>
|
804
|
-
class SetArgumentPointeeAction {
|
805
|
-
public:
|
806
|
-
// Constructs an action that sets the variable pointed to by the
|
807
|
-
// N-th function argument to 'value'.
|
808
|
-
explicit SetArgumentPointeeAction(const A& value) : value_(value) {}
|
809
|
-
|
810
|
-
template <typename Result, typename ArgumentTuple>
|
811
|
-
void Perform(const ArgumentTuple& args) const {
|
812
|
-
CompileAssertTypesEqual<void, Result>();
|
813
|
-
*::testing::get<N>(args) = value_;
|
814
|
-
}
|
815
|
-
|
816
|
-
private:
|
817
|
-
const A value_;
|
818
|
-
|
819
|
-
GTEST_DISALLOW_ASSIGN_(SetArgumentPointeeAction);
|
820
|
-
};
|
821
|
-
|
822
|
-
template <size_t N, typename Proto>
|
823
|
-
class SetArgumentPointeeAction<N, Proto, true> {
|
824
|
-
public:
|
825
|
-
// Constructs an action that sets the variable pointed to by the
|
826
|
-
// N-th function argument to 'proto'. Both ProtocolMessage and
|
827
|
-
// proto2::Message have the CopyFrom() method, so the same
|
828
|
-
// implementation works for both.
|
829
|
-
explicit SetArgumentPointeeAction(const Proto& proto) : proto_(new Proto) {
|
830
|
-
proto_->CopyFrom(proto);
|
831
|
-
}
|
832
|
-
|
833
|
-
template <typename Result, typename ArgumentTuple>
|
834
|
-
void Perform(const ArgumentTuple& args) const {
|
835
|
-
CompileAssertTypesEqual<void, Result>();
|
836
|
-
::testing::get<N>(args)->CopyFrom(*proto_);
|
837
|
-
}
|
838
|
-
|
839
|
-
private:
|
840
|
-
const internal::linked_ptr<Proto> proto_;
|
841
|
-
|
842
|
-
GTEST_DISALLOW_ASSIGN_(SetArgumentPointeeAction);
|
843
|
-
};
|
844
|
-
|
845
|
-
// Implements the InvokeWithoutArgs(f) action. The template argument
|
846
|
-
// FunctionImpl is the implementation type of f, which can be either a
|
847
|
-
// function pointer or a functor. InvokeWithoutArgs(f) can be used as an
|
848
|
-
// Action<F> as long as f's type is compatible with F (i.e. f can be
|
849
|
-
// assigned to a tr1::function<F>).
|
850
|
-
template <typename FunctionImpl>
|
851
|
-
class InvokeWithoutArgsAction {
|
852
|
-
public:
|
853
|
-
// The c'tor makes a copy of function_impl (either a function
|
854
|
-
// pointer or a functor).
|
855
|
-
explicit InvokeWithoutArgsAction(FunctionImpl function_impl)
|
856
|
-
: function_impl_(function_impl) {}
|
857
|
-
|
858
|
-
// Allows InvokeWithoutArgs(f) to be used as any action whose type is
|
859
|
-
// compatible with f.
|
860
|
-
template <typename Result, typename ArgumentTuple>
|
861
|
-
Result Perform(const ArgumentTuple&) { return function_impl_(); }
|
862
|
-
|
863
|
-
private:
|
864
|
-
FunctionImpl function_impl_;
|
865
|
-
|
866
|
-
GTEST_DISALLOW_ASSIGN_(InvokeWithoutArgsAction);
|
867
|
-
};
|
868
|
-
|
869
|
-
// Implements the InvokeWithoutArgs(object_ptr, &Class::Method) action.
|
870
|
-
template <class Class, typename MethodPtr>
|
871
|
-
class InvokeMethodWithoutArgsAction {
|
872
|
-
public:
|
873
|
-
InvokeMethodWithoutArgsAction(Class* obj_ptr, MethodPtr method_ptr)
|
874
|
-
: obj_ptr_(obj_ptr), method_ptr_(method_ptr) {}
|
875
|
-
|
876
|
-
template <typename Result, typename ArgumentTuple>
|
877
|
-
Result Perform(const ArgumentTuple&) const {
|
878
|
-
return (obj_ptr_->*method_ptr_)();
|
879
|
-
}
|
880
|
-
|
881
|
-
private:
|
882
|
-
Class* const obj_ptr_;
|
883
|
-
const MethodPtr method_ptr_;
|
884
|
-
|
885
|
-
GTEST_DISALLOW_ASSIGN_(InvokeMethodWithoutArgsAction);
|
886
|
-
};
|
887
|
-
|
888
|
-
// Implements the IgnoreResult(action) action.
|
889
|
-
template <typename A>
|
890
|
-
class IgnoreResultAction {
|
891
|
-
public:
|
892
|
-
explicit IgnoreResultAction(const A& action) : action_(action) {}
|
893
|
-
|
894
|
-
template <typename F>
|
895
|
-
operator Action<F>() const {
|
896
|
-
// Assert statement belongs here because this is the best place to verify
|
897
|
-
// conditions on F. It produces the clearest error messages
|
898
|
-
// in most compilers.
|
899
|
-
// Impl really belongs in this scope as a local class but can't
|
900
|
-
// because MSVC produces duplicate symbols in different translation units
|
901
|
-
// in this case. Until MS fixes that bug we put Impl into the class scope
|
902
|
-
// and put the typedef both here (for use in assert statement) and
|
903
|
-
// in the Impl class. But both definitions must be the same.
|
904
|
-
typedef typename internal::Function<F>::Result Result;
|
905
|
-
|
906
|
-
// Asserts at compile time that F returns void.
|
907
|
-
CompileAssertTypesEqual<void, Result>();
|
908
|
-
|
909
|
-
return Action<F>(new Impl<F>(action_));
|
910
|
-
}
|
911
|
-
|
912
|
-
private:
|
913
|
-
template <typename F>
|
914
|
-
class Impl : public ActionInterface<F> {
|
915
|
-
public:
|
916
|
-
typedef typename internal::Function<F>::Result Result;
|
917
|
-
typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
|
918
|
-
|
919
|
-
explicit Impl(const A& action) : action_(action) {}
|
920
|
-
|
921
|
-
virtual void Perform(const ArgumentTuple& args) {
|
922
|
-
// Performs the action and ignores its result.
|
923
|
-
action_.Perform(args);
|
924
|
-
}
|
925
|
-
|
926
|
-
private:
|
927
|
-
// Type OriginalFunction is the same as F except that its return
|
928
|
-
// type is IgnoredValue.
|
929
|
-
typedef typename internal::Function<F>::MakeResultIgnoredValue
|
930
|
-
OriginalFunction;
|
931
|
-
|
932
|
-
const Action<OriginalFunction> action_;
|
933
|
-
|
934
|
-
GTEST_DISALLOW_ASSIGN_(Impl);
|
935
|
-
};
|
936
|
-
|
937
|
-
const A action_;
|
938
|
-
|
939
|
-
GTEST_DISALLOW_ASSIGN_(IgnoreResultAction);
|
940
|
-
};
|
941
|
-
|
942
|
-
// A ReferenceWrapper<T> object represents a reference to type T,
|
943
|
-
// which can be either const or not. It can be explicitly converted
|
944
|
-
// from, and implicitly converted to, a T&. Unlike a reference,
|
945
|
-
// ReferenceWrapper<T> can be copied and can survive template type
|
946
|
-
// inference. This is used to support by-reference arguments in the
|
947
|
-
// InvokeArgument<N>(...) action. The idea was from "reference
|
948
|
-
// wrappers" in tr1, which we don't have in our source tree yet.
|
949
|
-
template <typename T>
|
950
|
-
class ReferenceWrapper {
|
951
|
-
public:
|
952
|
-
// Constructs a ReferenceWrapper<T> object from a T&.
|
953
|
-
explicit ReferenceWrapper(T& l_value) : pointer_(&l_value) {} // NOLINT
|
954
|
-
|
955
|
-
// Allows a ReferenceWrapper<T> object to be implicitly converted to
|
956
|
-
// a T&.
|
957
|
-
operator T&() const { return *pointer_; }
|
958
|
-
private:
|
959
|
-
T* pointer_;
|
960
|
-
};
|
961
|
-
|
962
|
-
// Allows the expression ByRef(x) to be printed as a reference to x.
|
963
|
-
template <typename T>
|
964
|
-
void PrintTo(const ReferenceWrapper<T>& ref, ::std::ostream* os) {
|
965
|
-
T& value = ref;
|
966
|
-
UniversalPrinter<T&>::Print(value, os);
|
967
|
-
}
|
968
|
-
|
969
|
-
// Does two actions sequentially. Used for implementing the DoAll(a1,
|
970
|
-
// a2, ...) action.
|
971
|
-
template <typename Action1, typename Action2>
|
972
|
-
class DoBothAction {
|
973
|
-
public:
|
974
|
-
DoBothAction(Action1 action1, Action2 action2)
|
975
|
-
: action1_(action1), action2_(action2) {}
|
976
|
-
|
977
|
-
// This template type conversion operator allows DoAll(a1, ..., a_n)
|
978
|
-
// to be used in ANY function of compatible type.
|
979
|
-
template <typename F>
|
980
|
-
operator Action<F>() const {
|
981
|
-
return Action<F>(new Impl<F>(action1_, action2_));
|
982
|
-
}
|
983
|
-
|
984
|
-
private:
|
985
|
-
// Implements the DoAll(...) action for a particular function type F.
|
986
|
-
template <typename F>
|
987
|
-
class Impl : public ActionInterface<F> {
|
988
|
-
public:
|
989
|
-
typedef typename Function<F>::Result Result;
|
990
|
-
typedef typename Function<F>::ArgumentTuple ArgumentTuple;
|
991
|
-
typedef typename Function<F>::MakeResultVoid VoidResult;
|
992
|
-
|
993
|
-
Impl(const Action<VoidResult>& action1, const Action<F>& action2)
|
994
|
-
: action1_(action1), action2_(action2) {}
|
995
|
-
|
996
|
-
virtual Result Perform(const ArgumentTuple& args) {
|
997
|
-
action1_.Perform(args);
|
998
|
-
return action2_.Perform(args);
|
999
|
-
}
|
1000
|
-
|
1001
|
-
private:
|
1002
|
-
const Action<VoidResult> action1_;
|
1003
|
-
const Action<F> action2_;
|
1004
|
-
|
1005
|
-
GTEST_DISALLOW_ASSIGN_(Impl);
|
1006
|
-
};
|
1007
|
-
|
1008
|
-
Action1 action1_;
|
1009
|
-
Action2 action2_;
|
1010
|
-
|
1011
|
-
GTEST_DISALLOW_ASSIGN_(DoBothAction);
|
1012
|
-
};
|
1013
|
-
|
1014
|
-
} // namespace internal
|
1015
|
-
|
1016
|
-
// An Unused object can be implicitly constructed from ANY value.
|
1017
|
-
// This is handy when defining actions that ignore some or all of the
|
1018
|
-
// mock function arguments. For example, given
|
1019
|
-
//
|
1020
|
-
// MOCK_METHOD3(Foo, double(const string& label, double x, double y));
|
1021
|
-
// MOCK_METHOD3(Bar, double(int index, double x, double y));
|
1022
|
-
//
|
1023
|
-
// instead of
|
1024
|
-
//
|
1025
|
-
// double DistanceToOriginWithLabel(const string& label, double x, double y) {
|
1026
|
-
// return sqrt(x*x + y*y);
|
1027
|
-
// }
|
1028
|
-
// double DistanceToOriginWithIndex(int index, double x, double y) {
|
1029
|
-
// return sqrt(x*x + y*y);
|
1030
|
-
// }
|
1031
|
-
// ...
|
1032
|
-
// EXEPCT_CALL(mock, Foo("abc", _, _))
|
1033
|
-
// .WillOnce(Invoke(DistanceToOriginWithLabel));
|
1034
|
-
// EXEPCT_CALL(mock, Bar(5, _, _))
|
1035
|
-
// .WillOnce(Invoke(DistanceToOriginWithIndex));
|
1036
|
-
//
|
1037
|
-
// you could write
|
1038
|
-
//
|
1039
|
-
// // We can declare any uninteresting argument as Unused.
|
1040
|
-
// double DistanceToOrigin(Unused, double x, double y) {
|
1041
|
-
// return sqrt(x*x + y*y);
|
1042
|
-
// }
|
1043
|
-
// ...
|
1044
|
-
// EXEPCT_CALL(mock, Foo("abc", _, _)).WillOnce(Invoke(DistanceToOrigin));
|
1045
|
-
// EXEPCT_CALL(mock, Bar(5, _, _)).WillOnce(Invoke(DistanceToOrigin));
|
1046
|
-
typedef internal::IgnoredValue Unused;
|
1047
|
-
|
1048
|
-
// This constructor allows us to turn an Action<From> object into an
|
1049
|
-
// Action<To>, as long as To's arguments can be implicitly converted
|
1050
|
-
// to From's and From's return type cann be implicitly converted to
|
1051
|
-
// To's.
|
1052
|
-
template <typename To>
|
1053
|
-
template <typename From>
|
1054
|
-
Action<To>::Action(const Action<From>& from)
|
1055
|
-
: impl_(new internal::ActionAdaptor<To, From>(from)) {}
|
1056
|
-
|
1057
|
-
// Creates an action that returns 'value'. 'value' is passed by value
|
1058
|
-
// instead of const reference - otherwise Return("string literal")
|
1059
|
-
// will trigger a compiler error about using array as initializer.
|
1060
|
-
template <typename R>
|
1061
|
-
internal::ReturnAction<R> Return(R value) {
|
1062
|
-
return internal::ReturnAction<R>(internal::move(value));
|
1063
|
-
}
|
1064
|
-
|
1065
|
-
// Creates an action that returns NULL.
|
1066
|
-
inline PolymorphicAction<internal::ReturnNullAction> ReturnNull() {
|
1067
|
-
return MakePolymorphicAction(internal::ReturnNullAction());
|
1068
|
-
}
|
1069
|
-
|
1070
|
-
// Creates an action that returns from a void function.
|
1071
|
-
inline PolymorphicAction<internal::ReturnVoidAction> Return() {
|
1072
|
-
return MakePolymorphicAction(internal::ReturnVoidAction());
|
1073
|
-
}
|
1074
|
-
|
1075
|
-
// Creates an action that returns the reference to a variable.
|
1076
|
-
template <typename R>
|
1077
|
-
inline internal::ReturnRefAction<R> ReturnRef(R& x) { // NOLINT
|
1078
|
-
return internal::ReturnRefAction<R>(x);
|
1079
|
-
}
|
1080
|
-
|
1081
|
-
// Creates an action that returns the reference to a copy of the
|
1082
|
-
// argument. The copy is created when the action is constructed and
|
1083
|
-
// lives as long as the action.
|
1084
|
-
template <typename R>
|
1085
|
-
inline internal::ReturnRefOfCopyAction<R> ReturnRefOfCopy(const R& x) {
|
1086
|
-
return internal::ReturnRefOfCopyAction<R>(x);
|
1087
|
-
}
|
1088
|
-
|
1089
|
-
// Modifies the parent action (a Return() action) to perform a move of the
|
1090
|
-
// argument instead of a copy.
|
1091
|
-
// Return(ByMove()) actions can only be executed once and will assert this
|
1092
|
-
// invariant.
|
1093
|
-
template <typename R>
|
1094
|
-
internal::ByMoveWrapper<R> ByMove(R x) {
|
1095
|
-
return internal::ByMoveWrapper<R>(internal::move(x));
|
1096
|
-
}
|
1097
|
-
|
1098
|
-
// Creates an action that does the default action for the give mock function.
|
1099
|
-
inline internal::DoDefaultAction DoDefault() {
|
1100
|
-
return internal::DoDefaultAction();
|
1101
|
-
}
|
1102
|
-
|
1103
|
-
// Creates an action that sets the variable pointed by the N-th
|
1104
|
-
// (0-based) function argument to 'value'.
|
1105
|
-
template <size_t N, typename T>
|
1106
|
-
PolymorphicAction<
|
1107
|
-
internal::SetArgumentPointeeAction<
|
1108
|
-
N, T, internal::IsAProtocolMessage<T>::value> >
|
1109
|
-
SetArgPointee(const T& x) {
|
1110
|
-
return MakePolymorphicAction(internal::SetArgumentPointeeAction<
|
1111
|
-
N, T, internal::IsAProtocolMessage<T>::value>(x));
|
1112
|
-
}
|
1113
|
-
|
1114
|
-
#if !((GTEST_GCC_VER_ && GTEST_GCC_VER_ < 40000) || GTEST_OS_SYMBIAN)
|
1115
|
-
// This overload allows SetArgPointee() to accept a string literal.
|
1116
|
-
// GCC prior to the version 4.0 and Symbian C++ compiler cannot distinguish
|
1117
|
-
// this overload from the templated version and emit a compile error.
|
1118
|
-
template <size_t N>
|
1119
|
-
PolymorphicAction<
|
1120
|
-
internal::SetArgumentPointeeAction<N, const char*, false> >
|
1121
|
-
SetArgPointee(const char* p) {
|
1122
|
-
return MakePolymorphicAction(internal::SetArgumentPointeeAction<
|
1123
|
-
N, const char*, false>(p));
|
1124
|
-
}
|
1125
|
-
|
1126
|
-
template <size_t N>
|
1127
|
-
PolymorphicAction<
|
1128
|
-
internal::SetArgumentPointeeAction<N, const wchar_t*, false> >
|
1129
|
-
SetArgPointee(const wchar_t* p) {
|
1130
|
-
return MakePolymorphicAction(internal::SetArgumentPointeeAction<
|
1131
|
-
N, const wchar_t*, false>(p));
|
1132
|
-
}
|
1133
|
-
#endif
|
1134
|
-
|
1135
|
-
// The following version is DEPRECATED.
|
1136
|
-
template <size_t N, typename T>
|
1137
|
-
PolymorphicAction<
|
1138
|
-
internal::SetArgumentPointeeAction<
|
1139
|
-
N, T, internal::IsAProtocolMessage<T>::value> >
|
1140
|
-
SetArgumentPointee(const T& x) {
|
1141
|
-
return MakePolymorphicAction(internal::SetArgumentPointeeAction<
|
1142
|
-
N, T, internal::IsAProtocolMessage<T>::value>(x));
|
1143
|
-
}
|
1144
|
-
|
1145
|
-
// Creates an action that sets a pointer referent to a given value.
|
1146
|
-
template <typename T1, typename T2>
|
1147
|
-
PolymorphicAction<internal::AssignAction<T1, T2> > Assign(T1* ptr, T2 val) {
|
1148
|
-
return MakePolymorphicAction(internal::AssignAction<T1, T2>(ptr, val));
|
1149
|
-
}
|
1150
|
-
|
1151
|
-
#if !GTEST_OS_WINDOWS_MOBILE
|
1152
|
-
|
1153
|
-
// Creates an action that sets errno and returns the appropriate error.
|
1154
|
-
template <typename T>
|
1155
|
-
PolymorphicAction<internal::SetErrnoAndReturnAction<T> >
|
1156
|
-
SetErrnoAndReturn(int errval, T result) {
|
1157
|
-
return MakePolymorphicAction(
|
1158
|
-
internal::SetErrnoAndReturnAction<T>(errval, result));
|
1159
|
-
}
|
1160
|
-
|
1161
|
-
#endif // !GTEST_OS_WINDOWS_MOBILE
|
1162
|
-
|
1163
|
-
// Various overloads for InvokeWithoutArgs().
|
1164
|
-
|
1165
|
-
// Creates an action that invokes 'function_impl' with no argument.
|
1166
|
-
template <typename FunctionImpl>
|
1167
|
-
PolymorphicAction<internal::InvokeWithoutArgsAction<FunctionImpl> >
|
1168
|
-
InvokeWithoutArgs(FunctionImpl function_impl) {
|
1169
|
-
return MakePolymorphicAction(
|
1170
|
-
internal::InvokeWithoutArgsAction<FunctionImpl>(function_impl));
|
1171
|
-
}
|
1172
|
-
|
1173
|
-
// Creates an action that invokes the given method on the given object
|
1174
|
-
// with no argument.
|
1175
|
-
template <class Class, typename MethodPtr>
|
1176
|
-
PolymorphicAction<internal::InvokeMethodWithoutArgsAction<Class, MethodPtr> >
|
1177
|
-
InvokeWithoutArgs(Class* obj_ptr, MethodPtr method_ptr) {
|
1178
|
-
return MakePolymorphicAction(
|
1179
|
-
internal::InvokeMethodWithoutArgsAction<Class, MethodPtr>(
|
1180
|
-
obj_ptr, method_ptr));
|
1181
|
-
}
|
1182
|
-
|
1183
|
-
// Creates an action that performs an_action and throws away its
|
1184
|
-
// result. In other words, it changes the return type of an_action to
|
1185
|
-
// void. an_action MUST NOT return void, or the code won't compile.
|
1186
|
-
template <typename A>
|
1187
|
-
inline internal::IgnoreResultAction<A> IgnoreResult(const A& an_action) {
|
1188
|
-
return internal::IgnoreResultAction<A>(an_action);
|
1189
|
-
}
|
1190
|
-
|
1191
|
-
// Creates a reference wrapper for the given L-value. If necessary,
|
1192
|
-
// you can explicitly specify the type of the reference. For example,
|
1193
|
-
// suppose 'derived' is an object of type Derived, ByRef(derived)
|
1194
|
-
// would wrap a Derived&. If you want to wrap a const Base& instead,
|
1195
|
-
// where Base is a base class of Derived, just write:
|
1196
|
-
//
|
1197
|
-
// ByRef<const Base>(derived)
|
1198
|
-
template <typename T>
|
1199
|
-
inline internal::ReferenceWrapper<T> ByRef(T& l_value) { // NOLINT
|
1200
|
-
return internal::ReferenceWrapper<T>(l_value);
|
1201
|
-
}
|
1202
|
-
|
1203
|
-
} // namespace testing
|
1204
|
-
|
1205
|
-
#endif // GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
|