rj_schema 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. checksums.yaml +5 -5
  2. data/Rakefile +4 -0
  3. data/ext/rj_schema/rapidjson/thirdparty/gtest/CMakeLists.txt +16 -0
  4. data/ext/rj_schema/rapidjson/thirdparty/gtest/README.md +141 -0
  5. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CHANGES +126 -0
  6. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +202 -0
  7. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CONTRIBUTORS +40 -0
  8. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/LICENSE +28 -0
  9. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/Makefile.am +224 -0
  10. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/README.md +333 -0
  11. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/configure.ac +146 -0
  12. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +562 -0
  13. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +3675 -0
  14. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DesignDoc.md +280 -0
  15. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DevGuide.md +132 -0
  16. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +12 -0
  17. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +439 -0
  18. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +628 -0
  19. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/KnownIssues.md +19 -0
  20. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/CheatSheet.md +525 -0
  21. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/CookBook.md +3250 -0
  22. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/Documentation.md +11 -0
  23. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/ForDummies.md +439 -0
  24. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/FrequentlyAskedQuestions.md +624 -0
  25. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/CheatSheet.md +534 -0
  26. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/CookBook.md +3342 -0
  27. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/Documentation.md +12 -0
  28. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/ForDummies.md +439 -0
  29. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/FrequentlyAskedQuestions.md +628 -0
  30. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/CheatSheet.md +556 -0
  31. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/CookBook.md +3432 -0
  32. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/Documentation.md +12 -0
  33. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/ForDummies.md +439 -0
  34. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/FrequentlyAskedQuestions.md +628 -0
  35. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +1205 -0
  36. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-cardinalities.h +147 -0
  37. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +2377 -0
  38. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +794 -0
  39. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +1095 -0
  40. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +291 -0
  41. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +2179 -0
  42. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +672 -0
  43. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +397 -0
  44. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +161 -0
  45. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +4399 -0
  46. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-actions.h +246 -0
  47. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +58 -0
  48. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +1847 -0
  49. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +94 -0
  50. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +8 -0
  51. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +10 -0
  52. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +39 -0
  53. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-port.h +46 -0
  54. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +279 -0
  55. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +136 -0
  56. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +511 -0
  57. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +91 -0
  58. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/make/Makefile +101 -0
  59. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.sln +32 -0
  60. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.vcproj +191 -0
  61. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_config.vsprops +15 -0
  62. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_main.vcproj +187 -0
  63. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_test.vcproj +201 -0
  64. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +32 -0
  65. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +82 -0
  66. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +19 -0
  67. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +88 -0
  68. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +101 -0
  69. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +32 -0
  70. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +84 -0
  71. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_config.props +19 -0
  72. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +90 -0
  73. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +103 -0
  74. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +240 -0
  75. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/LICENSE +203 -0
  76. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +35 -0
  77. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README.cppclean +115 -0
  78. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/__init__.py +0 -0
  79. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +1733 -0
  80. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class.py +227 -0
  81. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py +448 -0
  82. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/keywords.py +59 -0
  83. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/tokenize.py +287 -0
  84. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/utils.py +41 -0
  85. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/gmock_gen.py +31 -0
  86. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock-config.in +303 -0
  87. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock_doctor.py +640 -0
  88. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload.py +1387 -0
  89. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload_gmock.py +78 -0
  90. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-all.cc +47 -0
  91. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +156 -0
  92. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +174 -0
  93. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +498 -0
  94. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +823 -0
  95. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +183 -0
  96. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock_main.cc +54 -0
  97. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +1411 -0
  98. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +428 -0
  99. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +1228 -0
  100. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +622 -0
  101. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +127 -0
  102. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +1286 -0
  103. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +699 -0
  104. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +5648 -0
  105. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +708 -0
  106. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +424 -0
  107. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-port_test.cc +43 -0
  108. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +2644 -0
  109. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_all_test.cc +51 -0
  110. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_ex_test.cc +81 -0
  111. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test.py +108 -0
  112. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test_.cc +100 -0
  113. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +40 -0
  114. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +40 -0
  115. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +669 -0
  116. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +180 -0
  117. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +291 -0
  118. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +310 -0
  119. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +322 -0
  120. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +220 -0
  121. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +112 -0
  122. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CHANGES +157 -0
  123. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +286 -0
  124. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CONTRIBUTORS +37 -0
  125. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/LICENSE +28 -0
  126. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/Makefile.am +310 -0
  127. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/README.md +280 -0
  128. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +242 -0
  129. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.cbproj +138 -0
  130. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.groupproj +54 -0
  131. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_all.cc +38 -0
  132. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_link.cc +40 -0
  133. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_main.cbproj +82 -0
  134. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_unittest.cbproj +88 -0
  135. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/configure.ac +68 -0
  136. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/AdvancedGuide.md +2182 -0
  137. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/DevGuide.md +126 -0
  138. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Documentation.md +14 -0
  139. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/FAQ.md +1087 -0
  140. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Primer.md +502 -0
  141. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +177 -0
  142. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Samples.md +14 -0
  143. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_AdvancedGuide.md +2096 -0
  144. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_Documentation.md +12 -0
  145. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_FAQ.md +886 -0
  146. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_Primer.md +497 -0
  147. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_PumpManual.md +177 -0
  148. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_XcodeGuide.md +93 -0
  149. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_AdvancedGuide.md +2178 -0
  150. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Documentation.md +14 -0
  151. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_FAQ.md +1038 -0
  152. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Primer.md +501 -0
  153. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_PumpManual.md +177 -0
  154. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Samples.md +14 -0
  155. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_XcodeGuide.md +93 -0
  156. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_AdvancedGuide.md +2181 -0
  157. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Documentation.md +14 -0
  158. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_FAQ.md +1082 -0
  159. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Primer.md +501 -0
  160. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_PumpManual.md +177 -0
  161. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Samples.md +14 -0
  162. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_XcodeGuide.md +93 -0
  163. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +93 -0
  164. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +294 -0
  165. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +250 -0
  166. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +1444 -0
  167. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +510 -0
  168. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +993 -0
  169. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +232 -0
  170. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-test-part.h +179 -0
  171. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +263 -0
  172. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +2236 -0
  173. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +358 -0
  174. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +58 -0
  175. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +69 -0
  176. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
  177. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +41 -0
  178. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +319 -0
  179. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +206 -0
  180. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +1238 -0
  181. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-linked_ptr.h +243 -0
  182. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +5146 -0
  183. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +286 -0
  184. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +731 -0
  185. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +93 -0
  186. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +2554 -0
  187. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +167 -0
  188. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h +1020 -0
  189. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h.pump +347 -0
  190. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +3331 -0
  191. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +297 -0
  192. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/acx_pthread.m4 +363 -0
  193. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/gtest.m4 +74 -0
  194. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/make/Makefile +82 -0
  195. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest-md.sln +45 -0
  196. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest-md.vcproj +126 -0
  197. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest.sln +45 -0
  198. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest.vcproj +126 -0
  199. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_main-md.vcproj +129 -0
  200. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_main.vcproj +129 -0
  201. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_prod_test-md.vcproj +164 -0
  202. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_prod_test.vcproj +164 -0
  203. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_unittest-md.vcproj +147 -0
  204. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_unittest.vcproj +147 -0
  205. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +123 -0
  206. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +68 -0
  207. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.h +43 -0
  208. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +144 -0
  209. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +153 -0
  210. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.cc +56 -0
  211. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.h +85 -0
  212. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +109 -0
  213. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3-inl.h +172 -0
  214. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +151 -0
  215. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.cc +46 -0
  216. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.h +53 -0
  217. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +45 -0
  218. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +199 -0
  219. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +224 -0
  220. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +130 -0
  221. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +173 -0
  222. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +160 -0
  223. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/common.py +83 -0
  224. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +253 -0
  225. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +730 -0
  226. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gtest-config.in +274 -0
  227. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/pump.py +855 -0
  228. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/release_docs.py +158 -0
  229. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/test/Makefile +59 -0
  230. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +1387 -0
  231. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload_gtest.py +78 -0
  232. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +48 -0
  233. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +1342 -0
  234. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +387 -0
  235. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +1183 -0
  236. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +1259 -0
  237. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +373 -0
  238. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +110 -0
  239. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +118 -0
  240. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +5388 -0
  241. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +38 -0
  242. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_ex_test.cc +93 -0
  243. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +1427 -0
  244. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +662 -0
  245. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-linked_ptr_test.cc +154 -0
  246. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +311 -0
  247. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-message_test.cc +159 -0
  248. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +215 -0
  249. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +65 -0
  250. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +1055 -0
  251. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +57 -0
  252. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +1304 -0
  253. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +1635 -0
  254. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-test-part_test.cc +208 -0
  255. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-tuple_test.cc +320 -0
  256. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +45 -0
  257. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +380 -0
  258. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.h +66 -0
  259. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +341 -0
  260. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +47 -0
  261. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +212 -0
  262. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +88 -0
  263. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +237 -0
  264. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +311 -0
  265. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +130 -0
  266. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +71 -0
  267. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +117 -0
  268. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +126 -0
  269. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +192 -0
  270. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +636 -0
  271. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +140 -0
  272. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +172 -0
  273. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test_.cc +46 -0
  274. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +207 -0
  275. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest_.cc +157 -0
  276. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +45 -0
  277. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_no_test_unittest.cc +56 -0
  278. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +340 -0
  279. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +1062 -0
  280. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +743 -0
  281. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +2427 -0
  282. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_premature_exit_test.cc +127 -0
  283. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +57 -0
  284. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +253 -0
  285. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test.py +325 -0
  286. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test_.cc +103 -0
  287. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_sole_header_test.cc +57 -0
  288. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +256 -0
  289. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +320 -0
  290. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc +92 -0
  291. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +171 -0
  292. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test_.cc +72 -0
  293. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +70 -0
  294. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +43 -0
  295. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +7706 -0
  296. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +49 -0
  297. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +49 -0
  298. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +132 -0
  299. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +308 -0
  300. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +181 -0
  301. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +194 -0
  302. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.cc +36 -0
  303. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.h +55 -0
  304. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/DebugProject.xcconfig +30 -0
  305. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/FrameworkTarget.xcconfig +17 -0
  306. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/General.xcconfig +41 -0
  307. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/ReleaseProject.xcconfig +32 -0
  308. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/StaticLibraryTarget.xcconfig +18 -0
  309. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/TestTarget.xcconfig +8 -0
  310. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Resources/Info.plist +30 -0
  311. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/Info.plist +28 -0
  312. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj +457 -0
  313. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/runtests.sh +62 -0
  314. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.cc +63 -0
  315. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.h +59 -0
  316. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget_test.cc +68 -0
  317. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/runtests.sh +65 -0
  318. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +100 -0
  319. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +1135 -0
  320. data/ext/rj_schema/rapidjson/thirdparty/gtest/travis.sh +15 -0
  321. data/ext/rj_schema/rj_schema.cpp +64 -41
  322. data/lib/rj_schema.rb +1 -1
  323. metadata +378 -5
