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
@@ -27,7 +27,7 @@
|
|
27
27
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
28
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
29
|
|
30
|
-
// This file is AUTOMATICALLY GENERATED on
|
30
|
+
// This file is AUTOMATICALLY GENERATED on 01/02/2018 by command
|
31
31
|
// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
|
32
32
|
|
33
33
|
// Regression test for gtest_pred_impl.h
|
@@ -29,10 +29,10 @@
|
|
29
29
|
//
|
30
30
|
// Author: wan@google.com (Zhanyong Wan)
|
31
31
|
//
|
32
|
-
// Unit test for
|
32
|
+
// Unit test for gtest/gtest_prod.h.
|
33
33
|
|
34
|
+
#include "production.h"
|
34
35
|
#include "gtest/gtest.h"
|
35
|
-
#include "test/production.h"
|
36
36
|
|
37
37
|
// Tests that private members can be accessed from a TEST declared as
|
38
38
|
// a friend of the class.
|
@@ -34,15 +34,7 @@
|
|
34
34
|
#include <stdlib.h>
|
35
35
|
#include <iostream>
|
36
36
|
#include "gtest/gtest.h"
|
37
|
-
|
38
|
-
// Indicates that this translation unit is part of Google Test's
|
39
|
-
// implementation. It must come before gtest-internal-inl.h is
|
40
|
-
// included, or there will be a compiler error. This trick is to
|
41
|
-
// prevent a user from accidentally including gtest-internal-inl.h in
|
42
|
-
// his code.
|
43
|
-
#define GTEST_IMPLEMENTATION_ 1
|
44
37
|
#include "src/gtest-internal-inl.h"
|
45
|
-
#undef GTEST_IMPLEMENTATION_
|
46
38
|
|
47
39
|
namespace testing {
|
48
40
|
|
@@ -75,7 +67,7 @@ namespace {
|
|
75
67
|
|
76
68
|
|
77
69
|
// Used for verifying that global environment set-up and tear-down are
|
78
|
-
// inside the gtest_repeat loop.
|
70
|
+
// inside the --gtest_repeat loop.
|
79
71
|
|
80
72
|
int g_environment_set_up_count = 0;
|
81
73
|
int g_environment_tear_down_count = 0;
|
@@ -119,7 +111,6 @@ TEST(BarDeathTest, ThreadSafeAndFast) {
|
|
119
111
|
EXPECT_DEATH_IF_SUPPORTED(::testing::internal::posix::Abort(), "");
|
120
112
|
}
|
121
113
|
|
122
|
-
#if GTEST_HAS_PARAM_TEST
|
123
114
|
int g_param_test_count = 0;
|
124
115
|
|
125
116
|
const int kNumberOfParamTests = 10;
|
@@ -135,7 +126,6 @@ TEST_P(MyParamTest, ShouldPass) {
|
|
135
126
|
INSTANTIATE_TEST_CASE_P(MyParamSequence,
|
136
127
|
MyParamTest,
|
137
128
|
testing::Range(0, kNumberOfParamTests));
|
138
|
-
#endif // GTEST_HAS_PARAM_TEST
|
139
129
|
|
140
130
|
// Resets the count for each test.
|
141
131
|
void ResetCounts() {
|
@@ -144,9 +134,7 @@ void ResetCounts() {
|
|
144
134
|
g_should_fail_count = 0;
|
145
135
|
g_should_pass_count = 0;
|
146
136
|
g_death_test_count = 0;
|
147
|
-
#if GTEST_HAS_PARAM_TEST
|
148
137
|
g_param_test_count = 0;
|
149
|
-
#endif // GTEST_HAS_PARAM_TEST
|
150
138
|
}
|
151
139
|
|
152
140
|
// Checks that the count for each test is expected.
|
@@ -156,9 +144,7 @@ void CheckCounts(int expected) {
|
|
156
144
|
GTEST_CHECK_INT_EQ_(expected, g_should_fail_count);
|
157
145
|
GTEST_CHECK_INT_EQ_(expected, g_should_pass_count);
|
158
146
|
GTEST_CHECK_INT_EQ_(expected, g_death_test_count);
|
159
|
-
#if GTEST_HAS_PARAM_TEST
|
160
147
|
GTEST_CHECK_INT_EQ_(expected * kNumberOfParamTests, g_param_test_count);
|
161
|
-
#endif // GTEST_HAS_PARAM_TEST
|
162
148
|
}
|
163
149
|
|
164
150
|
// Tests the behavior of Google Test when --gtest_repeat is not specified.
|
@@ -201,9 +187,7 @@ void TestRepeatWithFilterForSuccessfulTests(int repeat) {
|
|
201
187
|
GTEST_CHECK_INT_EQ_(0, g_should_fail_count);
|
202
188
|
GTEST_CHECK_INT_EQ_(repeat, g_should_pass_count);
|
203
189
|
GTEST_CHECK_INT_EQ_(repeat, g_death_test_count);
|
204
|
-
#if GTEST_HAS_PARAM_TEST
|
205
190
|
GTEST_CHECK_INT_EQ_(repeat * kNumberOfParamTests, g_param_test_count);
|
206
|
-
#endif // GTEST_HAS_PARAM_TEST
|
207
191
|
}
|
208
192
|
|
209
193
|
// Tests using --gtest_repeat when --gtest_filter specifies a set of
|
@@ -219,15 +203,14 @@ void TestRepeatWithFilterForFailedTests(int repeat) {
|
|
219
203
|
GTEST_CHECK_INT_EQ_(repeat, g_should_fail_count);
|
220
204
|
GTEST_CHECK_INT_EQ_(0, g_should_pass_count);
|
221
205
|
GTEST_CHECK_INT_EQ_(0, g_death_test_count);
|
222
|
-
#if GTEST_HAS_PARAM_TEST
|
223
206
|
GTEST_CHECK_INT_EQ_(0, g_param_test_count);
|
224
|
-
#endif // GTEST_HAS_PARAM_TEST
|
225
207
|
}
|
226
208
|
|
227
209
|
} // namespace
|
228
210
|
|
229
211
|
int main(int argc, char **argv) {
|
230
212
|
testing::InitGoogleTest(&argc, argv);
|
213
|
+
|
231
214
|
testing::AddGlobalTestEnvironment(new MyEnvironment);
|
232
215
|
|
233
216
|
TestRepeatUnspecified();
|
@@ -34,15 +34,9 @@
|
|
34
34
|
|
35
35
|
#include "gtest/gtest.h"
|
36
36
|
|
37
|
-
#include <iostream>
|
38
37
|
#include <vector>
|
39
38
|
|
40
|
-
// We must define this macro in order to #include
|
41
|
-
// gtest-internal-inl.h. This is how Google Test prevents a user from
|
42
|
-
// accidentally depending on its internal implementation.
|
43
|
-
#define GTEST_IMPLEMENTATION_ 1
|
44
39
|
#include "src/gtest-internal-inl.h"
|
45
|
-
#undef GTEST_IMPLEMENTATION_
|
46
40
|
|
47
41
|
#if GTEST_IS_THREADSAFE
|
48
42
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
#
|
3
1
|
# Copyright 2006, Google Inc.
|
4
2
|
# All rights reserved.
|
5
3
|
#
|
@@ -29,20 +27,25 @@
|
|
29
27
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
28
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
31
29
|
|
32
|
-
"""Unit test utilities for Google C++ Testing Framework."""
|
30
|
+
"""Unit test utilities for Google C++ Testing and Mocking Framework."""
|
31
|
+
# Suppresses the 'Import not at the top of the file' lint complaint.
|
32
|
+
# pylint: disable-msg=C6204
|
33
33
|
|
34
34
|
__author__ = 'wan@google.com (Zhanyong Wan)'
|
35
35
|
|
36
|
-
import atexit
|
37
36
|
import os
|
38
|
-
import shutil
|
39
37
|
import sys
|
38
|
+
|
39
|
+
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
|
40
|
+
IS_WINDOWS = os.name == 'nt'
|
41
|
+
IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
|
42
|
+
|
43
|
+
import atexit
|
44
|
+
import shutil
|
40
45
|
import tempfile
|
41
46
|
import unittest
|
42
47
|
_test_module = unittest
|
43
48
|
|
44
|
-
# Suppresses the 'Import not at the top of the file' lint complaint.
|
45
|
-
# pylint: disable-msg=C6204
|
46
49
|
try:
|
47
50
|
import subprocess
|
48
51
|
_SUBPROCESS_MODULE_AVAILABLE = True
|
@@ -53,9 +56,6 @@ except:
|
|
53
56
|
|
54
57
|
GTEST_OUTPUT_VAR_NAME = 'GTEST_OUTPUT'
|
55
58
|
|
56
|
-
IS_WINDOWS = os.name == 'nt'
|
57
|
-
IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
|
58
|
-
|
59
59
|
# The environment variable for specifying the path to the premature-exit file.
|
60
60
|
PREMATURE_EXIT_FILE_ENV_VAR = 'TEST_PREMATURE_EXIT_FILE'
|
61
61
|
|
@@ -145,8 +145,6 @@ atexit.register(_RemoveTempDir)
|
|
145
145
|
|
146
146
|
|
147
147
|
def GetTempDir():
|
148
|
-
"""Returns a directory for temporary files."""
|
149
|
-
|
150
148
|
global _temp_dir
|
151
149
|
if not _temp_dir:
|
152
150
|
_temp_dir = tempfile.mkdtemp()
|
@@ -178,7 +176,7 @@ def GetTestExecutablePath(executable_name, build_dir=None):
|
|
178
176
|
'Unable to find the test binary "%s". Please make sure to provide\n'
|
179
177
|
'a path to the binary via the --build_dir flag or the BUILD_DIR\n'
|
180
178
|
'environment variable.' % path)
|
181
|
-
sys.
|
179
|
+
print >> sys.stderr, message
|
182
180
|
sys.exit(1)
|
183
181
|
|
184
182
|
return path
|
@@ -245,7 +243,7 @@ class Subprocess:
|
|
245
243
|
p = subprocess.Popen(command,
|
246
244
|
stdout=subprocess.PIPE, stderr=stderr,
|
247
245
|
cwd=working_dir, universal_newlines=True, env=env)
|
248
|
-
# communicate returns a tuple with the file
|
246
|
+
# communicate returns a tuple with the file object for the child's
|
249
247
|
# output.
|
250
248
|
self.output = p.communicate()[0]
|
251
249
|
self._return_code = p.returncode
|
@@ -0,0 +1,65 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
#
|
3
|
+
# Copyright 2018 Google LLC. All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are
|
7
|
+
# met:
|
8
|
+
#
|
9
|
+
# * Redistributions of source code must retain the above copyright
|
10
|
+
# notice, this list of conditions and the following disclaimer.
|
11
|
+
# * Redistributions in binary form must reproduce the above
|
12
|
+
# copyright notice, this list of conditions and the following disclaimer
|
13
|
+
# in the documentation and/or other materials provided with the
|
14
|
+
# distribution.
|
15
|
+
# * Neither the name of Google Inc. nor the names of its
|
16
|
+
# contributors may be used to endorse or promote products derived from
|
17
|
+
# this software without specific prior written permission.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
20
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
21
|
+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
22
|
+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
23
|
+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
24
|
+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
25
|
+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
26
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
27
|
+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
28
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
"""Verifies that Google Test uses filter provided via testbridge."""
|
31
|
+
|
32
|
+
__author__ = 'rfj@google.com (Rohan Joyce)'
|
33
|
+
|
34
|
+
import os
|
35
|
+
|
36
|
+
import gtest_test_utils
|
37
|
+
|
38
|
+
binary_name = 'gtest_testbridge_test_'
|
39
|
+
COMMAND = gtest_test_utils.GetTestExecutablePath(binary_name)
|
40
|
+
TESTBRIDGE_NAME = 'TESTBRIDGE_TEST_ONLY'
|
41
|
+
|
42
|
+
|
43
|
+
def Assert(condition):
|
44
|
+
if not condition:
|
45
|
+
raise AssertionError
|
46
|
+
|
47
|
+
|
48
|
+
class GTestTestFilterTest(gtest_test_utils.TestCase):
|
49
|
+
|
50
|
+
def testTestExecutionIsFiltered(self):
|
51
|
+
"""Tests that the test filter is picked up from the testbridge env var."""
|
52
|
+
subprocess_env = os.environ.copy()
|
53
|
+
|
54
|
+
subprocess_env[TESTBRIDGE_NAME] = '*.TestThatSucceeds'
|
55
|
+
p = gtest_test_utils.Subprocess(COMMAND, env=subprocess_env)
|
56
|
+
|
57
|
+
self.assertEquals(0, p.exit_code)
|
58
|
+
|
59
|
+
Assert('filter = *.TestThatSucceeds' in p.output)
|
60
|
+
Assert('[ OK ] TestFilterTest.TestThatSucceeds' in p.output)
|
61
|
+
Assert('[ PASSED ] 1 test.' in p.output)
|
62
|
+
|
63
|
+
|
64
|
+
if __name__ == '__main__':
|
65
|
+
gtest_test_utils.Main()
|
@@ -0,0 +1,44 @@
|
|
1
|
+
// Copyright 2018, Google LLC.
|
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: rfj@google.com (Rohan Joyce)
|
31
|
+
|
32
|
+
// This program is meant to be run by gtest_test_filter_test.py. Do not run
|
33
|
+
// it directly.
|
34
|
+
|
35
|
+
#include "gtest/gtest.h"
|
36
|
+
|
37
|
+
// These tests are used to detect if filtering is working. Only
|
38
|
+
// 'TestThatSucceeds' should ever run.
|
39
|
+
|
40
|
+
TEST(TestFilterTest, TestThatSucceeds) {}
|
41
|
+
|
42
|
+
TEST(TestFilterTest, TestThatFails) {
|
43
|
+
ASSERT_TRUE(false) << "This test should never be run.";
|
44
|
+
}
|
data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py
CHANGED
@@ -70,7 +70,7 @@ def SetEnvVar(env_var, value):
|
|
70
70
|
def Run(command):
|
71
71
|
"""Runs a command; returns True/False if its exit code is/isn't 0."""
|
72
72
|
|
73
|
-
print
|
73
|
+
print 'Running "%s". . .' % ' '.join(command)
|
74
74
|
p = gtest_test_utils.Subprocess(command)
|
75
75
|
return p.exited and p.exit_code == 0
|
76
76
|
|
@@ -35,7 +35,6 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
|
|
35
35
|
|
36
36
|
import gtest_test_utils
|
37
37
|
|
38
|
-
|
39
38
|
COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_uninitialized_test_')
|
40
39
|
|
41
40
|
|
@@ -46,8 +45,8 @@ def Assert(condition):
|
|
46
45
|
|
47
46
|
def AssertEq(expected, actual):
|
48
47
|
if expected != actual:
|
49
|
-
print
|
50
|
-
print
|
48
|
+
print 'Expected: %s' % (expected,)
|
49
|
+
print ' Actual: %s' % (actual,)
|
51
50
|
raise AssertionError
|
52
51
|
|
53
52
|
|
@@ -56,8 +55,8 @@ def TestExitCodeAndOutput(command):
|
|
56
55
|
|
57
56
|
# Verifies that 'command' exits with code 1.
|
58
57
|
p = gtest_test_utils.Subprocess(command)
|
59
|
-
|
60
|
-
|
58
|
+
if p.exited and p.exit_code == 0:
|
59
|
+
Assert('IMPORTANT NOTICE' in p.output);
|
61
60
|
Assert('InitGoogleTest' in p.output)
|
62
61
|
|
63
62
|
|
@@ -34,8 +34,8 @@
|
|
34
34
|
TEST(DummyTest, Dummy) {
|
35
35
|
// This test doesn't verify anything. We just need it to create a
|
36
36
|
// realistic stage for testing the behavior of Google Test when
|
37
|
-
// RUN_ALL_TESTS() is called without
|
38
|
-
// called first.
|
37
|
+
// RUN_ALL_TESTS() is called without
|
38
|
+
// testing::InitGoogleTest() being called first.
|
39
39
|
}
|
40
40
|
|
41
41
|
int main() {
|
@@ -34,9 +34,9 @@
|
|
34
34
|
|
35
35
|
#include "gtest/gtest.h"
|
36
36
|
|
37
|
-
// Verifies that the command line flag variables can be accessed
|
38
|
-
//
|
39
|
-
// Do not move it after other #includes.
|
37
|
+
// Verifies that the command line flag variables can be accessed in
|
38
|
+
// code once "gtest/gtest.h" has been
|
39
|
+
// #included. Do not move it after other gtest #includes.
|
40
40
|
TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) {
|
41
41
|
bool dummy = testing::GTEST_FLAG(also_run_disabled_tests)
|
42
42
|
|| testing::GTEST_FLAG(break_on_failure)
|
@@ -64,17 +64,12 @@ TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) {
|
|
64
64
|
#include <map>
|
65
65
|
#include <vector>
|
66
66
|
#include <ostream>
|
67
|
+
#if GTEST_LANG_CXX11
|
68
|
+
#include <unordered_set>
|
69
|
+
#endif // GTEST_LANG_CXX11
|
67
70
|
|
68
71
|
#include "gtest/gtest-spi.h"
|
69
|
-
|
70
|
-
// Indicates that this translation unit is part of Google Test's
|
71
|
-
// implementation. It must come before gtest-internal-inl.h is
|
72
|
-
// included, or there will be a compiler error. This trick is to
|
73
|
-
// prevent a user from accidentally including gtest-internal-inl.h in
|
74
|
-
// his code.
|
75
|
-
#define GTEST_IMPLEMENTATION_ 1
|
76
72
|
#include "src/gtest-internal-inl.h"
|
77
|
-
#undef GTEST_IMPLEMENTATION_
|
78
73
|
|
79
74
|
namespace testing {
|
80
75
|
namespace internal {
|
@@ -86,9 +81,9 @@ class StreamingListenerTest : public Test {
|
|
86
81
|
class FakeSocketWriter : public StreamingListener::AbstractSocketWriter {
|
87
82
|
public:
|
88
83
|
// Sends a string to the socket.
|
89
|
-
virtual void Send(const string& message) { output_ += message; }
|
84
|
+
virtual void Send(const std::string& message) { output_ += message; }
|
90
85
|
|
91
|
-
string output_;
|
86
|
+
std::string output_;
|
92
87
|
};
|
93
88
|
|
94
89
|
StreamingListenerTest()
|
@@ -98,7 +93,7 @@ class StreamingListenerTest : public Test {
|
|
98
93
|
CodeLocation(__FILE__, __LINE__), 0, NULL) {}
|
99
94
|
|
100
95
|
protected:
|
101
|
-
string* output() { return &(fake_sock_writer_->output_); }
|
96
|
+
std::string* output() { return &(fake_sock_writer_->output_); }
|
102
97
|
|
103
98
|
FakeSocketWriter* const fake_sock_writer_;
|
104
99
|
StreamingListener streamer_;
|
@@ -266,6 +261,8 @@ using testing::internal::IsContainer;
|
|
266
261
|
using testing::internal::IsContainerTest;
|
267
262
|
using testing::internal::IsNotContainer;
|
268
263
|
using testing::internal::NativeArray;
|
264
|
+
using testing::internal::OsStackTraceGetter;
|
265
|
+
using testing::internal::OsStackTraceGetterInterface;
|
269
266
|
using testing::internal::ParseInt32Flag;
|
270
267
|
using testing::internal::RelationToSourceCopy;
|
271
268
|
using testing::internal::RelationToSourceReference;
|
@@ -282,6 +279,7 @@ using testing::internal::String;
|
|
282
279
|
using testing::internal::TestEventListenersAccessor;
|
283
280
|
using testing::internal::TestResultAccessor;
|
284
281
|
using testing::internal::UInt32;
|
282
|
+
using testing::internal::UnitTestImpl;
|
285
283
|
using testing::internal::WideStringToUtf8;
|
286
284
|
using testing::internal::edit_distance::CalculateOptimalEdits;
|
287
285
|
using testing::internal::edit_distance::CreateUnifiedDiff;
|
@@ -382,6 +380,31 @@ TEST(GetTestTypeIdTest, ReturnsTheSameValueInsideOrOutsideOfGoogleTest) {
|
|
382
380
|
EXPECT_EQ(kTestTypeIdInGoogleTest, GetTestTypeId());
|
383
381
|
}
|
384
382
|
|
383
|
+
// Tests CanonicalizeForStdLibVersioning.
|
384
|
+
|
385
|
+
using ::testing::internal::CanonicalizeForStdLibVersioning;
|
386
|
+
|
387
|
+
TEST(CanonicalizeForStdLibVersioning, LeavesUnversionedNamesUnchanged) {
|
388
|
+
EXPECT_EQ("std::bind", CanonicalizeForStdLibVersioning("std::bind"));
|
389
|
+
EXPECT_EQ("std::_", CanonicalizeForStdLibVersioning("std::_"));
|
390
|
+
EXPECT_EQ("std::__foo", CanonicalizeForStdLibVersioning("std::__foo"));
|
391
|
+
EXPECT_EQ("gtl::__1::x", CanonicalizeForStdLibVersioning("gtl::__1::x"));
|
392
|
+
EXPECT_EQ("__1::x", CanonicalizeForStdLibVersioning("__1::x"));
|
393
|
+
EXPECT_EQ("::__1::x", CanonicalizeForStdLibVersioning("::__1::x"));
|
394
|
+
}
|
395
|
+
|
396
|
+
TEST(CanonicalizeForStdLibVersioning, ElidesDoubleUnderNames) {
|
397
|
+
EXPECT_EQ("std::bind", CanonicalizeForStdLibVersioning("std::__1::bind"));
|
398
|
+
EXPECT_EQ("std::_", CanonicalizeForStdLibVersioning("std::__1::_"));
|
399
|
+
|
400
|
+
EXPECT_EQ("std::bind", CanonicalizeForStdLibVersioning("std::__g::bind"));
|
401
|
+
EXPECT_EQ("std::_", CanonicalizeForStdLibVersioning("std::__g::_"));
|
402
|
+
|
403
|
+
EXPECT_EQ("std::bind",
|
404
|
+
CanonicalizeForStdLibVersioning("std::__google::bind"));
|
405
|
+
EXPECT_EQ("std::_", CanonicalizeForStdLibVersioning("std::__google::_"));
|
406
|
+
}
|
407
|
+
|
385
408
|
// Tests FormatTimeInMillisAsSeconds().
|
386
409
|
|
387
410
|
TEST(FormatTimeInMillisAsSecondsTest, FormatsZero) {
|
@@ -442,7 +465,7 @@ class FormatEpochTimeInMillisAsIso8601Test : public Test {
|
|
442
465
|
// tzset() distinguishes between the TZ variable being present and empty
|
443
466
|
// and not being present, so we have to consider the case of time_zone
|
444
467
|
// being NULL.
|
445
|
-
#if _MSC_VER
|
468
|
+
#if _MSC_VER || GTEST_OS_WINDOWS_MINGW
|
446
469
|
// ...Unless it's MSVC, whose standard library's _putenv doesn't
|
447
470
|
// distinguish between an empty and a missing variable.
|
448
471
|
const std::string env_var =
|
@@ -546,7 +569,7 @@ TEST(CodePointToUtf8Test, CanEncode8To11Bits) {
|
|
546
569
|
|
547
570
|
// 101 0111 0110 => 110-10101 10-110110
|
548
571
|
// Some compilers (e.g., GCC on MinGW) cannot handle non-ASCII codepoints
|
549
|
-
// in wide strings and wide chars. In order to
|
572
|
+
// in wide strings and wide chars. In order to accommodate them, we have to
|
550
573
|
// introduce such character constants as integers.
|
551
574
|
EXPECT_EQ("\xD5\xB6",
|
552
575
|
CodePointToUtf8(static_cast<wchar_t>(0x576)));
|
@@ -1388,7 +1411,7 @@ class TestResultTest : public Test {
|
|
1388
1411
|
delete r2;
|
1389
1412
|
}
|
1390
1413
|
|
1391
|
-
// Helper that compares two
|
1414
|
+
// Helper that compares two TestPartResults.
|
1392
1415
|
static void CompareTestPartResult(const TestPartResult& expected,
|
1393
1416
|
const TestPartResult& actual) {
|
1394
1417
|
EXPECT_EQ(expected.type(), actual.type());
|
@@ -1787,7 +1810,7 @@ TEST(Int32FromEnvOrDieDeathTest, AbortsOnFailure) {
|
|
1787
1810
|
}
|
1788
1811
|
|
1789
1812
|
// Tests that Int32FromEnvOrDie() aborts with an error message
|
1790
|
-
// if the variable cannot be
|
1813
|
+
// if the variable cannot be represented by an Int32.
|
1791
1814
|
TEST(Int32FromEnvOrDieDeathTest, AbortsOnInt32Overflow) {
|
1792
1815
|
SetEnv(GTEST_FLAG_PREFIX_UPPER_ "VAR", "1234567891234567891234");
|
1793
1816
|
EXPECT_DEATH_IF_SUPPORTED(
|
@@ -2430,7 +2453,7 @@ TEST(StringAssertionTest, ASSERT_STREQ) {
|
|
2430
2453
|
ASSERT_STREQ(p1, p2);
|
2431
2454
|
|
2432
2455
|
EXPECT_FATAL_FAILURE(ASSERT_STREQ("bad", "good"),
|
2433
|
-
"
|
2456
|
+
" \"bad\"\n \"good\"");
|
2434
2457
|
}
|
2435
2458
|
|
2436
2459
|
// Tests ASSERT_STREQ with NULL arguments.
|
@@ -3115,13 +3138,13 @@ TEST(DISABLED_TestCase, DISABLED_TestShouldNotRun) {
|
|
3115
3138
|
FAIL() << "Unexpected failure: Test in disabled test case should not be run.";
|
3116
3139
|
}
|
3117
3140
|
|
3118
|
-
// Check that when all tests in a test case are disabled,
|
3141
|
+
// Check that when all tests in a test case are disabled, SetUpTestCase() and
|
3119
3142
|
// TearDownTestCase() are not called.
|
3120
3143
|
class DisabledTestsTest : public Test {
|
3121
3144
|
protected:
|
3122
3145
|
static void SetUpTestCase() {
|
3123
3146
|
FAIL() << "Unexpected failure: All tests disabled in test case. "
|
3124
|
-
"
|
3147
|
+
"SetUpTestCase() should not be called.";
|
3125
3148
|
}
|
3126
3149
|
|
3127
3150
|
static void TearDownTestCase() {
|
@@ -3368,7 +3391,7 @@ class NoFatalFailureTest : public Test {
|
|
3368
3391
|
|
3369
3392
|
void DoAssertNoFatalFailureOnFails() {
|
3370
3393
|
ASSERT_NO_FATAL_FAILURE(Fails());
|
3371
|
-
ADD_FAILURE() << "
|
3394
|
+
ADD_FAILURE() << "should not reach here.";
|
3372
3395
|
}
|
3373
3396
|
|
3374
3397
|
void DoExpectNoFatalFailureOnFails() {
|
@@ -3528,35 +3551,39 @@ TEST(AssertionTest, EqFailure) {
|
|
3528
3551
|
EqFailure("foo", "bar", foo_val, bar_val, false)
|
3529
3552
|
.failure_message());
|
3530
3553
|
EXPECT_STREQ(
|
3531
|
-
"
|
3532
|
-
"
|
3533
|
-
"
|
3534
|
-
"
|
3554
|
+
"Expected equality of these values:\n"
|
3555
|
+
" foo\n"
|
3556
|
+
" Which is: 5\n"
|
3557
|
+
" bar\n"
|
3558
|
+
" Which is: 6",
|
3535
3559
|
msg1.c_str());
|
3536
3560
|
|
3537
3561
|
const std::string msg2(
|
3538
3562
|
EqFailure("foo", "6", foo_val, bar_val, false)
|
3539
3563
|
.failure_message());
|
3540
3564
|
EXPECT_STREQ(
|
3541
|
-
"
|
3542
|
-
"
|
3543
|
-
"
|
3565
|
+
"Expected equality of these values:\n"
|
3566
|
+
" foo\n"
|
3567
|
+
" Which is: 5\n"
|
3568
|
+
" 6",
|
3544
3569
|
msg2.c_str());
|
3545
3570
|
|
3546
3571
|
const std::string msg3(
|
3547
3572
|
EqFailure("5", "bar", foo_val, bar_val, false)
|
3548
3573
|
.failure_message());
|
3549
3574
|
EXPECT_STREQ(
|
3550
|
-
"
|
3551
|
-
"
|
3552
|
-
"
|
3575
|
+
"Expected equality of these values:\n"
|
3576
|
+
" 5\n"
|
3577
|
+
" bar\n"
|
3578
|
+
" Which is: 6",
|
3553
3579
|
msg3.c_str());
|
3554
3580
|
|
3555
3581
|
const std::string msg4(
|
3556
3582
|
EqFailure("5", "6", foo_val, bar_val, false).failure_message());
|
3557
3583
|
EXPECT_STREQ(
|
3558
|
-
"
|
3559
|
-
"
|
3584
|
+
"Expected equality of these values:\n"
|
3585
|
+
" 5\n"
|
3586
|
+
" 6",
|
3560
3587
|
msg4.c_str());
|
3561
3588
|
|
3562
3589
|
const std::string msg5(
|
@@ -3564,10 +3591,11 @@ TEST(AssertionTest, EqFailure) {
|
|
3564
3591
|
std::string("\"x\""), std::string("\"y\""),
|
3565
3592
|
true).failure_message());
|
3566
3593
|
EXPECT_STREQ(
|
3567
|
-
"
|
3568
|
-
"
|
3569
|
-
"
|
3570
|
-
"
|
3594
|
+
"Expected equality of these values:\n"
|
3595
|
+
" foo\n"
|
3596
|
+
" Which is: \"x\"\n"
|
3597
|
+
" bar\n"
|
3598
|
+
" Which is: \"y\"\n"
|
3571
3599
|
"Ignoring case",
|
3572
3600
|
msg5.c_str());
|
3573
3601
|
}
|
@@ -3580,11 +3608,12 @@ TEST(AssertionTest, EqFailureWithDiff) {
|
|
3580
3608
|
const std::string msg1(
|
3581
3609
|
EqFailure("left", "right", left, right, false).failure_message());
|
3582
3610
|
EXPECT_STREQ(
|
3583
|
-
"
|
3584
|
-
"
|
3611
|
+
"Expected equality of these values:\n"
|
3612
|
+
" left\n"
|
3613
|
+
" Which is: "
|
3585
3614
|
"1\\n2XXX\\n3\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12XXX\\n13\\n14\\n15\n"
|
3586
|
-
"
|
3587
|
-
"
|
3615
|
+
" right\n"
|
3616
|
+
" Which is: 1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n11\\n12\\n13\\n14\n"
|
3588
3617
|
"With diff:\n@@ -1,5 +1,6 @@\n 1\n-2XXX\n+2\n 3\n+4\n 5\n 6\n"
|
3589
3618
|
"@@ -7,8 +8,6 @@\n 8\n 9\n-10\n 11\n-12XXX\n+12\n 13\n 14\n-15\n",
|
3590
3619
|
msg1.c_str());
|
@@ -3659,7 +3688,7 @@ TEST(AssertionTest, AssertFalseWithAssertionResult) {
|
|
3659
3688
|
}
|
3660
3689
|
|
3661
3690
|
#ifdef __BORLANDC__
|
3662
|
-
// Restores warnings after previous "#pragma option push"
|
3691
|
+
// Restores warnings after previous "#pragma option push" suppressed them
|
3663
3692
|
# pragma option pop
|
3664
3693
|
#endif
|
3665
3694
|
|
@@ -3679,9 +3708,10 @@ TEST(ExpectTest, ASSERT_EQ_Double) {
|
|
3679
3708
|
TEST(AssertionTest, ASSERT_EQ) {
|
3680
3709
|
ASSERT_EQ(5, 2 + 3);
|
3681
3710
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(5, 2*3),
|
3682
|
-
"
|
3683
|
-
"
|
3684
|
-
"
|
3711
|
+
"Expected equality of these values:\n"
|
3712
|
+
" 5\n"
|
3713
|
+
" 2*3\n"
|
3714
|
+
" Which is: 6");
|
3685
3715
|
}
|
3686
3716
|
|
3687
3717
|
// Tests ASSERT_EQ(NULL, pointer).
|
@@ -3689,7 +3719,7 @@ TEST(AssertionTest, ASSERT_EQ) {
|
|
3689
3719
|
TEST(AssertionTest, ASSERT_EQ_NULL) {
|
3690
3720
|
// A success.
|
3691
3721
|
const char* p = NULL;
|
3692
|
-
// Some older GCC versions may issue a spurious
|
3722
|
+
// Some older GCC versions may issue a spurious warning in this or the next
|
3693
3723
|
// assertion statement. This warning should not be suppressed with
|
3694
3724
|
// static_cast since the test verifies the ability to use bare NULL as the
|
3695
3725
|
// expected parameter to the macro.
|
@@ -3698,7 +3728,7 @@ TEST(AssertionTest, ASSERT_EQ_NULL) {
|
|
3698
3728
|
// A failure.
|
3699
3729
|
static int n = 0;
|
3700
3730
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(NULL, &n),
|
3701
|
-
"
|
3731
|
+
" &n\n Which is:");
|
3702
3732
|
}
|
3703
3733
|
#endif // GTEST_CAN_COMPARE_NULL
|
3704
3734
|
|
@@ -3714,7 +3744,7 @@ TEST(ExpectTest, ASSERT_EQ_0) {
|
|
3714
3744
|
|
3715
3745
|
// A failure.
|
3716
3746
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(0, 5.6),
|
3717
|
-
"
|
3747
|
+
" 0\n 5.6");
|
3718
3748
|
}
|
3719
3749
|
|
3720
3750
|
// Tests ASSERT_NE.
|
@@ -3813,7 +3843,7 @@ void TestEq1(int x) {
|
|
3813
3843
|
// Tests calling a test subroutine that's not part of a fixture.
|
3814
3844
|
TEST(AssertionTest, NonFixtureSubroutine) {
|
3815
3845
|
EXPECT_FATAL_FAILURE(TestEq1(2),
|
3816
|
-
"
|
3846
|
+
" x\n Which is: 2");
|
3817
3847
|
}
|
3818
3848
|
|
3819
3849
|
// An uncopyable class.
|
@@ -3862,7 +3892,8 @@ TEST(AssertionTest, AssertWorksWithUncopyableObject) {
|
|
3862
3892
|
EXPECT_FATAL_FAILURE(TestAssertNonPositive(),
|
3863
3893
|
"IsPositiveUncopyable(y) evaluates to false, where\ny evaluates to -1");
|
3864
3894
|
EXPECT_FATAL_FAILURE(TestAssertEqualsUncopyable(),
|
3865
|
-
|
3895
|
+
"Expected equality of these values:\n"
|
3896
|
+
" x\n Which is: 5\n y\n Which is: -1");
|
3866
3897
|
}
|
3867
3898
|
|
3868
3899
|
// Tests that uncopyable objects can be used in expects.
|
@@ -3874,7 +3905,8 @@ TEST(AssertionTest, ExpectWorksWithUncopyableObject) {
|
|
3874
3905
|
"IsPositiveUncopyable(y) evaluates to false, where\ny evaluates to -1");
|
3875
3906
|
EXPECT_EQ(x, x);
|
3876
3907
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(x, y),
|
3877
|
-
|
3908
|
+
"Expected equality of these values:\n"
|
3909
|
+
" x\n Which is: 5\n y\n Which is: -1");
|
3878
3910
|
}
|
3879
3911
|
|
3880
3912
|
enum NamedEnum {
|
@@ -3950,13 +3982,13 @@ TEST(AssertionTest, AnonymousEnum) {
|
|
3950
3982
|
|
3951
3983
|
// ICE's in C++Builder.
|
3952
3984
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(kCaseA, kCaseB),
|
3953
|
-
"
|
3985
|
+
" kCaseB\n Which is: ");
|
3954
3986
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(kCaseA, kCaseC),
|
3955
|
-
"Which is: 42");
|
3987
|
+
"\n Which is: 42");
|
3956
3988
|
# endif
|
3957
3989
|
|
3958
3990
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(kCaseA, kCaseC),
|
3959
|
-
"Which is: -1");
|
3991
|
+
"\n Which is: -1");
|
3960
3992
|
}
|
3961
3993
|
|
3962
3994
|
#endif // !GTEST_OS_MAC && !defined(__SUNPRO_CC)
|
@@ -4382,7 +4414,7 @@ TEST(ExpectTest, ExpectFalseWithAssertionResult) {
|
|
4382
4414
|
}
|
4383
4415
|
|
4384
4416
|
#ifdef __BORLANDC__
|
4385
|
-
// Restores warnings after previous "#pragma option push"
|
4417
|
+
// Restores warnings after previous "#pragma option push" suppressed them
|
4386
4418
|
# pragma option pop
|
4387
4419
|
#endif
|
4388
4420
|
|
@@ -4390,9 +4422,10 @@ TEST(ExpectTest, ExpectFalseWithAssertionResult) {
|
|
4390
4422
|
TEST(ExpectTest, EXPECT_EQ) {
|
4391
4423
|
EXPECT_EQ(5, 2 + 3);
|
4392
4424
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(5, 2*3),
|
4393
|
-
"
|
4394
|
-
"
|
4395
|
-
"
|
4425
|
+
"Expected equality of these values:\n"
|
4426
|
+
" 5\n"
|
4427
|
+
" 2*3\n"
|
4428
|
+
" Which is: 6");
|
4396
4429
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(5, 2 - 3),
|
4397
4430
|
"2 - 3");
|
4398
4431
|
}
|
@@ -4423,7 +4456,7 @@ TEST(ExpectTest, EXPECT_EQ_NULL) {
|
|
4423
4456
|
// A failure.
|
4424
4457
|
int n = 0;
|
4425
4458
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(NULL, &n),
|
4426
|
-
"
|
4459
|
+
" &n\n Which is:");
|
4427
4460
|
}
|
4428
4461
|
#endif // GTEST_CAN_COMPARE_NULL
|
4429
4462
|
|
@@ -4439,7 +4472,7 @@ TEST(ExpectTest, EXPECT_EQ_0) {
|
|
4439
4472
|
|
4440
4473
|
// A failure.
|
4441
4474
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(0, 5.6),
|
4442
|
-
"
|
4475
|
+
" 0\n 5.6");
|
4443
4476
|
}
|
4444
4477
|
|
4445
4478
|
// Tests EXPECT_NE.
|
@@ -4539,7 +4572,7 @@ TEST(ExpectTest, EXPECT_ANY_THROW) {
|
|
4539
4572
|
TEST(ExpectTest, ExpectPrecedence) {
|
4540
4573
|
EXPECT_EQ(1 < 2, true);
|
4541
4574
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(true, true && false),
|
4542
|
-
"
|
4575
|
+
" true && false\n Which is: false");
|
4543
4576
|
}
|
4544
4577
|
|
4545
4578
|
|
@@ -4686,14 +4719,14 @@ TEST(EqAssertionTest, Bool) {
|
|
4686
4719
|
EXPECT_FATAL_FAILURE({
|
4687
4720
|
bool false_value = false;
|
4688
4721
|
ASSERT_EQ(false_value, true);
|
4689
|
-
}, "
|
4722
|
+
}, " false_value\n Which is: false\n true");
|
4690
4723
|
}
|
4691
4724
|
|
4692
4725
|
// Tests using int values in {EXPECT|ASSERT}_EQ.
|
4693
4726
|
TEST(EqAssertionTest, Int) {
|
4694
4727
|
ASSERT_EQ(32, 32);
|
4695
4728
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(32, 33),
|
4696
|
-
"33");
|
4729
|
+
" 32\n 33");
|
4697
4730
|
}
|
4698
4731
|
|
4699
4732
|
// Tests using time_t values in {EXPECT|ASSERT}_EQ.
|
@@ -4710,9 +4743,9 @@ TEST(EqAssertionTest, Char) {
|
|
4710
4743
|
ASSERT_EQ('z', 'z');
|
4711
4744
|
const char ch = 'b';
|
4712
4745
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ('\0', ch),
|
4713
|
-
"ch");
|
4746
|
+
" ch\n Which is: 'b'");
|
4714
4747
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ('a', ch),
|
4715
|
-
"ch");
|
4748
|
+
" ch\n Which is: 'b'");
|
4716
4749
|
}
|
4717
4750
|
|
4718
4751
|
// Tests using wchar_t values in {EXPECT|ASSERT}_EQ.
|
@@ -4720,10 +4753,11 @@ TEST(EqAssertionTest, WideChar) {
|
|
4720
4753
|
EXPECT_EQ(L'b', L'b');
|
4721
4754
|
|
4722
4755
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(L'\0', L'x'),
|
4723
|
-
"
|
4724
|
-
"
|
4725
|
-
"
|
4726
|
-
"
|
4756
|
+
"Expected equality of these values:\n"
|
4757
|
+
" L'\0'\n"
|
4758
|
+
" Which is: L'\0' (0, 0x0)\n"
|
4759
|
+
" L'x'\n"
|
4760
|
+
" Which is: L'x' (120, 0x78)");
|
4727
4761
|
|
4728
4762
|
static wchar_t wchar;
|
4729
4763
|
wchar = L'b';
|
@@ -4731,7 +4765,7 @@ TEST(EqAssertionTest, WideChar) {
|
|
4731
4765
|
"wchar");
|
4732
4766
|
wchar = 0x8119;
|
4733
4767
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(static_cast<wchar_t>(0x8120), wchar),
|
4734
|
-
"
|
4768
|
+
" wchar\n Which is: L'");
|
4735
4769
|
}
|
4736
4770
|
|
4737
4771
|
// Tests using ::std::string values in {EXPECT|ASSERT}_EQ.
|
@@ -4760,8 +4794,7 @@ TEST(EqAssertionTest, StdString) {
|
|
4760
4794
|
static ::std::string str3(str1);
|
4761
4795
|
str3.at(2) = '\0';
|
4762
4796
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(str1, str3),
|
4763
|
-
"
|
4764
|
-
" Which is: \"A \\0 in the middle\"");
|
4797
|
+
" str3\n Which is: \"A \\0 in the middle\"");
|
4765
4798
|
}
|
4766
4799
|
|
4767
4800
|
#if GTEST_HAS_STD_WSTRING
|
@@ -4881,9 +4914,9 @@ TEST(EqAssertionTest, CharPointer) {
|
|
4881
4914
|
ASSERT_EQ(p1, p1);
|
4882
4915
|
|
4883
4916
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p0, p2),
|
4884
|
-
"
|
4917
|
+
" p2\n Which is:");
|
4885
4918
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p1, p2),
|
4886
|
-
"p2");
|
4919
|
+
" p2\n Which is:");
|
4887
4920
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(reinterpret_cast<char*>(0x1234),
|
4888
4921
|
reinterpret_cast<char*>(0xABC0)),
|
4889
4922
|
"ABC0");
|
@@ -4903,9 +4936,9 @@ TEST(EqAssertionTest, WideCharPointer) {
|
|
4903
4936
|
EXPECT_EQ(p0, p0);
|
4904
4937
|
|
4905
4938
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p0, p2),
|
4906
|
-
"
|
4939
|
+
" p2\n Which is:");
|
4907
4940
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p1, p2),
|
4908
|
-
"p2");
|
4941
|
+
" p2\n Which is:");
|
4909
4942
|
void* pv3 = (void*)0x1234; // NOLINT
|
4910
4943
|
void* pv4 = (void*)0xABC0; // NOLINT
|
4911
4944
|
const wchar_t* p3 = reinterpret_cast<const wchar_t*>(pv3);
|
@@ -5450,7 +5483,8 @@ TEST_F(SetUpTestCaseTest, Test2) {
|
|
5450
5483
|
EXPECT_STREQ("123", shared_resource_);
|
5451
5484
|
}
|
5452
5485
|
|
5453
|
-
|
5486
|
+
|
5487
|
+
// The ParseFlagsTest test case tests ParseGoogleTestFlagsOnly.
|
5454
5488
|
|
5455
5489
|
// The Flags struct stores a copy of all Google Test flags.
|
5456
5490
|
struct Flags {
|
@@ -5536,8 +5570,8 @@ struct Flags {
|
|
5536
5570
|
return flags;
|
5537
5571
|
}
|
5538
5572
|
|
5539
|
-
// Creates a Flags struct where the gtest_random_seed flag has
|
5540
|
-
//
|
5573
|
+
// Creates a Flags struct where the gtest_random_seed flag has the given
|
5574
|
+
// value.
|
5541
5575
|
static Flags RandomSeed(Int32 random_seed) {
|
5542
5576
|
Flags flags;
|
5543
5577
|
flags.random_seed = random_seed;
|
@@ -5552,8 +5586,8 @@ struct Flags {
|
|
5552
5586
|
return flags;
|
5553
5587
|
}
|
5554
5588
|
|
5555
|
-
// Creates a Flags struct where the gtest_shuffle flag has
|
5556
|
-
//
|
5589
|
+
// Creates a Flags struct where the gtest_shuffle flag has the given
|
5590
|
+
// value.
|
5557
5591
|
static Flags Shuffle(bool shuffle) {
|
5558
5592
|
Flags flags;
|
5559
5593
|
flags.shuffle = shuffle;
|
@@ -5601,8 +5635,8 @@ struct Flags {
|
|
5601
5635
|
bool throw_on_failure;
|
5602
5636
|
};
|
5603
5637
|
|
5604
|
-
// Fixture for testing
|
5605
|
-
class
|
5638
|
+
// Fixture for testing ParseGoogleTestFlagsOnly().
|
5639
|
+
class ParseFlagsTest : public Test {
|
5606
5640
|
protected:
|
5607
5641
|
// Clears the flags before each test.
|
5608
5642
|
virtual void SetUp() {
|
@@ -5663,16 +5697,16 @@ class InitGoogleTestTest : public Test {
|
|
5663
5697
|
const bool saved_help_flag = ::testing::internal::g_help_flag;
|
5664
5698
|
::testing::internal::g_help_flag = false;
|
5665
5699
|
|
5666
|
-
#if GTEST_HAS_STREAM_REDIRECTION
|
5700
|
+
# if GTEST_HAS_STREAM_REDIRECTION
|
5667
5701
|
CaptureStdout();
|
5668
|
-
#endif
|
5702
|
+
# endif
|
5669
5703
|
|
5670
5704
|
// Parses the command line.
|
5671
5705
|
internal::ParseGoogleTestFlagsOnly(&argc1, const_cast<CharType**>(argv1));
|
5672
5706
|
|
5673
|
-
#if GTEST_HAS_STREAM_REDIRECTION
|
5707
|
+
# if GTEST_HAS_STREAM_REDIRECTION
|
5674
5708
|
const std::string captured_stdout = GetCapturedStdout();
|
5675
|
-
#endif
|
5709
|
+
# endif
|
5676
5710
|
|
5677
5711
|
// Verifies the flag values.
|
5678
5712
|
CheckFlags(expected);
|
@@ -5685,7 +5719,7 @@ class InitGoogleTestTest : public Test {
|
|
5685
5719
|
// help message for the flags it recognizes.
|
5686
5720
|
EXPECT_EQ(should_print_help, ::testing::internal::g_help_flag);
|
5687
5721
|
|
5688
|
-
#if GTEST_HAS_STREAM_REDIRECTION
|
5722
|
+
# if GTEST_HAS_STREAM_REDIRECTION
|
5689
5723
|
const char* const expected_help_fragment =
|
5690
5724
|
"This program contains tests written using";
|
5691
5725
|
if (should_print_help) {
|
@@ -5694,7 +5728,7 @@ class InitGoogleTestTest : public Test {
|
|
5694
5728
|
EXPECT_PRED_FORMAT2(IsNotSubstring,
|
5695
5729
|
expected_help_fragment, captured_stdout);
|
5696
5730
|
}
|
5697
|
-
#endif // GTEST_HAS_STREAM_REDIRECTION
|
5731
|
+
# endif // GTEST_HAS_STREAM_REDIRECTION
|
5698
5732
|
|
5699
5733
|
::testing::internal::g_help_flag = saved_help_flag;
|
5700
5734
|
}
|
@@ -5702,14 +5736,14 @@ class InitGoogleTestTest : public Test {
|
|
5702
5736
|
// This macro wraps TestParsingFlags s.t. the user doesn't need
|
5703
5737
|
// to specify the array sizes.
|
5704
5738
|
|
5705
|
-
#define GTEST_TEST_PARSING_FLAGS_(argv1, argv2, expected, should_print_help) \
|
5739
|
+
# define GTEST_TEST_PARSING_FLAGS_(argv1, argv2, expected, should_print_help) \
|
5706
5740
|
TestParsingFlags(sizeof(argv1)/sizeof(*argv1) - 1, argv1, \
|
5707
5741
|
sizeof(argv2)/sizeof(*argv2) - 1, argv2, \
|
5708
5742
|
expected, should_print_help)
|
5709
5743
|
};
|
5710
5744
|
|
5711
5745
|
// Tests parsing an empty command line.
|
5712
|
-
TEST_F(
|
5746
|
+
TEST_F(ParseFlagsTest, Empty) {
|
5713
5747
|
const char* argv[] = {
|
5714
5748
|
NULL
|
5715
5749
|
};
|
@@ -5722,7 +5756,7 @@ TEST_F(InitGoogleTestTest, Empty) {
|
|
5722
5756
|
}
|
5723
5757
|
|
5724
5758
|
// Tests parsing a command line that has no flag.
|
5725
|
-
TEST_F(
|
5759
|
+
TEST_F(ParseFlagsTest, NoFlag) {
|
5726
5760
|
const char* argv[] = {
|
5727
5761
|
"foo.exe",
|
5728
5762
|
NULL
|
@@ -5737,7 +5771,7 @@ TEST_F(InitGoogleTestTest, NoFlag) {
|
|
5737
5771
|
}
|
5738
5772
|
|
5739
5773
|
// Tests parsing a bad --gtest_filter flag.
|
5740
|
-
TEST_F(
|
5774
|
+
TEST_F(ParseFlagsTest, FilterBad) {
|
5741
5775
|
const char* argv[] = {
|
5742
5776
|
"foo.exe",
|
5743
5777
|
"--gtest_filter",
|
@@ -5754,7 +5788,7 @@ TEST_F(InitGoogleTestTest, FilterBad) {
|
|
5754
5788
|
}
|
5755
5789
|
|
5756
5790
|
// Tests parsing an empty --gtest_filter flag.
|
5757
|
-
TEST_F(
|
5791
|
+
TEST_F(ParseFlagsTest, FilterEmpty) {
|
5758
5792
|
const char* argv[] = {
|
5759
5793
|
"foo.exe",
|
5760
5794
|
"--gtest_filter=",
|
@@ -5770,7 +5804,7 @@ TEST_F(InitGoogleTestTest, FilterEmpty) {
|
|
5770
5804
|
}
|
5771
5805
|
|
5772
5806
|
// Tests parsing a non-empty --gtest_filter flag.
|
5773
|
-
TEST_F(
|
5807
|
+
TEST_F(ParseFlagsTest, FilterNonEmpty) {
|
5774
5808
|
const char* argv[] = {
|
5775
5809
|
"foo.exe",
|
5776
5810
|
"--gtest_filter=abc",
|
@@ -5786,7 +5820,7 @@ TEST_F(InitGoogleTestTest, FilterNonEmpty) {
|
|
5786
5820
|
}
|
5787
5821
|
|
5788
5822
|
// Tests parsing --gtest_break_on_failure.
|
5789
|
-
TEST_F(
|
5823
|
+
TEST_F(ParseFlagsTest, BreakOnFailureWithoutValue) {
|
5790
5824
|
const char* argv[] = {
|
5791
5825
|
"foo.exe",
|
5792
5826
|
"--gtest_break_on_failure",
|
@@ -5802,7 +5836,7 @@ TEST_F(InitGoogleTestTest, BreakOnFailureWithoutValue) {
|
|
5802
5836
|
}
|
5803
5837
|
|
5804
5838
|
// Tests parsing --gtest_break_on_failure=0.
|
5805
|
-
TEST_F(
|
5839
|
+
TEST_F(ParseFlagsTest, BreakOnFailureFalse_0) {
|
5806
5840
|
const char* argv[] = {
|
5807
5841
|
"foo.exe",
|
5808
5842
|
"--gtest_break_on_failure=0",
|
@@ -5818,7 +5852,7 @@ TEST_F(InitGoogleTestTest, BreakOnFailureFalse_0) {
|
|
5818
5852
|
}
|
5819
5853
|
|
5820
5854
|
// Tests parsing --gtest_break_on_failure=f.
|
5821
|
-
TEST_F(
|
5855
|
+
TEST_F(ParseFlagsTest, BreakOnFailureFalse_f) {
|
5822
5856
|
const char* argv[] = {
|
5823
5857
|
"foo.exe",
|
5824
5858
|
"--gtest_break_on_failure=f",
|
@@ -5834,7 +5868,7 @@ TEST_F(InitGoogleTestTest, BreakOnFailureFalse_f) {
|
|
5834
5868
|
}
|
5835
5869
|
|
5836
5870
|
// Tests parsing --gtest_break_on_failure=F.
|
5837
|
-
TEST_F(
|
5871
|
+
TEST_F(ParseFlagsTest, BreakOnFailureFalse_F) {
|
5838
5872
|
const char* argv[] = {
|
5839
5873
|
"foo.exe",
|
5840
5874
|
"--gtest_break_on_failure=F",
|
@@ -5851,7 +5885,7 @@ TEST_F(InitGoogleTestTest, BreakOnFailureFalse_F) {
|
|
5851
5885
|
|
5852
5886
|
// Tests parsing a --gtest_break_on_failure flag that has a "true"
|
5853
5887
|
// definition.
|
5854
|
-
TEST_F(
|
5888
|
+
TEST_F(ParseFlagsTest, BreakOnFailureTrue) {
|
5855
5889
|
const char* argv[] = {
|
5856
5890
|
"foo.exe",
|
5857
5891
|
"--gtest_break_on_failure=1",
|
@@ -5867,7 +5901,7 @@ TEST_F(InitGoogleTestTest, BreakOnFailureTrue) {
|
|
5867
5901
|
}
|
5868
5902
|
|
5869
5903
|
// Tests parsing --gtest_catch_exceptions.
|
5870
|
-
TEST_F(
|
5904
|
+
TEST_F(ParseFlagsTest, CatchExceptions) {
|
5871
5905
|
const char* argv[] = {
|
5872
5906
|
"foo.exe",
|
5873
5907
|
"--gtest_catch_exceptions",
|
@@ -5883,7 +5917,7 @@ TEST_F(InitGoogleTestTest, CatchExceptions) {
|
|
5883
5917
|
}
|
5884
5918
|
|
5885
5919
|
// Tests parsing --gtest_death_test_use_fork.
|
5886
|
-
TEST_F(
|
5920
|
+
TEST_F(ParseFlagsTest, DeathTestUseFork) {
|
5887
5921
|
const char* argv[] = {
|
5888
5922
|
"foo.exe",
|
5889
5923
|
"--gtest_death_test_use_fork",
|
@@ -5900,7 +5934,7 @@ TEST_F(InitGoogleTestTest, DeathTestUseFork) {
|
|
5900
5934
|
|
5901
5935
|
// Tests having the same flag twice with different values. The
|
5902
5936
|
// expected behavior is that the one coming last takes precedence.
|
5903
|
-
TEST_F(
|
5937
|
+
TEST_F(ParseFlagsTest, DuplicatedFlags) {
|
5904
5938
|
const char* argv[] = {
|
5905
5939
|
"foo.exe",
|
5906
5940
|
"--gtest_filter=a",
|
@@ -5917,7 +5951,7 @@ TEST_F(InitGoogleTestTest, DuplicatedFlags) {
|
|
5917
5951
|
}
|
5918
5952
|
|
5919
5953
|
// Tests having an unrecognized flag on the command line.
|
5920
|
-
TEST_F(
|
5954
|
+
TEST_F(ParseFlagsTest, UnrecognizedFlag) {
|
5921
5955
|
const char* argv[] = {
|
5922
5956
|
"foo.exe",
|
5923
5957
|
"--gtest_break_on_failure",
|
@@ -5939,7 +5973,7 @@ TEST_F(InitGoogleTestTest, UnrecognizedFlag) {
|
|
5939
5973
|
}
|
5940
5974
|
|
5941
5975
|
// Tests having a --gtest_list_tests flag
|
5942
|
-
TEST_F(
|
5976
|
+
TEST_F(ParseFlagsTest, ListTestsFlag) {
|
5943
5977
|
const char* argv[] = {
|
5944
5978
|
"foo.exe",
|
5945
5979
|
"--gtest_list_tests",
|
@@ -5955,7 +5989,7 @@ TEST_F(InitGoogleTestTest, ListTestsFlag) {
|
|
5955
5989
|
}
|
5956
5990
|
|
5957
5991
|
// Tests having a --gtest_list_tests flag with a "true" value
|
5958
|
-
TEST_F(
|
5992
|
+
TEST_F(ParseFlagsTest, ListTestsTrue) {
|
5959
5993
|
const char* argv[] = {
|
5960
5994
|
"foo.exe",
|
5961
5995
|
"--gtest_list_tests=1",
|
@@ -5971,7 +6005,7 @@ TEST_F(InitGoogleTestTest, ListTestsTrue) {
|
|
5971
6005
|
}
|
5972
6006
|
|
5973
6007
|
// Tests having a --gtest_list_tests flag with a "false" value
|
5974
|
-
TEST_F(
|
6008
|
+
TEST_F(ParseFlagsTest, ListTestsFalse) {
|
5975
6009
|
const char* argv[] = {
|
5976
6010
|
"foo.exe",
|
5977
6011
|
"--gtest_list_tests=0",
|
@@ -5987,7 +6021,7 @@ TEST_F(InitGoogleTestTest, ListTestsFalse) {
|
|
5987
6021
|
}
|
5988
6022
|
|
5989
6023
|
// Tests parsing --gtest_list_tests=f.
|
5990
|
-
TEST_F(
|
6024
|
+
TEST_F(ParseFlagsTest, ListTestsFalse_f) {
|
5991
6025
|
const char* argv[] = {
|
5992
6026
|
"foo.exe",
|
5993
6027
|
"--gtest_list_tests=f",
|
@@ -6003,7 +6037,7 @@ TEST_F(InitGoogleTestTest, ListTestsFalse_f) {
|
|
6003
6037
|
}
|
6004
6038
|
|
6005
6039
|
// Tests parsing --gtest_list_tests=F.
|
6006
|
-
TEST_F(
|
6040
|
+
TEST_F(ParseFlagsTest, ListTestsFalse_F) {
|
6007
6041
|
const char* argv[] = {
|
6008
6042
|
"foo.exe",
|
6009
6043
|
"--gtest_list_tests=F",
|
@@ -6019,7 +6053,7 @@ TEST_F(InitGoogleTestTest, ListTestsFalse_F) {
|
|
6019
6053
|
}
|
6020
6054
|
|
6021
6055
|
// Tests parsing --gtest_output (invalid).
|
6022
|
-
TEST_F(
|
6056
|
+
TEST_F(ParseFlagsTest, OutputEmpty) {
|
6023
6057
|
const char* argv[] = {
|
6024
6058
|
"foo.exe",
|
6025
6059
|
"--gtest_output",
|
@@ -6036,7 +6070,7 @@ TEST_F(InitGoogleTestTest, OutputEmpty) {
|
|
6036
6070
|
}
|
6037
6071
|
|
6038
6072
|
// Tests parsing --gtest_output=xml
|
6039
|
-
TEST_F(
|
6073
|
+
TEST_F(ParseFlagsTest, OutputXml) {
|
6040
6074
|
const char* argv[] = {
|
6041
6075
|
"foo.exe",
|
6042
6076
|
"--gtest_output=xml",
|
@@ -6052,7 +6086,7 @@ TEST_F(InitGoogleTestTest, OutputXml) {
|
|
6052
6086
|
}
|
6053
6087
|
|
6054
6088
|
// Tests parsing --gtest_output=xml:file
|
6055
|
-
TEST_F(
|
6089
|
+
TEST_F(ParseFlagsTest, OutputXmlFile) {
|
6056
6090
|
const char* argv[] = {
|
6057
6091
|
"foo.exe",
|
6058
6092
|
"--gtest_output=xml:file",
|
@@ -6068,7 +6102,7 @@ TEST_F(InitGoogleTestTest, OutputXmlFile) {
|
|
6068
6102
|
}
|
6069
6103
|
|
6070
6104
|
// Tests parsing --gtest_output=xml:directory/path/
|
6071
|
-
TEST_F(
|
6105
|
+
TEST_F(ParseFlagsTest, OutputXmlDirectory) {
|
6072
6106
|
const char* argv[] = {
|
6073
6107
|
"foo.exe",
|
6074
6108
|
"--gtest_output=xml:directory/path/",
|
@@ -6085,7 +6119,7 @@ TEST_F(InitGoogleTestTest, OutputXmlDirectory) {
|
|
6085
6119
|
}
|
6086
6120
|
|
6087
6121
|
// Tests having a --gtest_print_time flag
|
6088
|
-
TEST_F(
|
6122
|
+
TEST_F(ParseFlagsTest, PrintTimeFlag) {
|
6089
6123
|
const char* argv[] = {
|
6090
6124
|
"foo.exe",
|
6091
6125
|
"--gtest_print_time",
|
@@ -6101,7 +6135,7 @@ TEST_F(InitGoogleTestTest, PrintTimeFlag) {
|
|
6101
6135
|
}
|
6102
6136
|
|
6103
6137
|
// Tests having a --gtest_print_time flag with a "true" value
|
6104
|
-
TEST_F(
|
6138
|
+
TEST_F(ParseFlagsTest, PrintTimeTrue) {
|
6105
6139
|
const char* argv[] = {
|
6106
6140
|
"foo.exe",
|
6107
6141
|
"--gtest_print_time=1",
|
@@ -6117,7 +6151,7 @@ TEST_F(InitGoogleTestTest, PrintTimeTrue) {
|
|
6117
6151
|
}
|
6118
6152
|
|
6119
6153
|
// Tests having a --gtest_print_time flag with a "false" value
|
6120
|
-
TEST_F(
|
6154
|
+
TEST_F(ParseFlagsTest, PrintTimeFalse) {
|
6121
6155
|
const char* argv[] = {
|
6122
6156
|
"foo.exe",
|
6123
6157
|
"--gtest_print_time=0",
|
@@ -6133,7 +6167,7 @@ TEST_F(InitGoogleTestTest, PrintTimeFalse) {
|
|
6133
6167
|
}
|
6134
6168
|
|
6135
6169
|
// Tests parsing --gtest_print_time=f.
|
6136
|
-
TEST_F(
|
6170
|
+
TEST_F(ParseFlagsTest, PrintTimeFalse_f) {
|
6137
6171
|
const char* argv[] = {
|
6138
6172
|
"foo.exe",
|
6139
6173
|
"--gtest_print_time=f",
|
@@ -6149,7 +6183,7 @@ TEST_F(InitGoogleTestTest, PrintTimeFalse_f) {
|
|
6149
6183
|
}
|
6150
6184
|
|
6151
6185
|
// Tests parsing --gtest_print_time=F.
|
6152
|
-
TEST_F(
|
6186
|
+
TEST_F(ParseFlagsTest, PrintTimeFalse_F) {
|
6153
6187
|
const char* argv[] = {
|
6154
6188
|
"foo.exe",
|
6155
6189
|
"--gtest_print_time=F",
|
@@ -6165,7 +6199,7 @@ TEST_F(InitGoogleTestTest, PrintTimeFalse_F) {
|
|
6165
6199
|
}
|
6166
6200
|
|
6167
6201
|
// Tests parsing --gtest_random_seed=number
|
6168
|
-
TEST_F(
|
6202
|
+
TEST_F(ParseFlagsTest, RandomSeed) {
|
6169
6203
|
const char* argv[] = {
|
6170
6204
|
"foo.exe",
|
6171
6205
|
"--gtest_random_seed=1000",
|
@@ -6181,7 +6215,7 @@ TEST_F(InitGoogleTestTest, RandomSeed) {
|
|
6181
6215
|
}
|
6182
6216
|
|
6183
6217
|
// Tests parsing --gtest_repeat=number
|
6184
|
-
TEST_F(
|
6218
|
+
TEST_F(ParseFlagsTest, Repeat) {
|
6185
6219
|
const char* argv[] = {
|
6186
6220
|
"foo.exe",
|
6187
6221
|
"--gtest_repeat=1000",
|
@@ -6197,7 +6231,7 @@ TEST_F(InitGoogleTestTest, Repeat) {
|
|
6197
6231
|
}
|
6198
6232
|
|
6199
6233
|
// Tests having a --gtest_also_run_disabled_tests flag
|
6200
|
-
TEST_F(
|
6234
|
+
TEST_F(ParseFlagsTest, AlsoRunDisabledTestsFlag) {
|
6201
6235
|
const char* argv[] = {
|
6202
6236
|
"foo.exe",
|
6203
6237
|
"--gtest_also_run_disabled_tests",
|
@@ -6214,7 +6248,7 @@ TEST_F(InitGoogleTestTest, AlsoRunDisabledTestsFlag) {
|
|
6214
6248
|
}
|
6215
6249
|
|
6216
6250
|
// Tests having a --gtest_also_run_disabled_tests flag with a "true" value
|
6217
|
-
TEST_F(
|
6251
|
+
TEST_F(ParseFlagsTest, AlsoRunDisabledTestsTrue) {
|
6218
6252
|
const char* argv[] = {
|
6219
6253
|
"foo.exe",
|
6220
6254
|
"--gtest_also_run_disabled_tests=1",
|
@@ -6231,7 +6265,7 @@ TEST_F(InitGoogleTestTest, AlsoRunDisabledTestsTrue) {
|
|
6231
6265
|
}
|
6232
6266
|
|
6233
6267
|
// Tests having a --gtest_also_run_disabled_tests flag with a "false" value
|
6234
|
-
TEST_F(
|
6268
|
+
TEST_F(ParseFlagsTest, AlsoRunDisabledTestsFalse) {
|
6235
6269
|
const char* argv[] = {
|
6236
6270
|
"foo.exe",
|
6237
6271
|
"--gtest_also_run_disabled_tests=0",
|
@@ -6248,7 +6282,7 @@ TEST_F(InitGoogleTestTest, AlsoRunDisabledTestsFalse) {
|
|
6248
6282
|
}
|
6249
6283
|
|
6250
6284
|
// Tests parsing --gtest_shuffle.
|
6251
|
-
TEST_F(
|
6285
|
+
TEST_F(ParseFlagsTest, ShuffleWithoutValue) {
|
6252
6286
|
const char* argv[] = {
|
6253
6287
|
"foo.exe",
|
6254
6288
|
"--gtest_shuffle",
|
@@ -6264,7 +6298,7 @@ TEST_F(InitGoogleTestTest, ShuffleWithoutValue) {
|
|
6264
6298
|
}
|
6265
6299
|
|
6266
6300
|
// Tests parsing --gtest_shuffle=0.
|
6267
|
-
TEST_F(
|
6301
|
+
TEST_F(ParseFlagsTest, ShuffleFalse_0) {
|
6268
6302
|
const char* argv[] = {
|
6269
6303
|
"foo.exe",
|
6270
6304
|
"--gtest_shuffle=0",
|
@@ -6279,9 +6313,8 @@ TEST_F(InitGoogleTestTest, ShuffleFalse_0) {
|
|
6279
6313
|
GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Shuffle(false), false);
|
6280
6314
|
}
|
6281
6315
|
|
6282
|
-
// Tests parsing a --gtest_shuffle flag that has a "true"
|
6283
|
-
|
6284
|
-
TEST_F(InitGoogleTestTest, ShuffleTrue) {
|
6316
|
+
// Tests parsing a --gtest_shuffle flag that has a "true" definition.
|
6317
|
+
TEST_F(ParseFlagsTest, ShuffleTrue) {
|
6285
6318
|
const char* argv[] = {
|
6286
6319
|
"foo.exe",
|
6287
6320
|
"--gtest_shuffle=1",
|
@@ -6297,7 +6330,7 @@ TEST_F(InitGoogleTestTest, ShuffleTrue) {
|
|
6297
6330
|
}
|
6298
6331
|
|
6299
6332
|
// Tests parsing --gtest_stack_trace_depth=number.
|
6300
|
-
TEST_F(
|
6333
|
+
TEST_F(ParseFlagsTest, StackTraceDepth) {
|
6301
6334
|
const char* argv[] = {
|
6302
6335
|
"foo.exe",
|
6303
6336
|
"--gtest_stack_trace_depth=5",
|
@@ -6312,7 +6345,7 @@ TEST_F(InitGoogleTestTest, StackTraceDepth) {
|
|
6312
6345
|
GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::StackTraceDepth(5), false);
|
6313
6346
|
}
|
6314
6347
|
|
6315
|
-
TEST_F(
|
6348
|
+
TEST_F(ParseFlagsTest, StreamResultTo) {
|
6316
6349
|
const char* argv[] = {
|
6317
6350
|
"foo.exe",
|
6318
6351
|
"--gtest_stream_result_to=localhost:1234",
|
@@ -6329,7 +6362,7 @@ TEST_F(InitGoogleTestTest, StreamResultTo) {
|
|
6329
6362
|
}
|
6330
6363
|
|
6331
6364
|
// Tests parsing --gtest_throw_on_failure.
|
6332
|
-
TEST_F(
|
6365
|
+
TEST_F(ParseFlagsTest, ThrowOnFailureWithoutValue) {
|
6333
6366
|
const char* argv[] = {
|
6334
6367
|
"foo.exe",
|
6335
6368
|
"--gtest_throw_on_failure",
|
@@ -6345,7 +6378,7 @@ TEST_F(InitGoogleTestTest, ThrowOnFailureWithoutValue) {
|
|
6345
6378
|
}
|
6346
6379
|
|
6347
6380
|
// Tests parsing --gtest_throw_on_failure=0.
|
6348
|
-
TEST_F(
|
6381
|
+
TEST_F(ParseFlagsTest, ThrowOnFailureFalse_0) {
|
6349
6382
|
const char* argv[] = {
|
6350
6383
|
"foo.exe",
|
6351
6384
|
"--gtest_throw_on_failure=0",
|
@@ -6362,7 +6395,7 @@ TEST_F(InitGoogleTestTest, ThrowOnFailureFalse_0) {
|
|
6362
6395
|
|
6363
6396
|
// Tests parsing a --gtest_throw_on_failure flag that has a "true"
|
6364
6397
|
// definition.
|
6365
|
-
TEST_F(
|
6398
|
+
TEST_F(ParseFlagsTest, ThrowOnFailureTrue) {
|
6366
6399
|
const char* argv[] = {
|
6367
6400
|
"foo.exe",
|
6368
6401
|
"--gtest_throw_on_failure=1",
|
@@ -6377,9 +6410,9 @@ TEST_F(InitGoogleTestTest, ThrowOnFailureTrue) {
|
|
6377
6410
|
GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ThrowOnFailure(true), false);
|
6378
6411
|
}
|
6379
6412
|
|
6380
|
-
#if GTEST_OS_WINDOWS
|
6413
|
+
# if GTEST_OS_WINDOWS
|
6381
6414
|
// Tests parsing wide strings.
|
6382
|
-
TEST_F(
|
6415
|
+
TEST_F(ParseFlagsTest, WideStrings) {
|
6383
6416
|
const wchar_t* argv[] = {
|
6384
6417
|
L"foo.exe",
|
6385
6418
|
L"--gtest_filter=Foo*",
|
@@ -6405,13 +6438,13 @@ TEST_F(InitGoogleTestTest, WideStrings) {
|
|
6405
6438
|
# endif // GTEST_OS_WINDOWS
|
6406
6439
|
|
6407
6440
|
#if GTEST_USE_OWN_FLAGFILE_FLAG_
|
6408
|
-
class FlagfileTest : public
|
6441
|
+
class FlagfileTest : public ParseFlagsTest {
|
6409
6442
|
public:
|
6410
6443
|
virtual void SetUp() {
|
6411
|
-
|
6444
|
+
ParseFlagsTest::SetUp();
|
6412
6445
|
|
6413
6446
|
testdata_path_.Set(internal::FilePath(
|
6414
|
-
|
6447
|
+
testing::TempDir() + internal::GetCurrentExecutableName().string() +
|
6415
6448
|
"_flagfile_test"));
|
6416
6449
|
testing::internal::posix::RmDir(testdata_path_.c_str());
|
6417
6450
|
EXPECT_TRUE(testdata_path_.CreateFolder());
|
@@ -6419,7 +6452,7 @@ class FlagfileTest : public InitGoogleTestTest {
|
|
6419
6452
|
|
6420
6453
|
virtual void TearDown() {
|
6421
6454
|
testing::internal::posix::RmDir(testdata_path_.c_str());
|
6422
|
-
|
6455
|
+
ParseFlagsTest::TearDown();
|
6423
6456
|
}
|
6424
6457
|
|
6425
6458
|
internal::FilePath CreateFlagfile(const char* contents) {
|
@@ -6558,6 +6591,7 @@ TEST_F(CurrentTestInfoTest, WorksForSecondTestInATestCase) {
|
|
6558
6591
|
|
6559
6592
|
} // namespace testing
|
6560
6593
|
|
6594
|
+
|
6561
6595
|
// These two lines test that we can define tests in a namespace that
|
6562
6596
|
// has the name "testing" and is nested in another namespace.
|
6563
6597
|
namespace my_namespace {
|
@@ -6638,7 +6672,7 @@ TEST(StreamingAssertionsTest, Truth2) {
|
|
6638
6672
|
}
|
6639
6673
|
|
6640
6674
|
#ifdef __BORLANDC__
|
6641
|
-
// Restores warnings after previous "#pragma option push"
|
6675
|
+
// Restores warnings after previous "#pragma option push" suppressed them
|
6642
6676
|
# pragma option pop
|
6643
6677
|
#endif
|
6644
6678
|
|
@@ -6888,14 +6922,6 @@ TEST(StaticAssertTypeEqTest, CompilesForEqualTypes) {
|
|
6888
6922
|
StaticAssertTypeEq<int*, IntAlias*>();
|
6889
6923
|
}
|
6890
6924
|
|
6891
|
-
TEST(GetCurrentOsStackTraceExceptTopTest, ReturnsTheStackTrace) {
|
6892
|
-
testing::UnitTest* const unit_test = testing::UnitTest::GetInstance();
|
6893
|
-
|
6894
|
-
// We don't have a stack walker in Google Test yet.
|
6895
|
-
EXPECT_STREQ("", GetCurrentOsStackTraceExceptTop(unit_test, 0).c_str());
|
6896
|
-
EXPECT_STREQ("", GetCurrentOsStackTraceExceptTop(unit_test, 1).c_str());
|
6897
|
-
}
|
6898
|
-
|
6899
6925
|
TEST(HasNonfatalFailureTest, ReturnsFalseWhenThereIsNoFailure) {
|
6900
6926
|
EXPECT_FALSE(HasNonfatalFailure());
|
6901
6927
|
}
|
@@ -7531,6 +7557,50 @@ TEST(IsContainerTestTest, WorksForContainer) {
|
|
7531
7557
|
sizeof(IsContainerTest<std::map<int, double> >(0)));
|
7532
7558
|
}
|
7533
7559
|
|
7560
|
+
#if GTEST_LANG_CXX11
|
7561
|
+
struct ConstOnlyContainerWithPointerIterator {
|
7562
|
+
using const_iterator = int*;
|
7563
|
+
const_iterator begin() const;
|
7564
|
+
const_iterator end() const;
|
7565
|
+
};
|
7566
|
+
|
7567
|
+
struct ConstOnlyContainerWithClassIterator {
|
7568
|
+
struct const_iterator {
|
7569
|
+
const int& operator*() const;
|
7570
|
+
const_iterator& operator++(/* pre-increment */);
|
7571
|
+
};
|
7572
|
+
const_iterator begin() const;
|
7573
|
+
const_iterator end() const;
|
7574
|
+
};
|
7575
|
+
|
7576
|
+
TEST(IsContainerTestTest, ConstOnlyContainer) {
|
7577
|
+
EXPECT_EQ(sizeof(IsContainer),
|
7578
|
+
sizeof(IsContainerTest<ConstOnlyContainerWithPointerIterator>(0)));
|
7579
|
+
EXPECT_EQ(sizeof(IsContainer),
|
7580
|
+
sizeof(IsContainerTest<ConstOnlyContainerWithClassIterator>(0)));
|
7581
|
+
}
|
7582
|
+
#endif // GTEST_LANG_CXX11
|
7583
|
+
|
7584
|
+
// Tests IsHashTable.
|
7585
|
+
struct AHashTable {
|
7586
|
+
typedef void hasher;
|
7587
|
+
};
|
7588
|
+
struct NotReallyAHashTable {
|
7589
|
+
typedef void hasher;
|
7590
|
+
typedef void reverse_iterator;
|
7591
|
+
};
|
7592
|
+
TEST(IsHashTable, Basic) {
|
7593
|
+
EXPECT_TRUE(testing::internal::IsHashTable<AHashTable>::value);
|
7594
|
+
EXPECT_FALSE(testing::internal::IsHashTable<NotReallyAHashTable>::value);
|
7595
|
+
#if GTEST_LANG_CXX11
|
7596
|
+
EXPECT_FALSE(testing::internal::IsHashTable<std::vector<int>>::value);
|
7597
|
+
EXPECT_TRUE(testing::internal::IsHashTable<std::unordered_set<int>>::value);
|
7598
|
+
#endif // GTEST_LANG_CXX11
|
7599
|
+
#if GTEST_HAS_HASH_SET_
|
7600
|
+
EXPECT_TRUE(testing::internal::IsHashTable<__gnu_cxx::hash_set<int>>::value);
|
7601
|
+
#endif // GTEST_HAS_HASH_SET_
|
7602
|
+
}
|
7603
|
+
|
7534
7604
|
// Tests ArrayEq().
|
7535
7605
|
|
7536
7606
|
TEST(ArrayEqTest, WorksForDegeneratedArrays) {
|
@@ -7704,3 +7774,24 @@ TEST(SkipPrefixTest, DoesNotSkipWhenPrefixDoesNotMatch) {
|
|
7704
7774
|
EXPECT_EQ(str, p);
|
7705
7775
|
}
|
7706
7776
|
|
7777
|
+
// Tests ad_hoc_test_result().
|
7778
|
+
|
7779
|
+
class AdHocTestResultTest : public testing::Test {
|
7780
|
+
protected:
|
7781
|
+
static void SetUpTestCase() {
|
7782
|
+
FAIL() << "A failure happened inside SetUpTestCase().";
|
7783
|
+
}
|
7784
|
+
};
|
7785
|
+
|
7786
|
+
TEST_F(AdHocTestResultTest, AdHocTestResultForTestCaseShowsFailure) {
|
7787
|
+
const testing::TestResult& test_result = testing::UnitTest::GetInstance()
|
7788
|
+
->current_test_case()
|
7789
|
+
->ad_hoc_test_result();
|
7790
|
+
EXPECT_TRUE(test_result.Failed());
|
7791
|
+
}
|
7792
|
+
|
7793
|
+
TEST_F(AdHocTestResultTest, AdHocTestResultTestForUnitTestDoesNotShowFailure) {
|
7794
|
+
const testing::TestResult& test_result =
|
7795
|
+
testing::UnitTest::GetInstance()->ad_hoc_test_result();
|
7796
|
+
EXPECT_FALSE(test_result.Failed());
|
7797
|
+
}
|