rj_schema 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +4 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/CMakeLists.txt +16 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/README.md +141 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CHANGES +126 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +202 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CONTRIBUTORS +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/Makefile.am +224 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/README.md +333 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/configure.ac +146 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +562 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +3675 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DesignDoc.md +280 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DevGuide.md +132 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +12 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +439 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +628 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/KnownIssues.md +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/CheatSheet.md +525 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/CookBook.md +3250 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/Documentation.md +11 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/ForDummies.md +439 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/FrequentlyAskedQuestions.md +624 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/CheatSheet.md +534 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/CookBook.md +3342 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/Documentation.md +12 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/ForDummies.md +439 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/FrequentlyAskedQuestions.md +628 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/CheatSheet.md +556 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/CookBook.md +3432 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/Documentation.md +12 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/ForDummies.md +439 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/FrequentlyAskedQuestions.md +628 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +1205 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-cardinalities.h +147 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +2377 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +794 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +1095 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +291 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +2179 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +672 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +397 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +161 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +4399 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-actions.h +246 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +58 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +1847 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +94 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +10 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +39 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-port.h +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +279 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +136 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +511 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +91 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/make/Makefile +101 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.sln +32 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.vcproj +191 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_config.vsprops +15 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_main.vcproj +187 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_test.vcproj +201 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +32 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +82 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +88 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +101 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +32 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +84 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_config.props +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +90 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +103 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +240 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/LICENSE +203 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +35 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README.cppclean +115 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/__init__.py +0 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +1733 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class.py +227 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py +448 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/keywords.py +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/tokenize.py +287 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/utils.py +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/gmock_gen.py +31 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock-config.in +303 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock_doctor.py +640 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload.py +1387 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload_gmock.py +78 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-all.cc +47 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +156 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +174 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +498 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +823 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +183 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock_main.cc +54 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +1411 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +428 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +1228 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +622 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +127 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +1286 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +699 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +5648 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +708 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +424 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-port_test.cc +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +2644 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_all_test.cc +51 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_ex_test.cc +81 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test.py +108 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test_.cc +100 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +669 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +180 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +291 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +310 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +322 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +220 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +112 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CHANGES +157 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +286 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CONTRIBUTORS +37 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/Makefile.am +310 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/README.md +280 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +242 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.cbproj +138 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.groupproj +54 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_all.cc +38 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_link.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_main.cbproj +82 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_unittest.cbproj +88 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/configure.ac +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/AdvancedGuide.md +2182 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/DevGuide.md +126 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Documentation.md +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/FAQ.md +1087 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Primer.md +502 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +177 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Samples.md +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_AdvancedGuide.md +2096 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_Documentation.md +12 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_FAQ.md +886 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_Primer.md +497 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_PumpManual.md +177 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_XcodeGuide.md +93 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_AdvancedGuide.md +2178 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Documentation.md +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_FAQ.md +1038 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Primer.md +501 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_PumpManual.md +177 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Samples.md +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_XcodeGuide.md +93 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_AdvancedGuide.md +2181 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Documentation.md +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_FAQ.md +1082 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Primer.md +501 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_PumpManual.md +177 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Samples.md +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_XcodeGuide.md +93 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +93 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +294 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +250 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +1444 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +510 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +993 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +232 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-test-part.h +179 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +263 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +2236 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +358 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +58 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +69 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +319 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +206 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +1238 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-linked_ptr.h +243 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +5146 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +286 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +731 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +93 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +2554 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +167 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h +1020 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h.pump +347 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +3331 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +297 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/acx_pthread.m4 +363 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/gtest.m4 +74 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/make/Makefile +82 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest-md.sln +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest-md.vcproj +126 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest.sln +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest.vcproj +126 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_main-md.vcproj +129 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_main.vcproj +129 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_prod_test-md.vcproj +164 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_prod_test.vcproj +164 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_unittest-md.vcproj +147 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_unittest.vcproj +147 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +123 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.h +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +144 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +153 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.cc +56 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.h +85 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +109 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3-inl.h +172 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +151 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.cc +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.h +53 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +199 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +224 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +130 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +173 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +160 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/common.py +83 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +253 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +730 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gtest-config.in +274 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/pump.py +855 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/release_docs.py +158 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/test/Makefile +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +1387 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload_gtest.py +78 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +1342 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +387 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +1183 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +1259 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +373 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +110 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +118 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +5388 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +38 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_ex_test.cc +93 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +1427 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +662 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-linked_ptr_test.cc +154 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +311 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-message_test.cc +159 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +215 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +65 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +1055 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +57 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +1304 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +1635 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-test-part_test.cc +208 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-tuple_test.cc +320 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +380 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.h +66 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +341 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +47 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +212 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +88 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +237 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +311 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +130 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +71 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +117 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +126 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +192 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +636 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +140 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +172 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test_.cc +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +207 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest_.cc +157 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_no_test_unittest.cc +56 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +340 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +1062 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +743 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +2427 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_premature_exit_test.cc +127 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +57 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +253 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test.py +325 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test_.cc +103 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_sole_header_test.cc +57 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +256 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +320 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc +92 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +171 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test_.cc +72 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +70 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +7706 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +49 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +49 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +132 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +308 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +181 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +194 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.cc +36 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.h +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/DebugProject.xcconfig +30 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/FrameworkTarget.xcconfig +17 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/General.xcconfig +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/ReleaseProject.xcconfig +32 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/StaticLibraryTarget.xcconfig +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/TestTarget.xcconfig +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Resources/Info.plist +30 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/Info.plist +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj +457 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/runtests.sh +62 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.cc +63 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.h +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget_test.cc +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/runtests.sh +65 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +100 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +1135 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/travis.sh +15 -0
- data/ext/rj_schema/rj_schema.cpp +64 -41
- data/lib/rj_schema.rb +1 -1
- metadata +378 -5
data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
// Copyright 2006, Google Inc.
|
2
|
+
// All rights reserved.
|
3
|
+
//
|
4
|
+
// Redistribution and use in source and binary forms, with or without
|
5
|
+
// modification, are permitted provided that the following conditions are
|
6
|
+
// met:
|
7
|
+
//
|
8
|
+
// * Redistributions of source code must retain the above copyright
|
9
|
+
// notice, this list of conditions and the following disclaimer.
|
10
|
+
// * Redistributions in binary form must reproduce the above
|
11
|
+
// copyright notice, this list of conditions and the following disclaimer
|
12
|
+
// in the documentation and/or other materials provided with the
|
13
|
+
// distribution.
|
14
|
+
// * Neither the name of Google Inc. nor the names of its
|
15
|
+
// contributors may be used to endorse or promote products derived from
|
16
|
+
// this software without specific prior written permission.
|
17
|
+
//
|
18
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
20
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
21
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
22
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
23
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
24
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
25
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
26
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
27
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
+
//
|
30
|
+
// Author: wan@google.com (Zhanyong Wan)
|
31
|
+
|
32
|
+
// Unit test for Google Test's break-on-failure mode.
|
33
|
+
//
|
34
|
+
// A user can ask Google Test to seg-fault when an assertion fails, using
|
35
|
+
// either the GTEST_BREAK_ON_FAILURE environment variable or the
|
36
|
+
// --gtest_break_on_failure flag. This file is used for testing such
|
37
|
+
// functionality.
|
38
|
+
//
|
39
|
+
// This program will be invoked from a Python unit test. It is
|
40
|
+
// expected to fail. Don't run it directly.
|
41
|
+
|
42
|
+
#include "gtest/gtest.h"
|
43
|
+
|
44
|
+
#if GTEST_OS_WINDOWS
|
45
|
+
# include <windows.h>
|
46
|
+
# include <stdlib.h>
|
47
|
+
#endif
|
48
|
+
|
49
|
+
namespace {
|
50
|
+
|
51
|
+
// A test that's expected to fail.
|
52
|
+
TEST(Foo, Bar) {
|
53
|
+
EXPECT_EQ(2, 3);
|
54
|
+
}
|
55
|
+
|
56
|
+
#if GTEST_HAS_SEH && !GTEST_OS_WINDOWS_MOBILE
|
57
|
+
// On Windows Mobile global exception handlers are not supported.
|
58
|
+
LONG WINAPI ExitWithExceptionCode(
|
59
|
+
struct _EXCEPTION_POINTERS* exception_pointers) {
|
60
|
+
exit(exception_pointers->ExceptionRecord->ExceptionCode);
|
61
|
+
}
|
62
|
+
#endif
|
63
|
+
|
64
|
+
} // namespace
|
65
|
+
|
66
|
+
int main(int argc, char **argv) {
|
67
|
+
#if GTEST_OS_WINDOWS
|
68
|
+
// Suppresses display of the Windows error dialog upon encountering
|
69
|
+
// a general protection fault (segment violation).
|
70
|
+
SetErrorMode(SEM_NOGPFAULTERRORBOX | SEM_FAILCRITICALERRORS);
|
71
|
+
|
72
|
+
# if GTEST_HAS_SEH && !GTEST_OS_WINDOWS_MOBILE
|
73
|
+
|
74
|
+
// The default unhandled exception filter does not always exit
|
75
|
+
// with the exception code as exit code - for example it exits with
|
76
|
+
// 0 for EXCEPTION_ACCESS_VIOLATION and 1 for EXCEPTION_BREAKPOINT
|
77
|
+
// if the application is compiled in debug mode. Thus we use our own
|
78
|
+
// filter which always exits with the exception code for unhandled
|
79
|
+
// exceptions.
|
80
|
+
SetUnhandledExceptionFilter(ExitWithExceptionCode);
|
81
|
+
|
82
|
+
# endif
|
83
|
+
#endif
|
84
|
+
|
85
|
+
testing::InitGoogleTest(&argc, argv);
|
86
|
+
|
87
|
+
return RUN_ALL_TESTS();
|
88
|
+
}
|
@@ -0,0 +1,237 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
#
|
3
|
+
# Copyright 2010 Google Inc. 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
|
+
|
31
|
+
"""Tests Google Test's exception catching behavior.
|
32
|
+
|
33
|
+
This script invokes gtest_catch_exceptions_test_ and
|
34
|
+
gtest_catch_exceptions_ex_test_ (programs written with
|
35
|
+
Google Test) and verifies their output.
|
36
|
+
"""
|
37
|
+
|
38
|
+
__author__ = 'vladl@google.com (Vlad Losev)'
|
39
|
+
|
40
|
+
import os
|
41
|
+
|
42
|
+
import gtest_test_utils
|
43
|
+
|
44
|
+
# Constants.
|
45
|
+
FLAG_PREFIX = '--gtest_'
|
46
|
+
LIST_TESTS_FLAG = FLAG_PREFIX + 'list_tests'
|
47
|
+
NO_CATCH_EXCEPTIONS_FLAG = FLAG_PREFIX + 'catch_exceptions=0'
|
48
|
+
FILTER_FLAG = FLAG_PREFIX + 'filter'
|
49
|
+
|
50
|
+
# Path to the gtest_catch_exceptions_ex_test_ binary, compiled with
|
51
|
+
# exceptions enabled.
|
52
|
+
EX_EXE_PATH = gtest_test_utils.GetTestExecutablePath(
|
53
|
+
'gtest_catch_exceptions_ex_test_')
|
54
|
+
|
55
|
+
# Path to the gtest_catch_exceptions_test_ binary, compiled with
|
56
|
+
# exceptions disabled.
|
57
|
+
EXE_PATH = gtest_test_utils.GetTestExecutablePath(
|
58
|
+
'gtest_catch_exceptions_no_ex_test_')
|
59
|
+
|
60
|
+
environ = gtest_test_utils.environ
|
61
|
+
SetEnvVar = gtest_test_utils.SetEnvVar
|
62
|
+
|
63
|
+
# Tests in this file run a Google-Test-based test program and expect it
|
64
|
+
# to terminate prematurely. Therefore they are incompatible with
|
65
|
+
# the premature-exit-file protocol by design. Unset the
|
66
|
+
# premature-exit filepath to prevent Google Test from creating
|
67
|
+
# the file.
|
68
|
+
SetEnvVar(gtest_test_utils.PREMATURE_EXIT_FILE_ENV_VAR, None)
|
69
|
+
|
70
|
+
TEST_LIST = gtest_test_utils.Subprocess(
|
71
|
+
[EXE_PATH, LIST_TESTS_FLAG], env=environ).output
|
72
|
+
|
73
|
+
SUPPORTS_SEH_EXCEPTIONS = 'ThrowsSehException' in TEST_LIST
|
74
|
+
|
75
|
+
if SUPPORTS_SEH_EXCEPTIONS:
|
76
|
+
BINARY_OUTPUT = gtest_test_utils.Subprocess([EXE_PATH], env=environ).output
|
77
|
+
|
78
|
+
EX_BINARY_OUTPUT = gtest_test_utils.Subprocess(
|
79
|
+
[EX_EXE_PATH], env=environ).output
|
80
|
+
|
81
|
+
|
82
|
+
# The tests.
|
83
|
+
if SUPPORTS_SEH_EXCEPTIONS:
|
84
|
+
# pylint:disable-msg=C6302
|
85
|
+
class CatchSehExceptionsTest(gtest_test_utils.TestCase):
|
86
|
+
"""Tests exception-catching behavior."""
|
87
|
+
|
88
|
+
|
89
|
+
def TestSehExceptions(self, test_output):
|
90
|
+
self.assert_('SEH exception with code 0x2a thrown '
|
91
|
+
'in the test fixture\'s constructor'
|
92
|
+
in test_output)
|
93
|
+
self.assert_('SEH exception with code 0x2a thrown '
|
94
|
+
'in the test fixture\'s destructor'
|
95
|
+
in test_output)
|
96
|
+
self.assert_('SEH exception with code 0x2a thrown in SetUpTestCase()'
|
97
|
+
in test_output)
|
98
|
+
self.assert_('SEH exception with code 0x2a thrown in TearDownTestCase()'
|
99
|
+
in test_output)
|
100
|
+
self.assert_('SEH exception with code 0x2a thrown in SetUp()'
|
101
|
+
in test_output)
|
102
|
+
self.assert_('SEH exception with code 0x2a thrown in TearDown()'
|
103
|
+
in test_output)
|
104
|
+
self.assert_('SEH exception with code 0x2a thrown in the test body'
|
105
|
+
in test_output)
|
106
|
+
|
107
|
+
def testCatchesSehExceptionsWithCxxExceptionsEnabled(self):
|
108
|
+
self.TestSehExceptions(EX_BINARY_OUTPUT)
|
109
|
+
|
110
|
+
def testCatchesSehExceptionsWithCxxExceptionsDisabled(self):
|
111
|
+
self.TestSehExceptions(BINARY_OUTPUT)
|
112
|
+
|
113
|
+
|
114
|
+
class CatchCxxExceptionsTest(gtest_test_utils.TestCase):
|
115
|
+
"""Tests C++ exception-catching behavior.
|
116
|
+
|
117
|
+
Tests in this test case verify that:
|
118
|
+
* C++ exceptions are caught and logged as C++ (not SEH) exceptions
|
119
|
+
* Exception thrown affect the remainder of the test work flow in the
|
120
|
+
expected manner.
|
121
|
+
"""
|
122
|
+
|
123
|
+
def testCatchesCxxExceptionsInFixtureConstructor(self):
|
124
|
+
self.assert_('C++ exception with description '
|
125
|
+
'"Standard C++ exception" thrown '
|
126
|
+
'in the test fixture\'s constructor'
|
127
|
+
in EX_BINARY_OUTPUT)
|
128
|
+
self.assert_('unexpected' not in EX_BINARY_OUTPUT,
|
129
|
+
'This failure belongs in this test only if '
|
130
|
+
'"CxxExceptionInConstructorTest" (no quotes) '
|
131
|
+
'appears on the same line as words "called unexpectedly"')
|
132
|
+
|
133
|
+
if ('CxxExceptionInDestructorTest.ThrowsExceptionInDestructor' in
|
134
|
+
EX_BINARY_OUTPUT):
|
135
|
+
|
136
|
+
def testCatchesCxxExceptionsInFixtureDestructor(self):
|
137
|
+
self.assert_('C++ exception with description '
|
138
|
+
'"Standard C++ exception" thrown '
|
139
|
+
'in the test fixture\'s destructor'
|
140
|
+
in EX_BINARY_OUTPUT)
|
141
|
+
self.assert_('CxxExceptionInDestructorTest::TearDownTestCase() '
|
142
|
+
'called as expected.'
|
143
|
+
in EX_BINARY_OUTPUT)
|
144
|
+
|
145
|
+
def testCatchesCxxExceptionsInSetUpTestCase(self):
|
146
|
+
self.assert_('C++ exception with description "Standard C++ exception"'
|
147
|
+
' thrown in SetUpTestCase()'
|
148
|
+
in EX_BINARY_OUTPUT)
|
149
|
+
self.assert_('CxxExceptionInConstructorTest::TearDownTestCase() '
|
150
|
+
'called as expected.'
|
151
|
+
in EX_BINARY_OUTPUT)
|
152
|
+
self.assert_('CxxExceptionInSetUpTestCaseTest constructor '
|
153
|
+
'called as expected.'
|
154
|
+
in EX_BINARY_OUTPUT)
|
155
|
+
self.assert_('CxxExceptionInSetUpTestCaseTest destructor '
|
156
|
+
'called as expected.'
|
157
|
+
in EX_BINARY_OUTPUT)
|
158
|
+
self.assert_('CxxExceptionInSetUpTestCaseTest::SetUp() '
|
159
|
+
'called as expected.'
|
160
|
+
in EX_BINARY_OUTPUT)
|
161
|
+
self.assert_('CxxExceptionInSetUpTestCaseTest::TearDown() '
|
162
|
+
'called as expected.'
|
163
|
+
in EX_BINARY_OUTPUT)
|
164
|
+
self.assert_('CxxExceptionInSetUpTestCaseTest test body '
|
165
|
+
'called as expected.'
|
166
|
+
in EX_BINARY_OUTPUT)
|
167
|
+
|
168
|
+
def testCatchesCxxExceptionsInTearDownTestCase(self):
|
169
|
+
self.assert_('C++ exception with description "Standard C++ exception"'
|
170
|
+
' thrown in TearDownTestCase()'
|
171
|
+
in EX_BINARY_OUTPUT)
|
172
|
+
|
173
|
+
def testCatchesCxxExceptionsInSetUp(self):
|
174
|
+
self.assert_('C++ exception with description "Standard C++ exception"'
|
175
|
+
' thrown in SetUp()'
|
176
|
+
in EX_BINARY_OUTPUT)
|
177
|
+
self.assert_('CxxExceptionInSetUpTest::TearDownTestCase() '
|
178
|
+
'called as expected.'
|
179
|
+
in EX_BINARY_OUTPUT)
|
180
|
+
self.assert_('CxxExceptionInSetUpTest destructor '
|
181
|
+
'called as expected.'
|
182
|
+
in EX_BINARY_OUTPUT)
|
183
|
+
self.assert_('CxxExceptionInSetUpTest::TearDown() '
|
184
|
+
'called as expected.'
|
185
|
+
in EX_BINARY_OUTPUT)
|
186
|
+
self.assert_('unexpected' not in EX_BINARY_OUTPUT,
|
187
|
+
'This failure belongs in this test only if '
|
188
|
+
'"CxxExceptionInSetUpTest" (no quotes) '
|
189
|
+
'appears on the same line as words "called unexpectedly"')
|
190
|
+
|
191
|
+
def testCatchesCxxExceptionsInTearDown(self):
|
192
|
+
self.assert_('C++ exception with description "Standard C++ exception"'
|
193
|
+
' thrown in TearDown()'
|
194
|
+
in EX_BINARY_OUTPUT)
|
195
|
+
self.assert_('CxxExceptionInTearDownTest::TearDownTestCase() '
|
196
|
+
'called as expected.'
|
197
|
+
in EX_BINARY_OUTPUT)
|
198
|
+
self.assert_('CxxExceptionInTearDownTest destructor '
|
199
|
+
'called as expected.'
|
200
|
+
in EX_BINARY_OUTPUT)
|
201
|
+
|
202
|
+
def testCatchesCxxExceptionsInTestBody(self):
|
203
|
+
self.assert_('C++ exception with description "Standard C++ exception"'
|
204
|
+
' thrown in the test body'
|
205
|
+
in EX_BINARY_OUTPUT)
|
206
|
+
self.assert_('CxxExceptionInTestBodyTest::TearDownTestCase() '
|
207
|
+
'called as expected.'
|
208
|
+
in EX_BINARY_OUTPUT)
|
209
|
+
self.assert_('CxxExceptionInTestBodyTest destructor '
|
210
|
+
'called as expected.'
|
211
|
+
in EX_BINARY_OUTPUT)
|
212
|
+
self.assert_('CxxExceptionInTestBodyTest::TearDown() '
|
213
|
+
'called as expected.'
|
214
|
+
in EX_BINARY_OUTPUT)
|
215
|
+
|
216
|
+
def testCatchesNonStdCxxExceptions(self):
|
217
|
+
self.assert_('Unknown C++ exception thrown in the test body'
|
218
|
+
in EX_BINARY_OUTPUT)
|
219
|
+
|
220
|
+
def testUnhandledCxxExceptionsAbortTheProgram(self):
|
221
|
+
# Filters out SEH exception tests on Windows. Unhandled SEH exceptions
|
222
|
+
# cause tests to show pop-up windows there.
|
223
|
+
FITLER_OUT_SEH_TESTS_FLAG = FILTER_FLAG + '=-*Seh*'
|
224
|
+
# By default, Google Test doesn't catch the exceptions.
|
225
|
+
uncaught_exceptions_ex_binary_output = gtest_test_utils.Subprocess(
|
226
|
+
[EX_EXE_PATH,
|
227
|
+
NO_CATCH_EXCEPTIONS_FLAG,
|
228
|
+
FITLER_OUT_SEH_TESTS_FLAG],
|
229
|
+
env=environ).output
|
230
|
+
|
231
|
+
self.assert_('Unhandled C++ exception terminating the program'
|
232
|
+
in uncaught_exceptions_ex_binary_output)
|
233
|
+
self.assert_('unexpected' not in uncaught_exceptions_ex_binary_output)
|
234
|
+
|
235
|
+
|
236
|
+
if __name__ == '__main__':
|
237
|
+
gtest_test_utils.Main()
|
@@ -0,0 +1,311 @@
|
|
1
|
+
// Copyright 2010, Google Inc.
|
2
|
+
// All rights reserved.
|
3
|
+
//
|
4
|
+
// Redistribution and use in source and binary forms, with or without
|
5
|
+
// modification, are permitted provided that the following conditions are
|
6
|
+
// met:
|
7
|
+
//
|
8
|
+
// * Redistributions of source code must retain the above copyright
|
9
|
+
// notice, this list of conditions and the following disclaimer.
|
10
|
+
// * Redistributions in binary form must reproduce the above
|
11
|
+
// copyright notice, this list of conditions and the following disclaimer
|
12
|
+
// in the documentation and/or other materials provided with the
|
13
|
+
// distribution.
|
14
|
+
// * Neither the name of Google Inc. nor the names of its
|
15
|
+
// contributors may be used to endorse or promote products derived from
|
16
|
+
// this software without specific prior written permission.
|
17
|
+
//
|
18
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
20
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
21
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
22
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
23
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
24
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
25
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
26
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
27
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
+
//
|
30
|
+
// Author: vladl@google.com (Vlad Losev)
|
31
|
+
//
|
32
|
+
// Tests for Google Test itself. Tests in this file throw C++ or SEH
|
33
|
+
// exceptions, and the output is verified by gtest_catch_exceptions_test.py.
|
34
|
+
|
35
|
+
#include "gtest/gtest.h"
|
36
|
+
|
37
|
+
#include <stdio.h> // NOLINT
|
38
|
+
#include <stdlib.h> // For exit().
|
39
|
+
|
40
|
+
#if GTEST_HAS_SEH
|
41
|
+
# include <windows.h>
|
42
|
+
#endif
|
43
|
+
|
44
|
+
#if GTEST_HAS_EXCEPTIONS
|
45
|
+
# include <exception> // For set_terminate().
|
46
|
+
# include <stdexcept>
|
47
|
+
#endif
|
48
|
+
|
49
|
+
using testing::Test;
|
50
|
+
|
51
|
+
#if GTEST_HAS_SEH
|
52
|
+
|
53
|
+
class SehExceptionInConstructorTest : public Test {
|
54
|
+
public:
|
55
|
+
SehExceptionInConstructorTest() { RaiseException(42, 0, 0, NULL); }
|
56
|
+
};
|
57
|
+
|
58
|
+
TEST_F(SehExceptionInConstructorTest, ThrowsExceptionInConstructor) {}
|
59
|
+
|
60
|
+
class SehExceptionInDestructorTest : public Test {
|
61
|
+
public:
|
62
|
+
~SehExceptionInDestructorTest() { RaiseException(42, 0, 0, NULL); }
|
63
|
+
};
|
64
|
+
|
65
|
+
TEST_F(SehExceptionInDestructorTest, ThrowsExceptionInDestructor) {}
|
66
|
+
|
67
|
+
class SehExceptionInSetUpTestCaseTest : public Test {
|
68
|
+
public:
|
69
|
+
static void SetUpTestCase() { RaiseException(42, 0, 0, NULL); }
|
70
|
+
};
|
71
|
+
|
72
|
+
TEST_F(SehExceptionInSetUpTestCaseTest, ThrowsExceptionInSetUpTestCase) {}
|
73
|
+
|
74
|
+
class SehExceptionInTearDownTestCaseTest : public Test {
|
75
|
+
public:
|
76
|
+
static void TearDownTestCase() { RaiseException(42, 0, 0, NULL); }
|
77
|
+
};
|
78
|
+
|
79
|
+
TEST_F(SehExceptionInTearDownTestCaseTest, ThrowsExceptionInTearDownTestCase) {}
|
80
|
+
|
81
|
+
class SehExceptionInSetUpTest : public Test {
|
82
|
+
protected:
|
83
|
+
virtual void SetUp() { RaiseException(42, 0, 0, NULL); }
|
84
|
+
};
|
85
|
+
|
86
|
+
TEST_F(SehExceptionInSetUpTest, ThrowsExceptionInSetUp) {}
|
87
|
+
|
88
|
+
class SehExceptionInTearDownTest : public Test {
|
89
|
+
protected:
|
90
|
+
virtual void TearDown() { RaiseException(42, 0, 0, NULL); }
|
91
|
+
};
|
92
|
+
|
93
|
+
TEST_F(SehExceptionInTearDownTest, ThrowsExceptionInTearDown) {}
|
94
|
+
|
95
|
+
TEST(SehExceptionTest, ThrowsSehException) {
|
96
|
+
RaiseException(42, 0, 0, NULL);
|
97
|
+
}
|
98
|
+
|
99
|
+
#endif // GTEST_HAS_SEH
|
100
|
+
|
101
|
+
#if GTEST_HAS_EXCEPTIONS
|
102
|
+
|
103
|
+
class CxxExceptionInConstructorTest : public Test {
|
104
|
+
public:
|
105
|
+
CxxExceptionInConstructorTest() {
|
106
|
+
// Without this macro VC++ complains about unreachable code at the end of
|
107
|
+
// the constructor.
|
108
|
+
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(
|
109
|
+
throw std::runtime_error("Standard C++ exception"));
|
110
|
+
}
|
111
|
+
|
112
|
+
static void TearDownTestCase() {
|
113
|
+
printf("%s",
|
114
|
+
"CxxExceptionInConstructorTest::TearDownTestCase() "
|
115
|
+
"called as expected.\n");
|
116
|
+
}
|
117
|
+
|
118
|
+
protected:
|
119
|
+
~CxxExceptionInConstructorTest() {
|
120
|
+
ADD_FAILURE() << "CxxExceptionInConstructorTest destructor "
|
121
|
+
<< "called unexpectedly.";
|
122
|
+
}
|
123
|
+
|
124
|
+
virtual void SetUp() {
|
125
|
+
ADD_FAILURE() << "CxxExceptionInConstructorTest::SetUp() "
|
126
|
+
<< "called unexpectedly.";
|
127
|
+
}
|
128
|
+
|
129
|
+
virtual void TearDown() {
|
130
|
+
ADD_FAILURE() << "CxxExceptionInConstructorTest::TearDown() "
|
131
|
+
<< "called unexpectedly.";
|
132
|
+
}
|
133
|
+
};
|
134
|
+
|
135
|
+
TEST_F(CxxExceptionInConstructorTest, ThrowsExceptionInConstructor) {
|
136
|
+
ADD_FAILURE() << "CxxExceptionInConstructorTest test body "
|
137
|
+
<< "called unexpectedly.";
|
138
|
+
}
|
139
|
+
|
140
|
+
// Exceptions in destructors are not supported in C++11.
|
141
|
+
#if !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L
|
142
|
+
class CxxExceptionInDestructorTest : public Test {
|
143
|
+
public:
|
144
|
+
static void TearDownTestCase() {
|
145
|
+
printf("%s",
|
146
|
+
"CxxExceptionInDestructorTest::TearDownTestCase() "
|
147
|
+
"called as expected.\n");
|
148
|
+
}
|
149
|
+
|
150
|
+
protected:
|
151
|
+
~CxxExceptionInDestructorTest() {
|
152
|
+
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(
|
153
|
+
throw std::runtime_error("Standard C++ exception"));
|
154
|
+
}
|
155
|
+
};
|
156
|
+
|
157
|
+
TEST_F(CxxExceptionInDestructorTest, ThrowsExceptionInDestructor) {}
|
158
|
+
#endif // C++11 mode
|
159
|
+
|
160
|
+
class CxxExceptionInSetUpTestCaseTest : public Test {
|
161
|
+
public:
|
162
|
+
CxxExceptionInSetUpTestCaseTest() {
|
163
|
+
printf("%s",
|
164
|
+
"CxxExceptionInSetUpTestCaseTest constructor "
|
165
|
+
"called as expected.\n");
|
166
|
+
}
|
167
|
+
|
168
|
+
static void SetUpTestCase() {
|
169
|
+
throw std::runtime_error("Standard C++ exception");
|
170
|
+
}
|
171
|
+
|
172
|
+
static void TearDownTestCase() {
|
173
|
+
printf("%s",
|
174
|
+
"CxxExceptionInSetUpTestCaseTest::TearDownTestCase() "
|
175
|
+
"called as expected.\n");
|
176
|
+
}
|
177
|
+
|
178
|
+
protected:
|
179
|
+
~CxxExceptionInSetUpTestCaseTest() {
|
180
|
+
printf("%s",
|
181
|
+
"CxxExceptionInSetUpTestCaseTest destructor "
|
182
|
+
"called as expected.\n");
|
183
|
+
}
|
184
|
+
|
185
|
+
virtual void SetUp() {
|
186
|
+
printf("%s",
|
187
|
+
"CxxExceptionInSetUpTestCaseTest::SetUp() "
|
188
|
+
"called as expected.\n");
|
189
|
+
}
|
190
|
+
|
191
|
+
virtual void TearDown() {
|
192
|
+
printf("%s",
|
193
|
+
"CxxExceptionInSetUpTestCaseTest::TearDown() "
|
194
|
+
"called as expected.\n");
|
195
|
+
}
|
196
|
+
};
|
197
|
+
|
198
|
+
TEST_F(CxxExceptionInSetUpTestCaseTest, ThrowsExceptionInSetUpTestCase) {
|
199
|
+
printf("%s",
|
200
|
+
"CxxExceptionInSetUpTestCaseTest test body "
|
201
|
+
"called as expected.\n");
|
202
|
+
}
|
203
|
+
|
204
|
+
class CxxExceptionInTearDownTestCaseTest : public Test {
|
205
|
+
public:
|
206
|
+
static void TearDownTestCase() {
|
207
|
+
throw std::runtime_error("Standard C++ exception");
|
208
|
+
}
|
209
|
+
};
|
210
|
+
|
211
|
+
TEST_F(CxxExceptionInTearDownTestCaseTest, ThrowsExceptionInTearDownTestCase) {}
|
212
|
+
|
213
|
+
class CxxExceptionInSetUpTest : public Test {
|
214
|
+
public:
|
215
|
+
static void TearDownTestCase() {
|
216
|
+
printf("%s",
|
217
|
+
"CxxExceptionInSetUpTest::TearDownTestCase() "
|
218
|
+
"called as expected.\n");
|
219
|
+
}
|
220
|
+
|
221
|
+
protected:
|
222
|
+
~CxxExceptionInSetUpTest() {
|
223
|
+
printf("%s",
|
224
|
+
"CxxExceptionInSetUpTest destructor "
|
225
|
+
"called as expected.\n");
|
226
|
+
}
|
227
|
+
|
228
|
+
virtual void SetUp() { throw std::runtime_error("Standard C++ exception"); }
|
229
|
+
|
230
|
+
virtual void TearDown() {
|
231
|
+
printf("%s",
|
232
|
+
"CxxExceptionInSetUpTest::TearDown() "
|
233
|
+
"called as expected.\n");
|
234
|
+
}
|
235
|
+
};
|
236
|
+
|
237
|
+
TEST_F(CxxExceptionInSetUpTest, ThrowsExceptionInSetUp) {
|
238
|
+
ADD_FAILURE() << "CxxExceptionInSetUpTest test body "
|
239
|
+
<< "called unexpectedly.";
|
240
|
+
}
|
241
|
+
|
242
|
+
class CxxExceptionInTearDownTest : public Test {
|
243
|
+
public:
|
244
|
+
static void TearDownTestCase() {
|
245
|
+
printf("%s",
|
246
|
+
"CxxExceptionInTearDownTest::TearDownTestCase() "
|
247
|
+
"called as expected.\n");
|
248
|
+
}
|
249
|
+
|
250
|
+
protected:
|
251
|
+
~CxxExceptionInTearDownTest() {
|
252
|
+
printf("%s",
|
253
|
+
"CxxExceptionInTearDownTest destructor "
|
254
|
+
"called as expected.\n");
|
255
|
+
}
|
256
|
+
|
257
|
+
virtual void TearDown() {
|
258
|
+
throw std::runtime_error("Standard C++ exception");
|
259
|
+
}
|
260
|
+
};
|
261
|
+
|
262
|
+
TEST_F(CxxExceptionInTearDownTest, ThrowsExceptionInTearDown) {}
|
263
|
+
|
264
|
+
class CxxExceptionInTestBodyTest : public Test {
|
265
|
+
public:
|
266
|
+
static void TearDownTestCase() {
|
267
|
+
printf("%s",
|
268
|
+
"CxxExceptionInTestBodyTest::TearDownTestCase() "
|
269
|
+
"called as expected.\n");
|
270
|
+
}
|
271
|
+
|
272
|
+
protected:
|
273
|
+
~CxxExceptionInTestBodyTest() {
|
274
|
+
printf("%s",
|
275
|
+
"CxxExceptionInTestBodyTest destructor "
|
276
|
+
"called as expected.\n");
|
277
|
+
}
|
278
|
+
|
279
|
+
virtual void TearDown() {
|
280
|
+
printf("%s",
|
281
|
+
"CxxExceptionInTestBodyTest::TearDown() "
|
282
|
+
"called as expected.\n");
|
283
|
+
}
|
284
|
+
};
|
285
|
+
|
286
|
+
TEST_F(CxxExceptionInTestBodyTest, ThrowsStdCxxException) {
|
287
|
+
throw std::runtime_error("Standard C++ exception");
|
288
|
+
}
|
289
|
+
|
290
|
+
TEST(CxxExceptionTest, ThrowsNonStdCxxException) {
|
291
|
+
throw "C-string";
|
292
|
+
}
|
293
|
+
|
294
|
+
// This terminate handler aborts the program using exit() rather than abort().
|
295
|
+
// This avoids showing pop-ups on Windows systems and core dumps on Unix-like
|
296
|
+
// ones.
|
297
|
+
void TerminateHandler() {
|
298
|
+
fprintf(stderr, "%s\n", "Unhandled C++ exception terminating the program.");
|
299
|
+
fflush(NULL);
|
300
|
+
exit(3);
|
301
|
+
}
|
302
|
+
|
303
|
+
#endif // GTEST_HAS_EXCEPTIONS
|
304
|
+
|
305
|
+
int main(int argc, char** argv) {
|
306
|
+
#if GTEST_HAS_EXCEPTIONS
|
307
|
+
std::set_terminate(&TerminateHandler);
|
308
|
+
#endif
|
309
|
+
testing::InitGoogleTest(&argc, argv);
|
310
|
+
return RUN_ALL_TESTS();
|
311
|
+
}
|