rj_schema 0.2.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rj_schema/rapidjson/CMakeLists.txt +9 -4
- data/ext/rj_schema/rapidjson/RapidJSONConfig.cmake.in +10 -0
- data/ext/rj_schema/rapidjson/appveyor.yml +22 -9
- data/ext/rj_schema/rapidjson/bin/data/abcde.txt +1 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/address.json +139 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/allOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/anyOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/oneOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/contrib/natvis/rapidjson.natvis +2 -2
- data/ext/rj_schema/rapidjson/doc/dom.md +1 -0
- data/ext/rj_schema/rapidjson/doc/dom.zh-cn.md +1 -0
- data/ext/rj_schema/rapidjson/doc/faq.md +3 -3
- data/ext/rj_schema/rapidjson/doc/faq.zh-cn.md +8 -8
- data/ext/rj_schema/rapidjson/doc/internals.md +1 -1
- data/ext/rj_schema/rapidjson/doc/internals.zh-cn.md +2 -2
- data/ext/rj_schema/rapidjson/doc/pointer.zh-cn.md +1 -1
- data/ext/rj_schema/rapidjson/doc/sax.md +1 -1
- data/ext/rj_schema/rapidjson/doc/sax.zh-cn.md +2 -2
- data/ext/rj_schema/rapidjson/doc/stream.md +1 -1
- data/ext/rj_schema/rapidjson/doc/tutorial.md +1 -1
- data/ext/rj_schema/rapidjson/doc/tutorial.zh-cn.md +7 -6
- data/ext/rj_schema/rapidjson/example/CMakeLists.txt +1 -0
- data/ext/rj_schema/rapidjson/example/schemavalidator/schemavalidator.cpp +118 -0
- data/ext/rj_schema/rapidjson/example/sortkeys/sortkeys.cpp +62 -0
- data/ext/rj_schema/rapidjson/example/tutorial/tutorial.cpp +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +6 -6
- data/ext/rj_schema/rapidjson/include/rapidjson/cursorstreamwrapper.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/document.h +124 -35
- data/ext/rj_schema/rapidjson/include/rapidjson/encodedstream.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/encodings.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/error/en.h +49 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/error/error.h +56 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/filereadstream.h +2 -2
- data/ext/rj_schema/rapidjson/include/rapidjson/filewritestream.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/fwd.h +2 -2
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/biginteger.h +2 -2
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/clzll.h +71 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/diyfp.h +3 -17
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/dtoa.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/ieee754.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/itoa.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/meta.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/pow10.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/regex.h +20 -13
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/stack.h +4 -3
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strfunc.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strtod.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/swap.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/istreamwrapper.h +50 -35
- data/ext/rj_schema/rapidjson/include/rapidjson/memorybuffer.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/memorystream.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/ostreamwrapper.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/pointer.h +63 -5
- data/ext/rj_schema/rapidjson/include/rapidjson/prettywriter.h +2 -2
- data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +63 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/reader.h +67 -53
- data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +318 -164
- data/ext/rj_schema/rapidjson/include/rapidjson/stream.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/stringbuffer.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/writer.h +10 -10
- data/ext/rj_schema/rapidjson/readme.md +51 -1
- data/ext/rj_schema/rapidjson/readme.zh-cn.md +2 -2
- data/ext/rj_schema/rapidjson/test/perftest/misctest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/perftest/perftest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/perftest/perftest.h +1 -1
- data/ext/rj_schema/rapidjson/test/perftest/platformtest.cpp +2 -2
- data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +75 -1
- data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +1 -0
- data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/bigintegertest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/clzlltest.cpp +34 -0
- data/ext/rj_schema/rapidjson/test/unittest/cursorstreamwrappertest.cpp +19 -19
- data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/dtoatest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/encodedstreamtest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/encodingstest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/filestreamtest.cpp +45 -2
- data/ext/rj_schema/rapidjson/test/unittest/fwdtest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/istreamwrappertest.cpp +10 -10
- data/ext/rj_schema/rapidjson/test/unittest/itoatest.cpp +8 -8
- data/ext/rj_schema/rapidjson/test/unittest/jsoncheckertest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/namespacetest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/ostreamwrappertest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/pointertest.cpp +157 -16
- data/ext/rj_schema/rapidjson/test/unittest/prettywritertest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/readertest.cpp +113 -75
- data/ext/rj_schema/rapidjson/test/unittest/regextest.cpp +2 -1
- data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +593 -78
- data/ext/rj_schema/rapidjson/test/unittest/simdtest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/strfunctest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/stringbuffertest.cpp +5 -5
- data/ext/rj_schema/rapidjson/test/unittest/strtodtest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/unittest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/unittest.h +4 -1
- data/ext/rj_schema/rapidjson/test/unittest/valuetest.cpp +12 -12
- data/ext/rj_schema/rapidjson/test/unittest/writertest.cpp +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/BUILD.bazel +175 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/CMakeLists.txt +18 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/CONTRIBUTING.md +160 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/Makefile.am +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/README.md +16 -35
- data/ext/rj_schema/rapidjson/thirdparty/gtest/WORKSPACE +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/appveyor.yml +104 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-autotools.sh +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-bazel.sh +36 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-linux.sh +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-osx.sh +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/get-nprocessors.sh +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-linux.sh +49 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-osx.sh +39 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/log-config.sh +51 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/travis.sh +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/configure.ac +16 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CHANGES +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +72 -32
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/README.md +53 -42
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock_main.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/configure.ac +4 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +6 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +117 -132
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +7 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +20 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +1 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +83 -26
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +262 -68
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +45 -6
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +650 -366
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +76 -20
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +308 -229
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +18 -15
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +87 -26
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +33 -16
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +1209 -353
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +33 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +159 -88
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +2 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +3 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +16 -9
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +71 -8
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +7 -11
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +69 -6
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +2 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +69 -6
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +83 -8
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +63 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +63 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +76 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +4 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +3 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +36 -6
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +210 -135
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +108 -48
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +23 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/BUILD.bazel +123 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +166 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +64 -62
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +43 -18
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +11 -9
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +91 -36
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +33 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +1286 -167
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +85 -83
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +102 -15
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +136 -9
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +24 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +8 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +20 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +8 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +3 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +44 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +5 -7
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +40 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/Makefile.am +60 -31
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/README.md +232 -171
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest_main.pc.in +10 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +54 -16
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/configure.ac +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Pkgconfig.md +146 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +2 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +6 -6
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/{AdvancedGuide.md → advanced.md} +260 -26
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/{FAQ.md → faq.md} +62 -57
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/{Primer.md → primer.md} +43 -9
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/{Samples.md → samples.md} +0 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +53 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +1 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +30 -36
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +8 -17
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +140 -51
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +2 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +4 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +126 -30
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +6 -7
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +8 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +6 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +4 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +13 -57
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +1 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +98 -59
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +34 -41
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +3 -10
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +9 -17
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +8 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +232 -99
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +3 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +17 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +17 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.sln +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj +149 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.sln +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj +149 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj +154 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj +162 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj +199 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj.filters +26 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj +191 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj.filters +26 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj +188 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj +180 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +6 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +0 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +2 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +2 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +7 -6
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +5 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +3 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +2 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +10 -22
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +2 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +0 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +10 -10
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +226 -32
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +5 -7
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +21 -29
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +85 -67
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +93 -8
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +1 -9
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +1 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +622 -164
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/BUILD.bazel +396 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +12 -15
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +2 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +6 -8
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +1 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +84 -29
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +1 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +11 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +165 -63
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +13 -13
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_assert_by_exception_test.cc +119 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +1 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +1 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +0 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +1 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +0 -8
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +6 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +0 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +0 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +20 -18
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +0 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_outfiles_test.py +162 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_output_unittest.py +611 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_test_utils.py +60 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +4 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +2 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +11 -7
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +17 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +104 -66
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +2 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +2 -19
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +0 -6
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +12 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test.py +65 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test_.cc +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +4 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +2 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +240 -149
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +0 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +0 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +15 -7
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +100 -30
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +0 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +25 -23
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.h +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +4 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +47 -0
- data/ext/rj_schema/rapidjson/travis-doxygen.sh +13 -6
- data/ext/rj_schema/rj_schema.cpp +161 -17
- data/lib/rj_schema.rb +1 -1
- metadata +63 -58
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DevGuide.md +0 -132
- 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/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/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/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/travis.sh +0 -15
@@ -391,7 +391,7 @@ TEST(ExactlyTest, HasCorrectBounds) {
|
|
391
391
|
EXPECT_EQ(3, c.ConservativeUpperBound());
|
392
392
|
}
|
393
393
|
|
394
|
-
// Tests that a user can make
|
394
|
+
// Tests that a user can make their own cardinality by implementing
|
395
395
|
// CardinalityInterface and calling MakeCardinality().
|
396
396
|
|
397
397
|
class EvenCardinality : public CardinalityInterface {
|
data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc
CHANGED
@@ -81,12 +81,12 @@ bool Unary(int x) { return x < 0; }
|
|
81
81
|
|
82
82
|
const char* Plus1(const char* s) { return s + 1; }
|
83
83
|
|
84
|
-
bool ByConstRef(const string& s) { return s == "Hi"; }
|
84
|
+
bool ByConstRef(const std::string& s) { return s == "Hi"; }
|
85
85
|
|
86
86
|
const double g_double = 0;
|
87
87
|
bool ReferencesGlobalDouble(const double& x) { return &x == &g_double; }
|
88
88
|
|
89
|
-
string ByNonConstRef(string& s) { return s += "+"; } // NOLINT
|
89
|
+
std::string ByNonConstRef(std::string& s) { return s += "+"; } // NOLINT
|
90
90
|
|
91
91
|
struct UnaryFunctor {
|
92
92
|
int operator()(bool x) { return x ? 1 : -1; }
|
@@ -102,9 +102,9 @@ void VoidTernary(int, char, bool) { g_done = true; }
|
|
102
102
|
|
103
103
|
int SumOf4(int a, int b, int c, int d) { return a + b + c + d; }
|
104
104
|
|
105
|
-
string Concat4(const char* s1, const char* s2, const char* s3,
|
106
|
-
|
107
|
-
return string(s1) + s2 + s3 + s4;
|
105
|
+
std::string Concat4(const char* s1, const char* s2, const char* s3,
|
106
|
+
const char* s4) {
|
107
|
+
return std::string(s1) + s2 + s3 + s4;
|
108
108
|
}
|
109
109
|
|
110
110
|
int SumOf5(int a, int b, int c, int d, int e) { return a + b + c + d + e; }
|
@@ -115,9 +115,9 @@ struct SumOf5Functor {
|
|
115
115
|
}
|
116
116
|
};
|
117
117
|
|
118
|
-
string Concat5(const char* s1, const char* s2, const char* s3,
|
119
|
-
|
120
|
-
return string(s1) + s2 + s3 + s4 + s5;
|
118
|
+
std::string Concat5(const char* s1, const char* s2, const char* s3,
|
119
|
+
const char* s4, const char* s5) {
|
120
|
+
return std::string(s1) + s2 + s3 + s4 + s5;
|
121
121
|
}
|
122
122
|
|
123
123
|
int SumOf6(int a, int b, int c, int d, int e, int f) {
|
@@ -130,34 +130,34 @@ struct SumOf6Functor {
|
|
130
130
|
}
|
131
131
|
};
|
132
132
|
|
133
|
-
string Concat6(const char* s1, const char* s2, const char* s3,
|
134
|
-
|
135
|
-
return string(s1) + s2 + s3 + s4 + s5 + s6;
|
133
|
+
std::string Concat6(const char* s1, const char* s2, const char* s3,
|
134
|
+
const char* s4, const char* s5, const char* s6) {
|
135
|
+
return std::string(s1) + s2 + s3 + s4 + s5 + s6;
|
136
136
|
}
|
137
137
|
|
138
|
-
string Concat7(const char* s1, const char* s2, const char* s3,
|
139
|
-
|
140
|
-
|
141
|
-
return string(s1) + s2 + s3 + s4 + s5 + s6 + s7;
|
138
|
+
std::string Concat7(const char* s1, const char* s2, const char* s3,
|
139
|
+
const char* s4, const char* s5, const char* s6,
|
140
|
+
const char* s7) {
|
141
|
+
return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7;
|
142
142
|
}
|
143
143
|
|
144
|
-
string Concat8(const char* s1, const char* s2, const char* s3,
|
145
|
-
|
146
|
-
|
147
|
-
return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8;
|
144
|
+
std::string Concat8(const char* s1, const char* s2, const char* s3,
|
145
|
+
const char* s4, const char* s5, const char* s6,
|
146
|
+
const char* s7, const char* s8) {
|
147
|
+
return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8;
|
148
148
|
}
|
149
149
|
|
150
|
-
string Concat9(const char* s1, const char* s2, const char* s3,
|
151
|
-
|
152
|
-
|
153
|
-
return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9;
|
150
|
+
std::string Concat9(const char* s1, const char* s2, const char* s3,
|
151
|
+
const char* s4, const char* s5, const char* s6,
|
152
|
+
const char* s7, const char* s8, const char* s9) {
|
153
|
+
return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9;
|
154
154
|
}
|
155
155
|
|
156
|
-
string Concat10(const char* s1, const char* s2, const char* s3,
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
return string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10;
|
156
|
+
std::string Concat10(const char* s1, const char* s2, const char* s3,
|
157
|
+
const char* s4, const char* s5, const char* s6,
|
158
|
+
const char* s7, const char* s8, const char* s9,
|
159
|
+
const char* s10) {
|
160
|
+
return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10;
|
161
161
|
}
|
162
162
|
|
163
163
|
// A helper that turns the type of a C-string literal from const
|
@@ -208,38 +208,37 @@ TEST(InvokeArgumentTest, Functor6) {
|
|
208
208
|
|
209
209
|
// Tests using InvokeArgument with a 7-ary function.
|
210
210
|
TEST(InvokeArgumentTest, Function7) {
|
211
|
-
Action<string(string(*)(const char*, const char*, const char*,
|
212
|
-
|
213
|
-
|
214
|
-
InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7");
|
211
|
+
Action<std::string(std::string(*)(const char*, const char*, const char*,
|
212
|
+
const char*, const char*, const char*,
|
213
|
+
const char*))>
|
214
|
+
a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7");
|
215
215
|
EXPECT_EQ("1234567", a.Perform(make_tuple(&Concat7)));
|
216
216
|
}
|
217
217
|
|
218
218
|
// Tests using InvokeArgument with a 8-ary function.
|
219
219
|
TEST(InvokeArgumentTest, Function8) {
|
220
|
-
Action<string(string(*)(const char*, const char*, const char*,
|
221
|
-
|
222
|
-
|
223
|
-
InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8");
|
220
|
+
Action<std::string(std::string(*)(const char*, const char*, const char*,
|
221
|
+
const char*, const char*, const char*,
|
222
|
+
const char*, const char*))>
|
223
|
+
a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8");
|
224
224
|
EXPECT_EQ("12345678", a.Perform(make_tuple(&Concat8)));
|
225
225
|
}
|
226
226
|
|
227
227
|
// Tests using InvokeArgument with a 9-ary function.
|
228
228
|
TEST(InvokeArgumentTest, Function9) {
|
229
|
-
Action<string(string(*)(const char*, const char*, const char*,
|
230
|
-
|
231
|
-
|
232
|
-
InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8", "9");
|
229
|
+
Action<std::string(std::string(*)(const char*, const char*, const char*,
|
230
|
+
const char*, const char*, const char*,
|
231
|
+
const char*, const char*, const char*))>
|
232
|
+
a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8", "9");
|
233
233
|
EXPECT_EQ("123456789", a.Perform(make_tuple(&Concat9)));
|
234
234
|
}
|
235
235
|
|
236
236
|
// Tests using InvokeArgument with a 10-ary function.
|
237
237
|
TEST(InvokeArgumentTest, Function10) {
|
238
|
-
Action<string(string(*)(
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8", "9", "0");
|
238
|
+
Action<std::string(std::string(*)(
|
239
|
+
const char*, const char*, const char*, const char*, const char*,
|
240
|
+
const char*, const char*, const char*, const char*, const char*))>
|
241
|
+
a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8", "9", "0");
|
243
242
|
EXPECT_EQ("1234567890", a.Perform(make_tuple(&Concat10)));
|
244
243
|
}
|
245
244
|
|
@@ -260,8 +259,8 @@ TEST(InvokeArgumentTest, FunctionWithCStringLiteral) {
|
|
260
259
|
|
261
260
|
// Tests using InvokeArgument with a function that takes a const reference.
|
262
261
|
TEST(InvokeArgumentTest, ByConstReferenceFunction) {
|
263
|
-
Action<bool(bool(*function)(const string& s))> a = // NOLINT
|
264
|
-
InvokeArgument<0>(string("Hi"));
|
262
|
+
Action<bool(bool (*function)(const std::string& s))> a = // NOLINT
|
263
|
+
InvokeArgument<0>(std::string("Hi"));
|
265
264
|
// When action 'a' is constructed, it makes a copy of the temporary
|
266
265
|
// string object passed to it, so it's OK to use 'a' later, when the
|
267
266
|
// temporary object has already died.
|
@@ -305,17 +304,18 @@ TEST(WithArgsTest, ThreeArgs) {
|
|
305
304
|
|
306
305
|
// Tests using WithArgs with an action that takes 4 arguments.
|
307
306
|
TEST(WithArgsTest, FourArgs) {
|
308
|
-
Action<string(const char*, const char*, double, const char*,
|
309
|
-
|
307
|
+
Action<std::string(const char*, const char*, double, const char*,
|
308
|
+
const char*)>
|
309
|
+
a = WithArgs<4, 3, 1, 0>(Invoke(Concat4));
|
310
310
|
EXPECT_EQ("4310", a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), 2.5,
|
311
311
|
CharPtr("3"), CharPtr("4"))));
|
312
312
|
}
|
313
313
|
|
314
314
|
// Tests using WithArgs with an action that takes 5 arguments.
|
315
315
|
TEST(WithArgsTest, FiveArgs) {
|
316
|
-
Action<string(const char*, const char*, const char*,
|
317
|
-
|
318
|
-
WithArgs<4, 3, 2, 1, 0>(Invoke(Concat5));
|
316
|
+
Action<std::string(const char*, const char*, const char*, const char*,
|
317
|
+
const char*)>
|
318
|
+
a = WithArgs<4, 3, 2, 1, 0>(Invoke(Concat5));
|
319
319
|
EXPECT_EQ("43210",
|
320
320
|
a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
|
321
321
|
CharPtr("3"), CharPtr("4"))));
|
@@ -323,7 +323,7 @@ TEST(WithArgsTest, FiveArgs) {
|
|
323
323
|
|
324
324
|
// Tests using WithArgs with an action that takes 6 arguments.
|
325
325
|
TEST(WithArgsTest, SixArgs) {
|
326
|
-
Action<string(const char*, const char*, const char*)> a =
|
326
|
+
Action<std::string(const char*, const char*, const char*)> a =
|
327
327
|
WithArgs<0, 1, 2, 2, 1, 0>(Invoke(Concat6));
|
328
328
|
EXPECT_EQ("012210",
|
329
329
|
a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"))));
|
@@ -331,7 +331,7 @@ TEST(WithArgsTest, SixArgs) {
|
|
331
331
|
|
332
332
|
// Tests using WithArgs with an action that takes 7 arguments.
|
333
333
|
TEST(WithArgsTest, SevenArgs) {
|
334
|
-
Action<string(const char*, const char*, const char*, const char*)> a =
|
334
|
+
Action<std::string(const char*, const char*, const char*, const char*)> a =
|
335
335
|
WithArgs<0, 1, 2, 3, 2, 1, 0>(Invoke(Concat7));
|
336
336
|
EXPECT_EQ("0123210",
|
337
337
|
a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
|
@@ -340,7 +340,7 @@ TEST(WithArgsTest, SevenArgs) {
|
|
340
340
|
|
341
341
|
// Tests using WithArgs with an action that takes 8 arguments.
|
342
342
|
TEST(WithArgsTest, EightArgs) {
|
343
|
-
Action<string(const char*, const char*, const char*, const char*)> a =
|
343
|
+
Action<std::string(const char*, const char*, const char*, const char*)> a =
|
344
344
|
WithArgs<0, 1, 2, 3, 0, 1, 2, 3>(Invoke(Concat8));
|
345
345
|
EXPECT_EQ("01230123",
|
346
346
|
a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
|
@@ -349,7 +349,7 @@ TEST(WithArgsTest, EightArgs) {
|
|
349
349
|
|
350
350
|
// Tests using WithArgs with an action that takes 9 arguments.
|
351
351
|
TEST(WithArgsTest, NineArgs) {
|
352
|
-
Action<string(const char*, const char*, const char*, const char*)> a =
|
352
|
+
Action<std::string(const char*, const char*, const char*, const char*)> a =
|
353
353
|
WithArgs<0, 1, 2, 3, 1, 2, 3, 2, 3>(Invoke(Concat9));
|
354
354
|
EXPECT_EQ("012312323",
|
355
355
|
a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
|
@@ -358,7 +358,7 @@ TEST(WithArgsTest, NineArgs) {
|
|
358
358
|
|
359
359
|
// Tests using WithArgs with an action that takes 10 arguments.
|
360
360
|
TEST(WithArgsTest, TenArgs) {
|
361
|
-
Action<string(const char*, const char*, const char*, const char*)> a =
|
361
|
+
Action<std::string(const char*, const char*, const char*, const char*)> a =
|
362
362
|
WithArgs<0, 1, 2, 3, 2, 1, 0, 1, 2, 3>(Invoke(Concat10));
|
363
363
|
EXPECT_EQ("0123210123",
|
364
364
|
a.Perform(make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
|
@@ -374,10 +374,10 @@ class SubstractAction : public ActionInterface<int(int, int)> { // NOLINT
|
|
374
374
|
};
|
375
375
|
|
376
376
|
TEST(WithArgsTest, NonInvokeAction) {
|
377
|
-
Action<int(const string&, int, int)> a = // NOLINT
|
377
|
+
Action<int(const std::string&, int, int)> a = // NOLINT
|
378
378
|
WithArgs<2, 1>(MakeAction(new SubstractAction));
|
379
|
-
string
|
380
|
-
EXPECT_EQ(8, a.Perform(
|
379
|
+
tuple<std::string, int, int> dummy = make_tuple(std::string("hi"), 2, 10);
|
380
|
+
EXPECT_EQ(8, a.Perform(dummy));
|
381
381
|
}
|
382
382
|
|
383
383
|
// Tests using WithArgs to pass all original arguments in the original order.
|
@@ -754,7 +754,8 @@ TEST(ActionPMacroTest, CanReferenceArgumentAndParameterTypes) {
|
|
754
754
|
TEST(ActionPMacroTest, WorksInCompatibleMockFunction) {
|
755
755
|
Action<std::string(const std::string& s)> a1 = Plus("tail");
|
756
756
|
const std::string re = "re";
|
757
|
-
|
757
|
+
tuple<const std::string> dummy = make_tuple(re);
|
758
|
+
EXPECT_EQ("retail", a1.Perform(dummy));
|
758
759
|
}
|
759
760
|
|
760
761
|
// Tests that we can use ACTION*() to define actions overloaded on the
|
@@ -796,7 +797,8 @@ TEST(ActionPnMacroTest, WorksFor3Parameters) {
|
|
796
797
|
|
797
798
|
Action<std::string(const std::string& s)> a2 = Plus("tail", "-", ">");
|
798
799
|
const std::string re = "re";
|
799
|
-
|
800
|
+
tuple<const std::string> dummy = make_tuple(re);
|
801
|
+
EXPECT_EQ("retail->", a2.Perform(dummy));
|
800
802
|
}
|
801
803
|
|
802
804
|
ACTION_P4(Plus, p0, p1, p2, p3) { return arg0 + p0 + p1 + p2 + p3; }
|
@@ -57,7 +57,6 @@
|
|
57
57
|
namespace testing {
|
58
58
|
namespace gmock_generated_function_mockers_test {
|
59
59
|
|
60
|
-
using testing::internal::string;
|
61
60
|
using testing::_;
|
62
61
|
using testing::A;
|
63
62
|
using testing::An;
|
@@ -82,11 +81,11 @@ class FooInterface {
|
|
82
81
|
virtual bool Unary(int x) = 0;
|
83
82
|
virtual long Binary(short x, int y) = 0; // NOLINT
|
84
83
|
virtual int Decimal(bool b, char c, short d, int e, long f, // NOLINT
|
85
|
-
float g, double h, unsigned i, char* j,
|
86
|
-
|
84
|
+
float g, double h, unsigned i, char* j,
|
85
|
+
const std::string& k) = 0;
|
87
86
|
|
88
87
|
virtual bool TakesNonConstReference(int& n) = 0; // NOLINT
|
89
|
-
virtual string TakesConstReference(const int& n) = 0;
|
88
|
+
virtual std::string TakesConstReference(const int& n) = 0;
|
90
89
|
#ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
|
91
90
|
virtual bool TakesConst(const int x) = 0;
|
92
91
|
#endif // GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
|
@@ -101,13 +100,14 @@ class FooInterface {
|
|
101
100
|
virtual char OverloadedOnConstness() const = 0;
|
102
101
|
|
103
102
|
virtual int TypeWithHole(int (*func)()) = 0;
|
104
|
-
virtual int TypeWithComma(const std::map<int, string>& a_map) = 0;
|
103
|
+
virtual int TypeWithComma(const std::map<int, std::string>& a_map) = 0;
|
105
104
|
|
106
105
|
#if GTEST_OS_WINDOWS
|
107
106
|
STDMETHOD_(int, CTNullary)() = 0;
|
108
107
|
STDMETHOD_(bool, CTUnary)(int x) = 0;
|
109
|
-
STDMETHOD_(int, CTDecimal)
|
110
|
-
|
108
|
+
STDMETHOD_(int, CTDecimal)
|
109
|
+
(bool b, char c, short d, int e, long f, // NOLINT
|
110
|
+
float g, double h, unsigned i, char* j, const std::string& k) = 0;
|
111
111
|
STDMETHOD_(char, CTConst)(int x) const = 0;
|
112
112
|
#endif // GTEST_OS_WINDOWS
|
113
113
|
};
|
@@ -133,19 +133,19 @@ class MockFoo : public FooInterface {
|
|
133
133
|
MOCK_METHOD1(Unary, bool(int)); // NOLINT
|
134
134
|
MOCK_METHOD2(Binary, long(short, int)); // NOLINT
|
135
135
|
MOCK_METHOD10(Decimal, int(bool, char, short, int, long, float, // NOLINT
|
136
|
-
double, unsigned, char*, const string& str));
|
136
|
+
double, unsigned, char*, const std::string& str));
|
137
137
|
|
138
138
|
MOCK_METHOD1(TakesNonConstReference, bool(int&)); // NOLINT
|
139
|
-
MOCK_METHOD1(TakesConstReference, string(const int&));
|
139
|
+
MOCK_METHOD1(TakesConstReference, std::string(const int&));
|
140
140
|
|
141
141
|
#ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
|
142
142
|
MOCK_METHOD1(TakesConst, bool(const int)); // NOLINT
|
143
143
|
#endif
|
144
144
|
|
145
145
|
// Tests that the function return type can contain unprotected comma.
|
146
|
-
MOCK_METHOD0(ReturnTypeWithComma, std::map<int, string>());
|
146
|
+
MOCK_METHOD0(ReturnTypeWithComma, std::map<int, std::string>());
|
147
147
|
MOCK_CONST_METHOD1(ReturnTypeWithComma,
|
148
|
-
std::map<int, string>(int)); // NOLINT
|
148
|
+
std::map<int, std::string>(int)); // NOLINT
|
149
149
|
|
150
150
|
MOCK_METHOD0(OverloadedOnArgumentNumber, int()); // NOLINT
|
151
151
|
MOCK_METHOD1(OverloadedOnArgumentNumber, int(int)); // NOLINT
|
@@ -157,19 +157,21 @@ class MockFoo : public FooInterface {
|
|
157
157
|
MOCK_CONST_METHOD0(OverloadedOnConstness, char()); // NOLINT
|
158
158
|
|
159
159
|
MOCK_METHOD1(TypeWithHole, int(int (*)())); // NOLINT
|
160
|
-
MOCK_METHOD1(TypeWithComma,
|
160
|
+
MOCK_METHOD1(TypeWithComma,
|
161
|
+
int(const std::map<int, std::string>&)); // NOLINT
|
161
162
|
|
162
163
|
#if GTEST_OS_WINDOWS
|
163
164
|
MOCK_METHOD0_WITH_CALLTYPE(STDMETHODCALLTYPE, CTNullary, int());
|
164
165
|
MOCK_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, CTUnary, bool(int));
|
165
|
-
MOCK_METHOD10_WITH_CALLTYPE(STDMETHODCALLTYPE, CTDecimal,
|
166
|
-
|
167
|
-
|
166
|
+
MOCK_METHOD10_WITH_CALLTYPE(STDMETHODCALLTYPE, CTDecimal,
|
167
|
+
int(bool b, char c, short d, int e, long f,
|
168
|
+
float g, double h, unsigned i, char* j,
|
169
|
+
const std::string& k));
|
168
170
|
MOCK_CONST_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, CTConst, char(int));
|
169
171
|
|
170
172
|
// Tests that the function return type can contain unprotected comma.
|
171
173
|
MOCK_METHOD0_WITH_CALLTYPE(STDMETHODCALLTYPE, CTReturnTypeWithComma,
|
172
|
-
std::map<int, string>());
|
174
|
+
std::map<int, std::string>());
|
173
175
|
#endif // GTEST_OS_WINDOWS
|
174
176
|
|
175
177
|
private:
|
@@ -291,7 +293,7 @@ TEST_F(FunctionMockerTest, MocksFunctionsOverloadedOnConstnessOfThis) {
|
|
291
293
|
}
|
292
294
|
|
293
295
|
TEST_F(FunctionMockerTest, MocksReturnTypeWithComma) {
|
294
|
-
const std::map<int, string> a_map;
|
296
|
+
const std::map<int, std::string> a_map;
|
295
297
|
EXPECT_CALL(mock_foo_, ReturnTypeWithComma())
|
296
298
|
.WillOnce(Return(a_map));
|
297
299
|
EXPECT_CALL(mock_foo_, ReturnTypeWithComma(42))
|
@@ -341,7 +343,7 @@ TEST_F(FunctionMockerTest, MocksFunctionsConstFunctionWithCallType) {
|
|
341
343
|
}
|
342
344
|
|
343
345
|
TEST_F(FunctionMockerTest, MocksReturnTypeWithCommaAndCallType) {
|
344
|
-
const std::map<int, string> a_map;
|
346
|
+
const std::map<int, std::string> a_map;
|
345
347
|
EXPECT_CALL(mock_foo_, CTReturnTypeWithComma())
|
346
348
|
.WillOnce(Return(a_map));
|
347
349
|
|
@@ -618,5 +620,28 @@ TEST(MockFunctionTest, AsStdFunctionReturnsReference) {
|
|
618
620
|
}
|
619
621
|
#endif // GTEST_HAS_STD_FUNCTION_
|
620
622
|
|
623
|
+
struct MockMethodSizes0 {
|
624
|
+
MOCK_METHOD0(func, void());
|
625
|
+
};
|
626
|
+
struct MockMethodSizes1 {
|
627
|
+
MOCK_METHOD1(func, void(int));
|
628
|
+
};
|
629
|
+
struct MockMethodSizes2 {
|
630
|
+
MOCK_METHOD2(func, void(int, int));
|
631
|
+
};
|
632
|
+
struct MockMethodSizes3 {
|
633
|
+
MOCK_METHOD3(func, void(int, int, int));
|
634
|
+
};
|
635
|
+
struct MockMethodSizes4 {
|
636
|
+
MOCK_METHOD4(func, void(int, int, int, int));
|
637
|
+
};
|
638
|
+
|
639
|
+
TEST(MockFunctionTest, MockMethodSizeOverhead) {
|
640
|
+
EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes1));
|
641
|
+
EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes2));
|
642
|
+
EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes3));
|
643
|
+
EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes4));
|
644
|
+
}
|
645
|
+
|
621
646
|
} // namespace gmock_generated_function_mockers_test
|
622
647
|
} // namespace testing
|
data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc
CHANGED
@@ -63,10 +63,10 @@ TEST(MatcherTupleTest, ForSize2) {
|
|
63
63
|
}
|
64
64
|
|
65
65
|
TEST(MatcherTupleTest, ForSize5) {
|
66
|
-
CompileAssertTypesEqual<
|
67
|
-
|
68
|
-
|
69
|
-
|
66
|
+
CompileAssertTypesEqual<
|
67
|
+
tuple<Matcher<int>, Matcher<char>, Matcher<bool>, Matcher<double>,
|
68
|
+
Matcher<char*> >,
|
69
|
+
MatcherTuple<tuple<int, char, bool, double, char*> >::type>();
|
70
70
|
}
|
71
71
|
|
72
72
|
// Tests the Function template struct.
|
@@ -97,8 +97,9 @@ TEST(FunctionTest, Binary) {
|
|
97
97
|
CompileAssertTypesEqual<bool, F::Argument1>();
|
98
98
|
CompileAssertTypesEqual<const long&, F::Argument2>(); // NOLINT
|
99
99
|
CompileAssertTypesEqual<tuple<bool, const long&>, F::ArgumentTuple>(); // NOLINT
|
100
|
-
CompileAssertTypesEqual<
|
101
|
-
|
100
|
+
CompileAssertTypesEqual<
|
101
|
+
tuple<Matcher<bool>, Matcher<const long&> >, // NOLINT
|
102
|
+
F::ArgumentMatcherTuple>();
|
102
103
|
CompileAssertTypesEqual<void(bool, const long&), F::MakeResultVoid>(); // NOLINT
|
103
104
|
CompileAssertTypesEqual<IgnoredValue(bool, const long&), // NOLINT
|
104
105
|
F::MakeResultIgnoredValue>();
|
@@ -114,9 +115,10 @@ TEST(FunctionTest, LongArgumentList) {
|
|
114
115
|
CompileAssertTypesEqual<const long&, F::Argument5>(); // NOLINT
|
115
116
|
CompileAssertTypesEqual<tuple<bool, int, char*, int&, const long&>, // NOLINT
|
116
117
|
F::ArgumentTuple>();
|
117
|
-
CompileAssertTypesEqual<
|
118
|
-
|
119
|
-
|
118
|
+
CompileAssertTypesEqual<
|
119
|
+
tuple<Matcher<bool>, Matcher<int>, Matcher<char*>, Matcher<int&>,
|
120
|
+
Matcher<const long&> >, // NOLINT
|
121
|
+
F::ArgumentMatcherTuple>();
|
120
122
|
CompileAssertTypesEqual<void(bool, int, char*, int&, const long&), // NOLINT
|
121
123
|
F::MakeResultVoid>();
|
122
124
|
CompileAssertTypesEqual<
|
data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc
CHANGED
@@ -31,10 +31,19 @@
|
|
31
31
|
//
|
32
32
|
// This file tests the built-in matchers generated by a script.
|
33
33
|
|
34
|
+
// Silence warning C4244: 'initializing': conversion from 'int' to 'short',
|
35
|
+
// possible loss of data and C4100, unreferenced local parameter
|
36
|
+
#ifdef _MSC_VER
|
37
|
+
# pragma warning(push)
|
38
|
+
# pragma warning(disable:4244)
|
39
|
+
# pragma warning(disable:4100)
|
40
|
+
#endif
|
41
|
+
|
34
42
|
#include "gmock/gmock-generated-matchers.h"
|
35
43
|
|
36
44
|
#include <list>
|
37
45
|
#include <map>
|
46
|
+
#include <memory>
|
38
47
|
#include <set>
|
39
48
|
#include <sstream>
|
40
49
|
#include <string>
|
@@ -57,6 +66,8 @@ using testing::get;
|
|
57
66
|
using testing::make_tuple;
|
58
67
|
using testing::tuple;
|
59
68
|
using testing::_;
|
69
|
+
using testing::AllOf;
|
70
|
+
using testing::AnyOf;
|
60
71
|
using testing::Args;
|
61
72
|
using testing::Contains;
|
62
73
|
using testing::ElementsAre;
|
@@ -79,11 +90,10 @@ using testing::StaticAssertTypeEq;
|
|
79
90
|
using testing::StrEq;
|
80
91
|
using testing::Value;
|
81
92
|
using testing::internal::ElementsAreArrayMatcher;
|
82
|
-
using testing::internal::string;
|
83
93
|
|
84
94
|
// Returns the description of the given matcher.
|
85
95
|
template <typename T>
|
86
|
-
string Describe(const Matcher<T>& m) {
|
96
|
+
std::string Describe(const Matcher<T>& m) {
|
87
97
|
stringstream ss;
|
88
98
|
m.DescribeTo(&ss);
|
89
99
|
return ss.str();
|
@@ -91,7 +101,7 @@ string Describe(const Matcher<T>& m) {
|
|
91
101
|
|
92
102
|
// Returns the description of the negation of the given matcher.
|
93
103
|
template <typename T>
|
94
|
-
string DescribeNegation(const Matcher<T>& m) {
|
104
|
+
std::string DescribeNegation(const Matcher<T>& m) {
|
95
105
|
stringstream ss;
|
96
106
|
m.DescribeNegationTo(&ss);
|
97
107
|
return ss.str();
|
@@ -99,7 +109,7 @@ string DescribeNegation(const Matcher<T>& m) {
|
|
99
109
|
|
100
110
|
// Returns the reason why x matches, or doesn't match, m.
|
101
111
|
template <typename MatcherType, typename Value>
|
102
|
-
string Explain(const MatcherType& m, const Value& x) {
|
112
|
+
std::string Explain(const MatcherType& m, const Value& x) {
|
103
113
|
stringstream ss;
|
104
114
|
m.ExplainMatchResultTo(x, &ss);
|
105
115
|
return ss.str();
|
@@ -296,7 +306,7 @@ TEST(ElementsAreTest, CanDescribeExpectingOneElement) {
|
|
296
306
|
}
|
297
307
|
|
298
308
|
TEST(ElementsAreTest, CanDescribeExpectingManyElements) {
|
299
|
-
Matcher<list<string> > m = ElementsAre(StrEq("one"), "two");
|
309
|
+
Matcher<list<std::string> > m = ElementsAre(StrEq("one"), "two");
|
300
310
|
EXPECT_EQ("has 2 elements where\n"
|
301
311
|
"element #0 is equal to \"one\",\n"
|
302
312
|
"element #1 is equal to \"two\"", Describe(m));
|
@@ -314,7 +324,7 @@ TEST(ElementsAreTest, CanDescribeNegationOfExpectingOneElment) {
|
|
314
324
|
}
|
315
325
|
|
316
326
|
TEST(ElementsAreTest, CanDescribeNegationOfExpectingManyElements) {
|
317
|
-
Matcher<const list<string
|
327
|
+
Matcher<const list<std::string>&> m = ElementsAre("one", "two");
|
318
328
|
EXPECT_EQ("doesn't have 2 elements, or\n"
|
319
329
|
"element #0 isn't equal to \"one\", or\n"
|
320
330
|
"element #1 isn't equal to \"two\"", DescribeNegation(m));
|
@@ -365,21 +375,21 @@ TEST(ElementsAreTest, CanExplainMismatchRightSize) {
|
|
365
375
|
}
|
366
376
|
|
367
377
|
TEST(ElementsAreTest, MatchesOneElementVector) {
|
368
|
-
vector<string> test_vector;
|
378
|
+
vector<std::string> test_vector;
|
369
379
|
test_vector.push_back("test string");
|
370
380
|
|
371
381
|
EXPECT_THAT(test_vector, ElementsAre(StrEq("test string")));
|
372
382
|
}
|
373
383
|
|
374
384
|
TEST(ElementsAreTest, MatchesOneElementList) {
|
375
|
-
list<string> test_list;
|
385
|
+
list<std::string> test_list;
|
376
386
|
test_list.push_back("test string");
|
377
387
|
|
378
388
|
EXPECT_THAT(test_list, ElementsAre("test string"));
|
379
389
|
}
|
380
390
|
|
381
391
|
TEST(ElementsAreTest, MatchesThreeElementVector) {
|
382
|
-
vector<string> test_vector;
|
392
|
+
vector<std::string> test_vector;
|
383
393
|
test_vector.push_back("one");
|
384
394
|
test_vector.push_back("two");
|
385
395
|
test_vector.push_back("three");
|
@@ -428,30 +438,30 @@ TEST(ElementsAreTest, MatchesTenElementVector) {
|
|
428
438
|
}
|
429
439
|
|
430
440
|
TEST(ElementsAreTest, DoesNotMatchWrongSize) {
|
431
|
-
vector<string> test_vector;
|
441
|
+
vector<std::string> test_vector;
|
432
442
|
test_vector.push_back("test string");
|
433
443
|
test_vector.push_back("test string");
|
434
444
|
|
435
|
-
Matcher<vector<string> > m = ElementsAre(StrEq("test string"));
|
445
|
+
Matcher<vector<std::string> > m = ElementsAre(StrEq("test string"));
|
436
446
|
EXPECT_FALSE(m.Matches(test_vector));
|
437
447
|
}
|
438
448
|
|
439
449
|
TEST(ElementsAreTest, DoesNotMatchWrongValue) {
|
440
|
-
vector<string> test_vector;
|
450
|
+
vector<std::string> test_vector;
|
441
451
|
test_vector.push_back("other string");
|
442
452
|
|
443
|
-
Matcher<vector<string> > m = ElementsAre(StrEq("test string"));
|
453
|
+
Matcher<vector<std::string> > m = ElementsAre(StrEq("test string"));
|
444
454
|
EXPECT_FALSE(m.Matches(test_vector));
|
445
455
|
}
|
446
456
|
|
447
457
|
TEST(ElementsAreTest, DoesNotMatchWrongOrder) {
|
448
|
-
vector<string> test_vector;
|
458
|
+
vector<std::string> test_vector;
|
449
459
|
test_vector.push_back("one");
|
450
460
|
test_vector.push_back("three");
|
451
461
|
test_vector.push_back("two");
|
452
462
|
|
453
|
-
Matcher<vector<string> > m =
|
454
|
-
|
463
|
+
Matcher<vector<std::string> > m =
|
464
|
+
ElementsAre(StrEq("one"), StrEq("two"), StrEq("three"));
|
455
465
|
EXPECT_FALSE(m.Matches(test_vector));
|
456
466
|
}
|
457
467
|
|
@@ -527,7 +537,7 @@ TEST(ElementsAreTest, WorksWithTwoDimensionalNativeArray) {
|
|
527
537
|
}
|
528
538
|
|
529
539
|
TEST(ElementsAreTest, AcceptsStringLiteral) {
|
530
|
-
string array[] = {
|
540
|
+
std::string array[] = {"hi", "one", "two"};
|
531
541
|
EXPECT_THAT(array, ElementsAre("hi", "one", "two"));
|
532
542
|
EXPECT_THAT(array, Not(ElementsAre("hi", "one", "too")));
|
533
543
|
}
|
@@ -546,10 +556,10 @@ TEST(ElementsAreTest, AcceptsArrayWithUnknownSize) {
|
|
546
556
|
// The size of kHi is not known in this test, but ElementsAre() should
|
547
557
|
// still accept it.
|
548
558
|
|
549
|
-
string array1[] = {
|
559
|
+
std::string array1[] = {"hi"};
|
550
560
|
EXPECT_THAT(array1, ElementsAre(kHi));
|
551
561
|
|
552
|
-
string array2[] = {
|
562
|
+
std::string array2[] = {"ho"};
|
553
563
|
EXPECT_THAT(array2, Not(ElementsAre(kHi)));
|
554
564
|
}
|
555
565
|
|
@@ -589,7 +599,7 @@ TEST(ElementsAreArrayTest, CanBeCreatedWithValueArray) {
|
|
589
599
|
TEST(ElementsAreArrayTest, CanBeCreatedWithArraySize) {
|
590
600
|
const char* a[] = { "one", "two", "three" };
|
591
601
|
|
592
|
-
vector<string> test_vector(a, a + GTEST_ARRAY_SIZE_(a));
|
602
|
+
vector<std::string> test_vector(a, a + GTEST_ARRAY_SIZE_(a));
|
593
603
|
EXPECT_THAT(test_vector, ElementsAreArray(a, GTEST_ARRAY_SIZE_(a)));
|
594
604
|
|
595
605
|
const char** p = a;
|
@@ -600,7 +610,7 @@ TEST(ElementsAreArrayTest, CanBeCreatedWithArraySize) {
|
|
600
610
|
TEST(ElementsAreArrayTest, CanBeCreatedWithoutArraySize) {
|
601
611
|
const char* a[] = { "one", "two", "three" };
|
602
612
|
|
603
|
-
vector<string> test_vector(a, a + GTEST_ARRAY_SIZE_(a));
|
613
|
+
vector<std::string> test_vector(a, a + GTEST_ARRAY_SIZE_(a));
|
604
614
|
EXPECT_THAT(test_vector, ElementsAreArray(a));
|
605
615
|
|
606
616
|
test_vector[0] = "1";
|
@@ -608,10 +618,10 @@ TEST(ElementsAreArrayTest, CanBeCreatedWithoutArraySize) {
|
|
608
618
|
}
|
609
619
|
|
610
620
|
TEST(ElementsAreArrayTest, CanBeCreatedWithMatcherArray) {
|
611
|
-
const Matcher<string> kMatcherArray[] =
|
612
|
-
|
621
|
+
const Matcher<std::string> kMatcherArray[] = {StrEq("one"), StrEq("two"),
|
622
|
+
StrEq("three")};
|
613
623
|
|
614
|
-
vector<string> test_vector;
|
624
|
+
vector<std::string> test_vector;
|
615
625
|
test_vector.push_back("one");
|
616
626
|
test_vector.push_back("two");
|
617
627
|
test_vector.push_back("three");
|
@@ -640,7 +650,7 @@ TEST(ElementsAreArrayTest, TakesInitializerList) {
|
|
640
650
|
}
|
641
651
|
|
642
652
|
TEST(ElementsAreArrayTest, TakesInitializerListOfCStrings) {
|
643
|
-
const string a[5] = {
|
653
|
+
const std::string a[5] = {"a", "b", "c", "d", "e"};
|
644
654
|
EXPECT_THAT(a, ElementsAreArray({ "a", "b", "c", "d", "e" }));
|
645
655
|
EXPECT_THAT(a, Not(ElementsAreArray({ "a", "b", "c", "e", "d" })));
|
646
656
|
EXPECT_THAT(a, Not(ElementsAreArray({ "a", "b", "c", "d", "ef" })));
|
@@ -751,9 +761,9 @@ MATCHER(IsEven2, negation ? "is odd" : "is even") {
|
|
751
761
|
|
752
762
|
// This also tests that the description string can reference matcher
|
753
763
|
// parameters.
|
754
|
-
MATCHER_P2(EqSumOf, x, y,
|
755
|
-
|
756
|
-
|
764
|
+
MATCHER_P2(EqSumOf, x, y, std::string(negation ? "doesn't equal" : "equals") +
|
765
|
+
" the sum of " + PrintToString(x) + " and " +
|
766
|
+
PrintToString(y)) {
|
757
767
|
if (arg == (x + y)) {
|
758
768
|
*result_listener << "OK";
|
759
769
|
return true;
|
@@ -1117,12 +1127,12 @@ TEST(ContainsTest, ListMatchesWhenElementIsInContainer) {
|
|
1117
1127
|
EXPECT_THAT(some_list, Contains(Gt(2.5)));
|
1118
1128
|
EXPECT_THAT(some_list, Contains(Eq(2.0f)));
|
1119
1129
|
|
1120
|
-
list<string> another_list;
|
1130
|
+
list<std::string> another_list;
|
1121
1131
|
another_list.push_back("fee");
|
1122
1132
|
another_list.push_back("fie");
|
1123
1133
|
another_list.push_back("foe");
|
1124
1134
|
another_list.push_back("fum");
|
1125
|
-
EXPECT_THAT(another_list, Contains(string("fee")));
|
1135
|
+
EXPECT_THAT(another_list, Contains(std::string("fee")));
|
1126
1136
|
}
|
1127
1137
|
|
1128
1138
|
TEST(ContainsTest, ListDoesNotMatchWhenElementIsNotInContainer) {
|
@@ -1146,7 +1156,7 @@ TEST(ContainsTest, SetMatchesWhenElementIsInContainer) {
|
|
1146
1156
|
another_set.insert("fie");
|
1147
1157
|
another_set.insert("foe");
|
1148
1158
|
another_set.insert("fum");
|
1149
|
-
EXPECT_THAT(another_set, Contains(Eq(string("fum"))));
|
1159
|
+
EXPECT_THAT(another_set, Contains(Eq(std::string("fum"))));
|
1150
1160
|
}
|
1151
1161
|
|
1152
1162
|
TEST(ContainsTest, SetDoesNotMatchWhenElementIsNotInContainer) {
|
@@ -1157,7 +1167,7 @@ TEST(ContainsTest, SetDoesNotMatchWhenElementIsNotInContainer) {
|
|
1157
1167
|
|
1158
1168
|
set<const char*> c_string_set;
|
1159
1169
|
c_string_set.insert("hello");
|
1160
|
-
EXPECT_THAT(c_string_set, Not(Contains(string("hello").c_str())));
|
1170
|
+
EXPECT_THAT(c_string_set, Not(Contains(std::string("hello").c_str())));
|
1161
1171
|
}
|
1162
1172
|
|
1163
1173
|
TEST(ContainsTest, ExplainsMatchResultCorrectly) {
|
@@ -1189,13 +1199,14 @@ TEST(ContainsTest, MapMatchesWhenElementIsInContainer) {
|
|
1189
1199
|
my_map[bar] = 2;
|
1190
1200
|
EXPECT_THAT(my_map, Contains(pair<const char* const, int>(bar, 2)));
|
1191
1201
|
|
1192
|
-
map<string, int> another_map;
|
1202
|
+
map<std::string, int> another_map;
|
1193
1203
|
another_map["fee"] = 1;
|
1194
1204
|
another_map["fie"] = 2;
|
1195
1205
|
another_map["foe"] = 3;
|
1196
1206
|
another_map["fum"] = 4;
|
1197
|
-
EXPECT_THAT(another_map,
|
1198
|
-
|
1207
|
+
EXPECT_THAT(another_map,
|
1208
|
+
Contains(pair<const std::string, int>(std::string("fee"), 1)));
|
1209
|
+
EXPECT_THAT(another_map, Contains(pair<const std::string, int>("fie", 2)));
|
1199
1210
|
}
|
1200
1211
|
|
1201
1212
|
TEST(ContainsTest, MapDoesNotMatchWhenElementIsNotInContainer) {
|
@@ -1207,7 +1218,7 @@ TEST(ContainsTest, MapDoesNotMatchWhenElementIsNotInContainer) {
|
|
1207
1218
|
|
1208
1219
|
TEST(ContainsTest, ArrayMatchesWhenElementIsInContainer) {
|
1209
1220
|
const char* string_array[] = { "fee", "fie", "foe", "fum" };
|
1210
|
-
EXPECT_THAT(string_array, Contains(Eq(string("fum"))));
|
1221
|
+
EXPECT_THAT(string_array, Contains(Eq(std::string("fum"))));
|
1211
1222
|
}
|
1212
1223
|
|
1213
1224
|
TEST(ContainsTest, ArrayDoesNotMatchWhenElementIsNotInContainer) {
|
@@ -1283,4 +1294,48 @@ TEST(AnyOfTest, DoesNotCallAnyOfUnqualified) {
|
|
1283
1294
|
# pragma warning(pop)
|
1284
1295
|
#endif
|
1285
1296
|
|
1297
|
+
#if GTEST_LANG_CXX11
|
1298
|
+
|
1299
|
+
TEST(AllOfTest, WorksOnMoveOnlyType) {
|
1300
|
+
std::unique_ptr<int> p(new int(3));
|
1301
|
+
EXPECT_THAT(p, AllOf(Pointee(Eq(3)), Pointee(Gt(0)), Pointee(Lt(5))));
|
1302
|
+
EXPECT_THAT(p, Not(AllOf(Pointee(Eq(3)), Pointee(Gt(0)), Pointee(Lt(3)))));
|
1303
|
+
}
|
1304
|
+
|
1305
|
+
TEST(AnyOfTest, WorksOnMoveOnlyType) {
|
1306
|
+
std::unique_ptr<int> p(new int(3));
|
1307
|
+
EXPECT_THAT(p, AnyOf(Pointee(Eq(5)), Pointee(Lt(0)), Pointee(Lt(5))));
|
1308
|
+
EXPECT_THAT(p, Not(AnyOf(Pointee(Eq(5)), Pointee(Lt(0)), Pointee(Gt(5)))));
|
1309
|
+
}
|
1310
|
+
|
1311
|
+
MATCHER(IsNotNull, "") {
|
1312
|
+
return arg != nullptr;
|
1313
|
+
}
|
1314
|
+
|
1315
|
+
// Verifies that a matcher defined using MATCHER() can work on
|
1316
|
+
// move-only types.
|
1317
|
+
TEST(MatcherMacroTest, WorksOnMoveOnlyType) {
|
1318
|
+
std::unique_ptr<int> p(new int(3));
|
1319
|
+
EXPECT_THAT(p, IsNotNull());
|
1320
|
+
EXPECT_THAT(std::unique_ptr<int>(), Not(IsNotNull()));
|
1321
|
+
}
|
1322
|
+
|
1323
|
+
MATCHER_P(UniquePointee, pointee, "") {
|
1324
|
+
return *arg == pointee;
|
1325
|
+
}
|
1326
|
+
|
1327
|
+
// Verifies that a matcher defined using MATCHER_P*() can work on
|
1328
|
+
// move-only types.
|
1329
|
+
TEST(MatcherPMacroTest, WorksOnMoveOnlyType) {
|
1330
|
+
std::unique_ptr<int> p(new int(3));
|
1331
|
+
EXPECT_THAT(p, UniquePointee(3));
|
1332
|
+
EXPECT_THAT(p, Not(UniquePointee(2)));
|
1333
|
+
}
|
1334
|
+
|
1335
|
+
#endif // GTEST_LASNG_CXX11
|
1336
|
+
|
1286
1337
|
} // namespace
|
1338
|
+
|
1339
|
+
#ifdef _MSC_VER
|
1340
|
+
# pragma warning(pop)
|
1341
|
+
#endif
|