@@ -0,0 +1,51 @@
1
+ // Copyright 2009, 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
+ // Tests for Google C++ Mocking Framework (Google Mock)
33
+ //
34
+ // Some users use a build system that Google Mock doesn't support directly,
35
+ // yet they still want to build and run Google Mock's own tests. This file
36
+ // includes most such tests, making it easier for these users to maintain
37
+ // their build scripts (they just need to build this file, even though the
38
+ // below list of actual *_test.cc files might change).
39
+ #include "test/gmock-actions_test.cc"
40
+ #include "test/gmock-cardinalities_test.cc"
41
+ #include "test/gmock-generated-actions_test.cc"
42
+ #include "test/gmock-generated-function-mockers_test.cc"
43
+ #include "test/gmock-generated-internal-utils_test.cc"
44
+ #include "test/gmock-generated-matchers_test.cc"
45
+ #include "test/gmock-internal-utils_test.cc"
46
+ #include "test/gmock-matchers_test.cc"
47
+ #include "test/gmock-more-actions_test.cc"
48
+ #include "test/gmock-nice-strict_test.cc"
49
+ #include "test/gmock-port_test.cc"
50
+ #include "test/gmock-spec-builders_test.cc"
51
+ #include "test/gmock_test.cc"
@@ -0,0 +1,81 @@
1
+ // Copyright 2013, 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
+ // Tests Google Mock's functionality that depends on exceptions.
33
+
34
+ #include "gmock/gmock.h"
35
+ #include "gtest/gtest.h"
36
+
37
+ namespace {
38
+
39
+ using testing::HasSubstr;
40
+ using testing::internal::GoogleTestFailureException;
41
+
42
+ // A type that cannot be default constructed.
43
+ class NonDefaultConstructible {
44
+ public:
45
+ explicit NonDefaultConstructible(int /* dummy */) {}
46
+ };
47
+
48
+ class MockFoo {
49
+ public:
50
+ // A mock method that returns a user-defined type. Google Mock
51
+ // doesn't know what the default value for this type is.
52
+ MOCK_METHOD0(GetNonDefaultConstructible, NonDefaultConstructible());
53
+ };
54
+
55
+ #if GTEST_HAS_EXCEPTIONS
56
+
57
+ TEST(DefaultValueTest, ThrowsRuntimeErrorWhenNoDefaultValue) {
58
+ MockFoo mock;
59
+ try {
60
+ // No expectation is set on this method, so Google Mock must
61
+ // return the default value. However, since Google Mock knows
62
+ // nothing about the return type, it doesn't know what to return,
63
+ // and has to throw (when exceptions are enabled) or abort
64
+ // (otherwise).
65
+ mock.GetNonDefaultConstructible();
66
+ FAIL() << "GetNonDefaultConstructible()'s return type has no default "
67
+ << "value, so Google Mock should have thrown.";
68
+ } catch (const GoogleTestFailureException& /* unused */) {
69
+ FAIL() << "Google Test does not try to catch an exception of type "
70
+ << "GoogleTestFailureException, which is used for reporting "
71
+ << "a failure to other testing frameworks. Google Mock should "
72
+ << "not throw a GoogleTestFailureException as it will kill the "
73
+ << "entire test program instead of just the current TEST.";
74
+ } catch (const std::exception& ex) {
75
+ EXPECT_THAT(ex.what(), HasSubstr("has no default value"));
76
+ }
77
+ }
78
+
79
+ #endif
80
+
81
+ } // unnamed namespace
@@ -0,0 +1,108 @@
1
+ #!/usr/bin/env python
2
+ #
3
+ # Copyright 2009, Google Inc.
4
+ # All rights reserved.
5
+ #
6
+ # Redistribution and use in source and binary forms, with or without
7
+ # modification, are permitted provided that the following conditions are
8
+ # met:
9
+ #
10
+ # * Redistributions of source code must retain the above copyright
11
+ # notice, this list of conditions and the following disclaimer.
12
+ # * Redistributions in binary form must reproduce the above
13
+ # copyright notice, this list of conditions and the following disclaimer
14
+ # in the documentation and/or other materials provided with the
15
+ # distribution.
16
+ # * Neither the name of Google Inc. nor the names of its
17
+ # contributors may be used to endorse or promote products derived from
18
+ # this software without specific prior written permission.
19
+ #
20
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+
32
+ """Tests that leaked mock objects can be caught be Google Mock."""
33
+
34
+ __author__ = 'wan@google.com (Zhanyong Wan)'
35
+
36
+
37
+ import gmock_test_utils
38
+
39
+
40
+ PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_')
41
+ TEST_WITH_EXPECT_CALL = [PROGRAM_PATH, '--gtest_filter=*ExpectCall*']
42
+ TEST_WITH_ON_CALL = [PROGRAM_PATH, '--gtest_filter=*OnCall*']
43
+ TEST_MULTIPLE_LEAKS = [PROGRAM_PATH, '--gtest_filter=*MultipleLeaked*']
44
+
45
+ environ = gmock_test_utils.environ
46
+ SetEnvVar = gmock_test_utils.SetEnvVar
47
+
48
+ # Tests in this file run a Google-Test-based test program and expect it
49
+ # to terminate prematurely. Therefore they are incompatible with
50
+ # the premature-exit-file protocol by design. Unset the
51
+ # premature-exit filepath to prevent Google Test from creating
52
+ # the file.
53
+ SetEnvVar(gmock_test_utils.PREMATURE_EXIT_FILE_ENV_VAR, None)
54
+
55
+
56
+ class GMockLeakTest(gmock_test_utils.TestCase):
57
+
58
+ def testCatchesLeakedMockByDefault(self):
59
+ self.assertNotEqual(
60
+ 0,
61
+ gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL,
62
+ env=environ).exit_code)
63
+ self.assertNotEqual(
64
+ 0,
65
+ gmock_test_utils.Subprocess(TEST_WITH_ON_CALL,
66
+ env=environ).exit_code)
67
+
68
+ def testDoesNotCatchLeakedMockWhenDisabled(self):
69
+ self.assertEquals(
70
+ 0,
71
+ gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL +
72
+ ['--gmock_catch_leaked_mocks=0'],
73
+ env=environ).exit_code)
74
+ self.assertEquals(
75
+ 0,
76
+ gmock_test_utils.Subprocess(TEST_WITH_ON_CALL +
77
+ ['--gmock_catch_leaked_mocks=0'],
78
+ env=environ).exit_code)
79
+
80
+ def testCatchesLeakedMockWhenEnabled(self):
81
+ self.assertNotEqual(
82
+ 0,
83
+ gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL +
84
+ ['--gmock_catch_leaked_mocks'],
85
+ env=environ).exit_code)
86
+ self.assertNotEqual(
87
+ 0,
88
+ gmock_test_utils.Subprocess(TEST_WITH_ON_CALL +
89
+ ['--gmock_catch_leaked_mocks'],
90
+ env=environ).exit_code)
91
+
92
+ def testCatchesLeakedMockWhenEnabledWithExplictFlagValue(self):
93
+ self.assertNotEqual(
94
+ 0,
95
+ gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL +
96
+ ['--gmock_catch_leaked_mocks=1'],
97
+ env=environ).exit_code)
98
+
99
+ def testCatchesMultipleLeakedMocks(self):
100
+ self.assertNotEqual(
101
+ 0,
102
+ gmock_test_utils.Subprocess(TEST_MULTIPLE_LEAKS +
103
+ ['--gmock_catch_leaked_mocks'],
104
+ env=environ).exit_code)
105
+
106
+
107
+ if __name__ == '__main__':
108
+ gmock_test_utils.Main()
@@ -0,0 +1,100 @@
1
+ // Copyright 2009, Google Inc.
2
+ // All rights reserved.
3
+ //
4
+ // Redistribution and use in source and binary forms, with or without
5
+ // modification, are permitted provided that the following conditions are
6
+ // met:
7
+ //
8
+ // * Redistributions of source code must retain the above copyright
9
+ // notice, this list of conditions and the following disclaimer.
10
+ // * Redistributions in binary form must reproduce the above
11
+ // copyright notice, this list of conditions and the following disclaimer
12
+ // in the documentation and/or other materials provided with the
13
+ // distribution.
14
+ // * Neither the name of Google Inc. nor the names of its
15
+ // contributors may be used to endorse or promote products derived from
16
+ // this software without specific prior written permission.
17
+ //
18
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
+ //
30
+ // Author: wan@google.com (Zhanyong Wan)
31
+
32
+ // Google Mock - a framework for writing C++ mock classes.
33
+ //
34
+ // This program is for verifying that a leaked mock object can be
35
+ // caught by Google Mock's leak detector.
36
+
37
+ #include "gmock/gmock.h"
38
+
39
+ namespace {
40
+
41
+ using ::testing::Return;
42
+
43
+ class FooInterface {
44
+ public:
45
+ virtual ~FooInterface() {}
46
+ virtual void DoThis() = 0;
47
+ };
48
+
49
+ class MockFoo : public FooInterface {
50
+ public:
51
+ MockFoo() {}
52
+
53
+ MOCK_METHOD0(DoThis, void());
54
+
55
+ private:
56
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo);
57
+ };
58
+
59
+ TEST(LeakTest, LeakedMockWithExpectCallCausesFailureWhenLeakCheckingIsEnabled) {
60
+ MockFoo* foo = new MockFoo;
61
+
62
+ EXPECT_CALL(*foo, DoThis());
63
+ foo->DoThis();
64
+
65
+ // In order to test the leak detector, we deliberately leak foo.
66
+
67
+ // Makes sure Google Mock's leak detector can change the exit code
68
+ // to 1 even when the code is already exiting with 0.
69
+ exit(0);
70
+ }
71
+
72
+ TEST(LeakTest, LeakedMockWithOnCallCausesFailureWhenLeakCheckingIsEnabled) {
73
+ MockFoo* foo = new MockFoo;
74
+
75
+ ON_CALL(*foo, DoThis()).WillByDefault(Return());
76
+
77
+ // In order to test the leak detector, we deliberately leak foo.
78
+
79
+ // Makes sure Google Mock's leak detector can change the exit code
80
+ // to 1 even when the code is already exiting with 0.
81
+ exit(0);
82
+ }
83
+
84
+ TEST(LeakTest, CatchesMultipleLeakedMockObjects) {
85
+ MockFoo* foo1 = new MockFoo;
86
+ MockFoo* foo2 = new MockFoo;
87
+
88
+ ON_CALL(*foo1, DoThis()).WillByDefault(Return());
89
+ EXPECT_CALL(*foo2, DoThis());
90
+ foo2->DoThis();
91
+
92
+ // In order to test the leak detector, we deliberately leak foo1 and
93
+ // foo2.
94
+
95
+ // Makes sure Google Mock's leak detector can change the exit code
96
+ // to 1 even when the code is already exiting with 0.
97
+ exit(0);
98
+ }
99
+
100
+ } // namespace
@@ -0,0 +1,40 @@
1
+ // Copyright 2008, Google Inc.
2
+ // All rights reserved.
3
+ //
4
+ // Redistribution and use in source and binary forms, with or without
5
+ // modification, are permitted provided that the following conditions are
6
+ // met:
7
+ //
8
+ // * Redistributions of source code must retain the above copyright
9
+ // notice, this list of conditions and the following disclaimer.
10
+ // * Redistributions in binary form must reproduce the above
11
+ // copyright notice, this list of conditions and the following disclaimer
12
+ // in the documentation and/or other materials provided with the
13
+ // distribution.
14
+ // * Neither the name of Google Inc. nor the names of its
15
+ // contributors may be used to endorse or promote products derived from
16
+ // this software without specific prior written permission.
17
+ //
18
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
+ //
30
+ // Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
31
+
32
+ // Google Mock - a framework for writing C++ mock classes.
33
+ //
34
+ // This file is for verifying that various Google Mock constructs do not
35
+ // produce linker errors when instantiated in different translation units.
36
+ // Please see gmock_link_test.h for details.
37
+
38
+ #define LinkTest LinkTest2
39
+
40
+ #include "test/gmock_link_test.h"
@@ -0,0 +1,40 @@
1
+ // Copyright 2008, Google Inc.
2
+ // All rights reserved.
3
+ //
4
+ // Redistribution and use in source and binary forms, with or without
5
+ // modification, are permitted provided that the following conditions are
6
+ // met:
7
+ //
8
+ // * Redistributions of source code must retain the above copyright
9
+ // notice, this list of conditions and the following disclaimer.
10
+ // * Redistributions in binary form must reproduce the above
11
+ // copyright notice, this list of conditions and the following disclaimer
12
+ // in the documentation and/or other materials provided with the
13
+ // distribution.
14
+ // * Neither the name of Google Inc. nor the names of its
15
+ // contributors may be used to endorse or promote products derived from
16
+ // this software without specific prior written permission.
17
+ //
18
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
+ //
30
+ // Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
31
+
32
+ // Google Mock - a framework for writing C++ mock classes.
33
+ //
34
+ // This file is for verifying that various Google Mock constructs do not
35
+ // produce linker errors when instantiated in different translation units.
36
+ // Please see gmock_link_test.h for details.
37
+
38
+ #define LinkTest LinkTest1
39
+
40
+ #include "test/gmock_link_test.h"
@@ -0,0 +1,669 @@
1
+ // Copyright 2009, 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
+ // Google Mock - a framework for writing C++ mock classes.
33
+ //
34
+ // This file tests that:
35
+ // a. A header file defining a mock class can be included in multiple
36
+ // translation units without causing a link error.
37
+ // b. Actions and matchers can be instantiated with identical template
38
+ // arguments in different translation units without causing link
39
+ // errors.
40
+ // The following constructs are currently tested:
41
+ // Actions:
42
+ // Return()
43
+ // Return(value)
44
+ // ReturnNull
45
+ // ReturnRef
46
+ // Assign
47
+ // SetArgPointee
48
+ // SetArrayArgument
49
+ // SetErrnoAndReturn
50
+ // Invoke(function)
51
+ // Invoke(object, method)
52
+ // InvokeWithoutArgs(function)
53
+ // InvokeWithoutArgs(object, method)
54
+ // InvokeArgument
55
+ // WithArg
56
+ // WithArgs
57
+ // WithoutArgs
58
+ // DoAll
59
+ // DoDefault
60
+ // IgnoreResult
61
+ // Throw
62
+ // ACTION()-generated
63
+ // ACTION_P()-generated
64
+ // ACTION_P2()-generated
65
+ // Matchers:
66
+ // _
67
+ // A
68
+ // An
69
+ // Eq
70
+ // Gt, Lt, Ge, Le, Ne
71
+ // NotNull
72
+ // Ref
73
+ // TypedEq
74
+ // DoubleEq
75
+ // FloatEq
76
+ // NanSensitiveDoubleEq
77
+ // NanSensitiveFloatEq
78
+ // ContainsRegex
79
+ // MatchesRegex
80
+ // EndsWith
81
+ // HasSubstr
82
+ // StartsWith
83
+ // StrCaseEq
84
+ // StrCaseNe
85
+ // StrEq
86
+ // StrNe
87
+ // ElementsAre
88
+ // ElementsAreArray
89
+ // ContainerEq
90
+ // Field
91
+ // Property
92
+ // ResultOf(function)
93
+ // Pointee
94
+ // Truly(predicate)
95
+ // AllOf
96
+ // AnyOf
97
+ // Not
98
+ // MatcherCast<T>
99
+ //
100
+ // Please note: this test does not verify the functioning of these
101
+ // constructs, only that the programs using them will link successfully.
102
+ //
103
+ // Implementation note:
104
+ // This test requires identical definitions of Interface and Mock to be
105
+ // included in different translation units. We achieve this by writing
106
+ // them in this header and #including it in gmock_link_test.cc and
107
+ // gmock_link2_test.cc. Because the symbols generated by the compiler for
108
+ // those constructs must be identical in both translation units,
109
+ // definitions of Interface and Mock tests MUST be kept in the SAME
110
+ // NON-ANONYMOUS namespace in this file. The test fixture class LinkTest
111
+ // is defined as LinkTest1 in gmock_link_test.cc and as LinkTest2 in
112
+ // gmock_link2_test.cc to avoid producing linker errors.
113
+
114
+ #ifndef GMOCK_TEST_GMOCK_LINK_TEST_H_
115
+ #define GMOCK_TEST_GMOCK_LINK_TEST_H_
116
+
117
+ #include "gmock/gmock.h"
118
+
119
+ #if !GTEST_OS_WINDOWS_MOBILE
120
+ # include <errno.h>
121
+ #endif
122
+
123
+ #include "gmock/internal/gmock-port.h"
124
+ #include "gtest/gtest.h"
125
+ #include <iostream>
126
+ #include <vector>
127
+
128
+ using testing::_;
129
+ using testing::A;
130
+ using testing::AllOf;
131
+ using testing::AnyOf;
132
+ using testing::Assign;
133
+ using testing::ContainerEq;
134
+ using testing::DoAll;
135
+ using testing::DoDefault;
136
+ using testing::DoubleEq;
137
+ using testing::ElementsAre;
138
+ using testing::ElementsAreArray;
139
+ using testing::EndsWith;
140
+ using testing::Eq;
141
+ using testing::Field;
142
+ using testing::FloatEq;
143
+ using testing::Ge;
144
+ using testing::Gt;
145
+ using testing::HasSubstr;
146
+ using testing::IgnoreResult;
147
+ using testing::Invoke;
148
+ using testing::InvokeArgument;
149
+ using testing::InvokeWithoutArgs;
150
+ using testing::IsNull;
151
+ using testing::Le;
152
+ using testing::Lt;
153
+ using testing::Matcher;
154
+ using testing::MatcherCast;
155
+ using testing::NanSensitiveDoubleEq;
156
+ using testing::NanSensitiveFloatEq;
157
+ using testing::Ne;
158
+ using testing::Not;
159
+ using testing::NotNull;
160
+ using testing::Pointee;
161
+ using testing::Property;
162
+ using testing::Ref;
163
+ using testing::ResultOf;
164
+ using testing::Return;
165
+ using testing::ReturnNull;
166
+ using testing::ReturnRef;
167
+ using testing::SetArgPointee;
168
+ using testing::SetArrayArgument;
169
+ using testing::StartsWith;
170
+ using testing::StrCaseEq;
171
+ using testing::StrCaseNe;
172
+ using testing::StrEq;
173
+ using testing::StrNe;
174
+ using testing::Truly;
175
+ using testing::TypedEq;
176
+ using testing::WithArg;
177
+ using testing::WithArgs;
178
+ using testing::WithoutArgs;
179
+
180
+ #if !GTEST_OS_WINDOWS_MOBILE
181
+ using testing::SetErrnoAndReturn;
182
+ #endif
183
+
184
+ #if GTEST_HAS_EXCEPTIONS
185
+ using testing::Throw;
186
+ #endif
187
+
188
+ using testing::ContainsRegex;
189
+ using testing::MatchesRegex;
190
+
191
+ class Interface {
192
+ public:
193
+ virtual ~Interface() {}
194
+ virtual void VoidFromString(char* str) = 0;
195
+ virtual char* StringFromString(char* str) = 0;
196
+ virtual int IntFromString(char* str) = 0;
197
+ virtual int& IntRefFromString(char* str) = 0;
198
+ virtual void VoidFromFunc(void(*func)(char* str)) = 0;
199
+ virtual void VoidFromIntRef(int& n) = 0; // NOLINT
200
+ virtual void VoidFromFloat(float n) = 0;
201
+ virtual void VoidFromDouble(double n) = 0;
202
+ virtual void VoidFromVector(const std::vector<int>& v) = 0;
203
+ };
204
+
205
+ class Mock: public Interface {
206
+ public:
207
+ Mock() {}
208
+
209
+ MOCK_METHOD1(VoidFromString, void(char* str));
210
+ MOCK_METHOD1(StringFromString, char*(char* str));
211
+ MOCK_METHOD1(IntFromString, int(char* str));
212
+ MOCK_METHOD1(IntRefFromString, int&(char* str));
213
+ MOCK_METHOD1(VoidFromFunc, void(void(*func)(char* str)));
214
+ MOCK_METHOD1(VoidFromIntRef, void(int& n)); // NOLINT
215
+ MOCK_METHOD1(VoidFromFloat, void(float n));
216
+ MOCK_METHOD1(VoidFromDouble, void(double n));
217
+ MOCK_METHOD1(VoidFromVector, void(const std::vector<int>& v));
218
+
219
+ private:
220
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(Mock);
221
+ };
222
+
223
+ class InvokeHelper {
224
+ public:
225
+ static void StaticVoidFromVoid() {}
226
+ void VoidFromVoid() {}
227
+ static void StaticVoidFromString(char* /* str */) {}
228
+ void VoidFromString(char* /* str */) {}
229
+ static int StaticIntFromString(char* /* str */) { return 1; }
230
+ static bool StaticBoolFromString(const char* /* str */) { return true; }
231
+ };
232
+
233
+ class FieldHelper {
234
+ public:
235
+ explicit FieldHelper(int a_field) : field_(a_field) {}
236
+ int field() const { return field_; }
237
+ int field_; // NOLINT -- need external access to field_ to test
238
+ // the Field matcher.
239
+ };
240
+
241
+ // Tests the linkage of the ReturnVoid action.
242
+ TEST(LinkTest, TestReturnVoid) {
243
+ Mock mock;
244
+
245
+ EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return());
246
+ mock.VoidFromString(NULL);
247
+ }
248
+
249
+ // Tests the linkage of the Return action.
250
+ TEST(LinkTest, TestReturn) {
251
+ Mock mock;
252
+ char ch = 'x';
253
+
254
+ EXPECT_CALL(mock, StringFromString(_)).WillOnce(Return(&ch));
255
+ mock.StringFromString(NULL);
256
+ }
257
+
258
+ // Tests the linkage of the ReturnNull action.
259
+ TEST(LinkTest, TestReturnNull) {
260
+ Mock mock;
261
+
262
+ EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return());
263
+ mock.VoidFromString(NULL);
264
+ }
265
+
266
+ // Tests the linkage of the ReturnRef action.
267
+ TEST(LinkTest, TestReturnRef) {
268
+ Mock mock;
269
+ int n = 42;
270
+
271
+ EXPECT_CALL(mock, IntRefFromString(_)).WillOnce(ReturnRef(n));
272
+ mock.IntRefFromString(NULL);
273
+ }
274
+
275
+ // Tests the linkage of the Assign action.
276
+ TEST(LinkTest, TestAssign) {
277
+ Mock mock;
278
+ char ch = 'x';
279
+
280
+ EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Assign(&ch, 'y'));
281
+ mock.VoidFromString(NULL);
282
+ }
283
+
284
+ // Tests the linkage of the SetArgPointee action.
285
+ TEST(LinkTest, TestSetArgPointee) {
286
+ Mock mock;
287
+ char ch = 'x';
288
+
289
+ EXPECT_CALL(mock, VoidFromString(_)).WillOnce(SetArgPointee<0>('y'));
290
+ mock.VoidFromString(&ch);
291
+ }
292
+
293
+ // Tests the linkage of the SetArrayArgument action.
294
+ TEST(LinkTest, TestSetArrayArgument) {
295
+ Mock mock;
296
+ char ch = 'x';
297
+ char ch2 = 'y';
298
+
299
+ EXPECT_CALL(mock, VoidFromString(_)).WillOnce(SetArrayArgument<0>(&ch2,
300
+ &ch2 + 1));
301
+ mock.VoidFromString(&ch);
302
+ }
303
+
304
+ #if !GTEST_OS_WINDOWS_MOBILE
305
+
306
+ // Tests the linkage of the SetErrnoAndReturn action.
307
+ TEST(LinkTest, TestSetErrnoAndReturn) {
308
+ Mock mock;
309
+
310
+ int saved_errno = errno;
311
+ EXPECT_CALL(mock, IntFromString(_)).WillOnce(SetErrnoAndReturn(1, -1));
312
+ mock.IntFromString(NULL);
313
+ errno = saved_errno;
314
+ }
315
+
316
+ #endif // !GTEST_OS_WINDOWS_MOBILE
317
+
318
+ // Tests the linkage of the Invoke(function) and Invoke(object, method) actions.
319
+ TEST(LinkTest, TestInvoke) {
320
+ Mock mock;
321
+ InvokeHelper test_invoke_helper;
322
+
323
+ EXPECT_CALL(mock, VoidFromString(_))
324
+ .WillOnce(Invoke(&InvokeHelper::StaticVoidFromString))
325
+ .WillOnce(Invoke(&test_invoke_helper, &InvokeHelper::VoidFromString));
326
+ mock.VoidFromString(NULL);
327
+ mock.VoidFromString(NULL);
328
+ }
329
+
330
+ // Tests the linkage of the InvokeWithoutArgs action.
331
+ TEST(LinkTest, TestInvokeWithoutArgs) {
332
+ Mock mock;
333
+ InvokeHelper test_invoke_helper;
334
+
335
+ EXPECT_CALL(mock, VoidFromString(_))
336
+ .WillOnce(InvokeWithoutArgs(&InvokeHelper::StaticVoidFromVoid))
337
+ .WillOnce(InvokeWithoutArgs(&test_invoke_helper,
338
+ &InvokeHelper::VoidFromVoid));
339
+ mock.VoidFromString(NULL);
340
+ mock.VoidFromString(NULL);
341
+ }
342
+
343
+ // Tests the linkage of the InvokeArgument action.
344
+ TEST(LinkTest, TestInvokeArgument) {
345
+ Mock mock;
346
+ char ch = 'x';
347
+
348
+ EXPECT_CALL(mock, VoidFromFunc(_)).WillOnce(InvokeArgument<0>(&ch));
349
+ mock.VoidFromFunc(InvokeHelper::StaticVoidFromString);
350
+ }
351
+
352
+ // Tests the linkage of the WithArg action.
353
+ TEST(LinkTest, TestWithArg) {
354
+ Mock mock;
355
+
356
+ EXPECT_CALL(mock, VoidFromString(_))
357
+ .WillOnce(WithArg<0>(Invoke(&InvokeHelper::StaticVoidFromString)));
358
+ mock.VoidFromString(NULL);
359
+ }
360
+
361
+ // Tests the linkage of the WithArgs action.
362
+ TEST(LinkTest, TestWithArgs) {
363
+ Mock mock;
364
+
365
+ EXPECT_CALL(mock, VoidFromString(_))
366
+ .WillOnce(WithArgs<0>(Invoke(&InvokeHelper::StaticVoidFromString)));
367
+ mock.VoidFromString(NULL);
368
+ }
369
+
370
+ // Tests the linkage of the WithoutArgs action.
371
+ TEST(LinkTest, TestWithoutArgs) {
372
+ Mock mock;
373
+
374
+ EXPECT_CALL(mock, VoidFromString(_)).WillOnce(WithoutArgs(Return()));
375
+ mock.VoidFromString(NULL);
376
+ }
377
+
378
+ // Tests the linkage of the DoAll action.
379
+ TEST(LinkTest, TestDoAll) {
380
+ Mock mock;
381
+ char ch = 'x';
382
+
383
+ EXPECT_CALL(mock, VoidFromString(_))
384
+ .WillOnce(DoAll(SetArgPointee<0>('y'), Return()));
385
+ mock.VoidFromString(&ch);
386
+ }
387
+
388
+ // Tests the linkage of the DoDefault action.
389
+ TEST(LinkTest, TestDoDefault) {
390
+ Mock mock;
391
+ char ch = 'x';
392
+
393
+ ON_CALL(mock, VoidFromString(_)).WillByDefault(Return());
394
+ EXPECT_CALL(mock, VoidFromString(_)).WillOnce(DoDefault());
395
+ mock.VoidFromString(&ch);
396
+ }
397
+
398
+ // Tests the linkage of the IgnoreResult action.
399
+ TEST(LinkTest, TestIgnoreResult) {
400
+ Mock mock;
401
+
402
+ EXPECT_CALL(mock, VoidFromString(_)).WillOnce(IgnoreResult(Return(42)));
403
+ mock.VoidFromString(NULL);
404
+ }
405
+
406
+ #if GTEST_HAS_EXCEPTIONS
407
+ // Tests the linkage of the Throw action.
408
+ TEST(LinkTest, TestThrow) {
409
+ Mock mock;
410
+
411
+ EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Throw(42));
412
+ EXPECT_THROW(mock.VoidFromString(NULL), int);
413
+ }
414
+ #endif // GTEST_HAS_EXCEPTIONS
415
+
416
+ // The ACTION*() macros trigger warning C4100 (unreferenced formal
417
+ // parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
418
+ // the macro definition, as the warnings are generated when the macro
419
+ // is expanded and macro expansion cannot contain #pragma. Therefore
420
+ // we suppress them here.
421
+ #ifdef _MSC_VER
422
+ # pragma warning(push)
423
+ # pragma warning(disable:4100)
424
+ #endif
425
+
426
+ // Tests the linkage of actions created using ACTION macro.
427
+ namespace {
428
+ ACTION(Return1) { return 1; }
429
+ }
430
+
431
+ TEST(LinkTest, TestActionMacro) {
432
+ Mock mock;
433
+
434
+ EXPECT_CALL(mock, IntFromString(_)).WillOnce(Return1());
435
+ mock.IntFromString(NULL);
436
+ }
437
+
438
+ // Tests the linkage of actions created using ACTION_P macro.
439
+ namespace {
440
+ ACTION_P(ReturnArgument, ret_value) { return ret_value; }
441
+ }
442
+
443
+ TEST(LinkTest, TestActionPMacro) {
444
+ Mock mock;
445
+
446
+ EXPECT_CALL(mock, IntFromString(_)).WillOnce(ReturnArgument(42));
447
+ mock.IntFromString(NULL);
448
+ }
449
+
450
+ // Tests the linkage of actions created using ACTION_P2 macro.
451
+ namespace {
452
+ ACTION_P2(ReturnEqualsEitherOf, first, second) {
453
+ return arg0 == first || arg0 == second;
454
+ }
455
+ }
456
+
457
+ #ifdef _MSC_VER
458
+ # pragma warning(pop)
459
+ #endif
460
+
461
+ TEST(LinkTest, TestActionP2Macro) {
462
+ Mock mock;
463
+ char ch = 'x';
464
+
465
+ EXPECT_CALL(mock, IntFromString(_))
466
+ .WillOnce(ReturnEqualsEitherOf("one", "two"));
467
+ mock.IntFromString(&ch);
468
+ }
469
+
470
+ // Tests the linkage of the "_" matcher.
471
+ TEST(LinkTest, TestMatcherAnything) {
472
+ Mock mock;
473
+
474
+ ON_CALL(mock, VoidFromString(_)).WillByDefault(Return());
475
+ }
476
+
477
+ // Tests the linkage of the A matcher.
478
+ TEST(LinkTest, TestMatcherA) {
479
+ Mock mock;
480
+
481
+ ON_CALL(mock, VoidFromString(A<char*>())).WillByDefault(Return());
482
+ }
483
+
484
+ // Tests the linkage of the Eq and the "bare value" matcher.
485
+ TEST(LinkTest, TestMatchersEq) {
486
+ Mock mock;
487
+ const char* p = "x";
488
+
489
+ ON_CALL(mock, VoidFromString(Eq(p))).WillByDefault(Return());
490
+ ON_CALL(mock, VoidFromString(const_cast<char*>("y")))
491
+ .WillByDefault(Return());
492
+ }
493
+
494
+ // Tests the linkage of the Lt, Gt, Le, Ge, and Ne matchers.
495
+ TEST(LinkTest, TestMatchersRelations) {
496
+ Mock mock;
497
+
498
+ ON_CALL(mock, VoidFromFloat(Lt(1.0f))).WillByDefault(Return());
499
+ ON_CALL(mock, VoidFromFloat(Gt(1.0f))).WillByDefault(Return());
500
+ ON_CALL(mock, VoidFromFloat(Le(1.0f))).WillByDefault(Return());
501
+ ON_CALL(mock, VoidFromFloat(Ge(1.0f))).WillByDefault(Return());
502
+ ON_CALL(mock, VoidFromFloat(Ne(1.0f))).WillByDefault(Return());
503
+ }
504
+
505
+ // Tests the linkage of the NotNull matcher.
506
+ TEST(LinkTest, TestMatcherNotNull) {
507
+ Mock mock;
508
+
509
+ ON_CALL(mock, VoidFromString(NotNull())).WillByDefault(Return());
510
+ }
511
+
512
+ // Tests the linkage of the IsNull matcher.
513
+ TEST(LinkTest, TestMatcherIsNull) {
514
+ Mock mock;
515
+
516
+ ON_CALL(mock, VoidFromString(IsNull())).WillByDefault(Return());
517
+ }
518
+
519
+ // Tests the linkage of the Ref matcher.
520
+ TEST(LinkTest, TestMatcherRef) {
521
+ Mock mock;
522
+ int a = 0;
523
+
524
+ ON_CALL(mock, VoidFromIntRef(Ref(a))).WillByDefault(Return());
525
+ }
526
+
527
+ // Tests the linkage of the TypedEq matcher.
528
+ TEST(LinkTest, TestMatcherTypedEq) {
529
+ Mock mock;
530
+ long a = 0;
531
+
532
+ ON_CALL(mock, VoidFromIntRef(TypedEq<int&>(a))).WillByDefault(Return());
533
+ }
534
+
535
+ // Tests the linkage of the FloatEq, DoubleEq, NanSensitiveFloatEq and
536
+ // NanSensitiveDoubleEq matchers.
537
+ TEST(LinkTest, TestMatchersFloatingPoint) {
538
+ Mock mock;
539
+ float a = 0;
540
+
541
+ ON_CALL(mock, VoidFromFloat(FloatEq(a))).WillByDefault(Return());
542
+ ON_CALL(mock, VoidFromDouble(DoubleEq(a))).WillByDefault(Return());
543
+ ON_CALL(mock, VoidFromFloat(NanSensitiveFloatEq(a))).WillByDefault(Return());
544
+ ON_CALL(mock, VoidFromDouble(NanSensitiveDoubleEq(a)))
545
+ .WillByDefault(Return());
546
+ }
547
+
548
+ // Tests the linkage of the ContainsRegex matcher.
549
+ TEST(LinkTest, TestMatcherContainsRegex) {
550
+ Mock mock;
551
+
552
+ ON_CALL(mock, VoidFromString(ContainsRegex(".*"))).WillByDefault(Return());
553
+ }
554
+
555
+ // Tests the linkage of the MatchesRegex matcher.
556
+ TEST(LinkTest, TestMatcherMatchesRegex) {
557
+ Mock mock;
558
+
559
+ ON_CALL(mock, VoidFromString(MatchesRegex(".*"))).WillByDefault(Return());
560
+ }
561
+
562
+ // Tests the linkage of the StartsWith, EndsWith, and HasSubstr matchers.
563
+ TEST(LinkTest, TestMatchersSubstrings) {
564
+ Mock mock;
565
+
566
+ ON_CALL(mock, VoidFromString(StartsWith("a"))).WillByDefault(Return());
567
+ ON_CALL(mock, VoidFromString(EndsWith("c"))).WillByDefault(Return());
568
+ ON_CALL(mock, VoidFromString(HasSubstr("b"))).WillByDefault(Return());
569
+ }
570
+
571
+ // Tests the linkage of the StrEq, StrNe, StrCaseEq, and StrCaseNe matchers.
572
+ TEST(LinkTest, TestMatchersStringEquality) {
573
+ Mock mock;
574
+ ON_CALL(mock, VoidFromString(StrEq("a"))).WillByDefault(Return());
575
+ ON_CALL(mock, VoidFromString(StrNe("a"))).WillByDefault(Return());
576
+ ON_CALL(mock, VoidFromString(StrCaseEq("a"))).WillByDefault(Return());
577
+ ON_CALL(mock, VoidFromString(StrCaseNe("a"))).WillByDefault(Return());
578
+ }
579
+
580
+ // Tests the linkage of the ElementsAre matcher.
581
+ TEST(LinkTest, TestMatcherElementsAre) {
582
+ Mock mock;
583
+
584
+ ON_CALL(mock, VoidFromVector(ElementsAre('a', _))).WillByDefault(Return());
585
+ }
586
+
587
+ // Tests the linkage of the ElementsAreArray matcher.
588
+ TEST(LinkTest, TestMatcherElementsAreArray) {
589
+ Mock mock;
590
+ char arr[] = { 'a', 'b' };
591
+
592
+ ON_CALL(mock, VoidFromVector(ElementsAreArray(arr))).WillByDefault(Return());
593
+ }
594
+
595
+ // Tests the linkage of the ContainerEq matcher.
596
+ TEST(LinkTest, TestMatcherContainerEq) {
597
+ Mock mock;
598
+ std::vector<int> v;
599
+
600
+ ON_CALL(mock, VoidFromVector(ContainerEq(v))).WillByDefault(Return());
601
+ }
602
+
603
+ // Tests the linkage of the Field matcher.
604
+ TEST(LinkTest, TestMatcherField) {
605
+ FieldHelper helper(0);
606
+
607
+ Matcher<const FieldHelper&> m = Field(&FieldHelper::field_, Eq(0));
608
+ EXPECT_TRUE(m.Matches(helper));
609
+
610
+ Matcher<const FieldHelper*> m2 = Field(&FieldHelper::field_, Eq(0));
611
+ EXPECT_TRUE(m2.Matches(&helper));
612
+ }
613
+
614
+ // Tests the linkage of the Property matcher.
615
+ TEST(LinkTest, TestMatcherProperty) {
616
+ FieldHelper helper(0);
617
+
618
+ Matcher<const FieldHelper&> m = Property(&FieldHelper::field, Eq(0));
619
+ EXPECT_TRUE(m.Matches(helper));
620
+
621
+ Matcher<const FieldHelper*> m2 = Property(&FieldHelper::field, Eq(0));
622
+ EXPECT_TRUE(m2.Matches(&helper));
623
+ }
624
+
625
+ // Tests the linkage of the ResultOf matcher.
626
+ TEST(LinkTest, TestMatcherResultOf) {
627
+ Matcher<char*> m = ResultOf(&InvokeHelper::StaticIntFromString, Eq(1));
628
+ EXPECT_TRUE(m.Matches(NULL));
629
+ }
630
+
631
+ // Tests the linkage of the ResultOf matcher.
632
+ TEST(LinkTest, TestMatcherPointee) {
633
+ int n = 1;
634
+
635
+ Matcher<int*> m = Pointee(Eq(1));
636
+ EXPECT_TRUE(m.Matches(&n));
637
+ }
638
+
639
+ // Tests the linkage of the Truly matcher.
640
+ TEST(LinkTest, TestMatcherTruly) {
641
+ Matcher<const char*> m = Truly(&InvokeHelper::StaticBoolFromString);
642
+ EXPECT_TRUE(m.Matches(NULL));
643
+ }
644
+
645
+ // Tests the linkage of the AllOf matcher.
646
+ TEST(LinkTest, TestMatcherAllOf) {
647
+ Matcher<int> m = AllOf(_, Eq(1));
648
+ EXPECT_TRUE(m.Matches(1));
649
+ }
650
+
651
+ // Tests the linkage of the AnyOf matcher.
652
+ TEST(LinkTest, TestMatcherAnyOf) {
653
+ Matcher<int> m = AnyOf(_, Eq(1));
654
+ EXPECT_TRUE(m.Matches(1));
655
+ }
656
+
657
+ // Tests the linkage of the Not matcher.
658
+ TEST(LinkTest, TestMatcherNot) {
659
+ Matcher<int> m = Not(_);
660
+ EXPECT_FALSE(m.Matches(1));
661
+ }
662
+
663
+ // Tests the linkage of the MatcherCast<T>() function.
664
+ TEST(LinkTest, TestMatcherCast) {
665
+ Matcher<const char*> m = MatcherCast<const char*>(_);
666
+ EXPECT_TRUE(m.Matches(NULL));
667
+ }
668
+
669
+ #endif // GMOCK_TEST_GMOCK_LINK_TEST_H_