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.
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,286 @@
1
+ $$ -*- mode: c++; -*-
2
+ $var n = 50 $$ Maximum length of Values arguments we want to support.
3
+ $var maxtuple = 10 $$ Maximum number of Combine arguments we want to support.
4
+ // Copyright 2008 Google Inc.
5
+ // All Rights Reserved.
6
+ //
7
+ // Redistribution and use in source and binary forms, with or without
8
+ // modification, are permitted provided that the following conditions are
9
+ // met:
10
+ //
11
+ // * Redistributions of source code must retain the above copyright
12
+ // notice, this list of conditions and the following disclaimer.
13
+ // * Redistributions in binary form must reproduce the above
14
+ // copyright notice, this list of conditions and the following disclaimer
15
+ // in the documentation and/or other materials provided with the
16
+ // distribution.
17
+ // * Neither the name of Google Inc. nor the names of its
18
+ // contributors may be used to endorse or promote products derived from
19
+ // this software without specific prior written permission.
20
+ //
21
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ //
33
+ // Author: vladl@google.com (Vlad Losev)
34
+
35
+ // Type and function utilities for implementing parameterized tests.
36
+ // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
37
+ //
38
+ // Currently Google Test supports at most $n arguments in Values,
39
+ // and at most $maxtuple arguments in Combine. Please contact
40
+ // googletestframework@googlegroups.com if you need more.
41
+ // Please note that the number of arguments to Combine is limited
42
+ // by the maximum arity of the implementation of tuple which is
43
+ // currently set at $maxtuple.
44
+
45
+ #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
46
+ #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
47
+
48
+ // scripts/fuse_gtest.py depends on gtest's own header being #included
49
+ // *unconditionally*. Therefore these #includes cannot be moved
50
+ // inside #if GTEST_HAS_PARAM_TEST.
51
+ #include "gtest/internal/gtest-param-util.h"
52
+ #include "gtest/internal/gtest-port.h"
53
+
54
+ #if GTEST_HAS_PARAM_TEST
55
+
56
+ namespace testing {
57
+
58
+ // Forward declarations of ValuesIn(), which is implemented in
59
+ // include/gtest/gtest-param-test.h.
60
+ template <typename ForwardIterator>
61
+ internal::ParamGenerator<
62
+ typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
63
+ ValuesIn(ForwardIterator begin, ForwardIterator end);
64
+
65
+ template <typename T, size_t N>
66
+ internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
67
+
68
+ template <class Container>
69
+ internal::ParamGenerator<typename Container::value_type> ValuesIn(
70
+ const Container& container);
71
+
72
+ namespace internal {
73
+
74
+ // Used in the Values() function to provide polymorphic capabilities.
75
+ $range i 1..n
76
+ $for i [[
77
+ $range j 1..i
78
+
79
+ template <$for j, [[typename T$j]]>
80
+ class ValueArray$i {
81
+ public:
82
+ $if i==1 [[explicit ]]ValueArray$i($for j, [[T$j v$j]]) : $for j, [[v$(j)_(v$j)]] {}
83
+
84
+ template <typename T>
85
+ operator ParamGenerator<T>() const {
86
+ const T array[] = {$for j, [[static_cast<T>(v$(j)_)]]};
87
+ return ValuesIn(array);
88
+ }
89
+
90
+ private:
91
+ // No implementation - assignment is unsupported.
92
+ void operator=(const ValueArray$i& other);
93
+
94
+ $for j [[
95
+
96
+ const T$j v$(j)_;
97
+ ]]
98
+
99
+ };
100
+
101
+ ]]
102
+
103
+ # if GTEST_HAS_COMBINE
104
+ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
105
+ //
106
+ // Generates values from the Cartesian product of values produced
107
+ // by the argument generators.
108
+ //
109
+ $range i 2..maxtuple
110
+ $for i [[
111
+ $range j 1..i
112
+ $range k 2..i
113
+
114
+ template <$for j, [[typename T$j]]>
115
+ class CartesianProductGenerator$i
116
+ : public ParamGeneratorInterface< ::testing::tuple<$for j, [[T$j]]> > {
117
+ public:
118
+ typedef ::testing::tuple<$for j, [[T$j]]> ParamType;
119
+
120
+ CartesianProductGenerator$i($for j, [[const ParamGenerator<T$j>& g$j]])
121
+ : $for j, [[g$(j)_(g$j)]] {}
122
+ virtual ~CartesianProductGenerator$i() {}
123
+
124
+ virtual ParamIteratorInterface<ParamType>* Begin() const {
125
+ return new Iterator(this, $for j, [[g$(j)_, g$(j)_.begin()]]);
126
+ }
127
+ virtual ParamIteratorInterface<ParamType>* End() const {
128
+ return new Iterator(this, $for j, [[g$(j)_, g$(j)_.end()]]);
129
+ }
130
+
131
+ private:
132
+ class Iterator : public ParamIteratorInterface<ParamType> {
133
+ public:
134
+ Iterator(const ParamGeneratorInterface<ParamType>* base, $for j, [[
135
+
136
+ const ParamGenerator<T$j>& g$j,
137
+ const typename ParamGenerator<T$j>::iterator& current$(j)]])
138
+ : base_(base),
139
+ $for j, [[
140
+
141
+ begin$(j)_(g$j.begin()), end$(j)_(g$j.end()), current$(j)_(current$j)
142
+ ]] {
143
+ ComputeCurrentValue();
144
+ }
145
+ virtual ~Iterator() {}
146
+
147
+ virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
148
+ return base_;
149
+ }
150
+ // Advance should not be called on beyond-of-range iterators
151
+ // so no component iterators must be beyond end of range, either.
152
+ virtual void Advance() {
153
+ assert(!AtEnd());
154
+ ++current$(i)_;
155
+
156
+ $for k [[
157
+ if (current$(i+2-k)_ == end$(i+2-k)_) {
158
+ current$(i+2-k)_ = begin$(i+2-k)_;
159
+ ++current$(i+2-k-1)_;
160
+ }
161
+
162
+ ]]
163
+ ComputeCurrentValue();
164
+ }
165
+ virtual ParamIteratorInterface<ParamType>* Clone() const {
166
+ return new Iterator(*this);
167
+ }
168
+ virtual const ParamType* Current() const { return &current_value_; }
169
+ virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
170
+ // Having the same base generator guarantees that the other
171
+ // iterator is of the same type and we can downcast.
172
+ GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
173
+ << "The program attempted to compare iterators "
174
+ << "from different generators." << std::endl;
175
+ const Iterator* typed_other =
176
+ CheckedDowncastToActualType<const Iterator>(&other);
177
+ // We must report iterators equal if they both point beyond their
178
+ // respective ranges. That can happen in a variety of fashions,
179
+ // so we have to consult AtEnd().
180
+ return (AtEnd() && typed_other->AtEnd()) ||
181
+ ($for j && [[
182
+
183
+ current$(j)_ == typed_other->current$(j)_
184
+ ]]);
185
+ }
186
+
187
+ private:
188
+ Iterator(const Iterator& other)
189
+ : base_(other.base_), $for j, [[
190
+
191
+ begin$(j)_(other.begin$(j)_),
192
+ end$(j)_(other.end$(j)_),
193
+ current$(j)_(other.current$(j)_)
194
+ ]] {
195
+ ComputeCurrentValue();
196
+ }
197
+
198
+ void ComputeCurrentValue() {
199
+ if (!AtEnd())
200
+ current_value_ = ParamType($for j, [[*current$(j)_]]);
201
+ }
202
+ bool AtEnd() const {
203
+ // We must report iterator past the end of the range when either of the
204
+ // component iterators has reached the end of its range.
205
+ return
206
+ $for j || [[
207
+
208
+ current$(j)_ == end$(j)_
209
+ ]];
210
+ }
211
+
212
+ // No implementation - assignment is unsupported.
213
+ void operator=(const Iterator& other);
214
+
215
+ const ParamGeneratorInterface<ParamType>* const base_;
216
+ // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
217
+ // current[i]_ is the actual traversing iterator.
218
+ $for j [[
219
+
220
+ const typename ParamGenerator<T$j>::iterator begin$(j)_;
221
+ const typename ParamGenerator<T$j>::iterator end$(j)_;
222
+ typename ParamGenerator<T$j>::iterator current$(j)_;
223
+ ]]
224
+
225
+ ParamType current_value_;
226
+ }; // class CartesianProductGenerator$i::Iterator
227
+
228
+ // No implementation - assignment is unsupported.
229
+ void operator=(const CartesianProductGenerator$i& other);
230
+
231
+
232
+ $for j [[
233
+ const ParamGenerator<T$j> g$(j)_;
234
+
235
+ ]]
236
+ }; // class CartesianProductGenerator$i
237
+
238
+
239
+ ]]
240
+
241
+ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
242
+ //
243
+ // Helper classes providing Combine() with polymorphic features. They allow
244
+ // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
245
+ // convertible to U.
246
+ //
247
+ $range i 2..maxtuple
248
+ $for i [[
249
+ $range j 1..i
250
+
251
+ template <$for j, [[class Generator$j]]>
252
+ class CartesianProductHolder$i {
253
+ public:
254
+ CartesianProductHolder$i($for j, [[const Generator$j& g$j]])
255
+ : $for j, [[g$(j)_(g$j)]] {}
256
+ template <$for j, [[typename T$j]]>
257
+ operator ParamGenerator< ::testing::tuple<$for j, [[T$j]]> >() const {
258
+ return ParamGenerator< ::testing::tuple<$for j, [[T$j]]> >(
259
+ new CartesianProductGenerator$i<$for j, [[T$j]]>(
260
+ $for j,[[
261
+
262
+ static_cast<ParamGenerator<T$j> >(g$(j)_)
263
+ ]]));
264
+ }
265
+
266
+ private:
267
+ // No implementation - assignment is unsupported.
268
+ void operator=(const CartesianProductHolder$i& other);
269
+
270
+
271
+ $for j [[
272
+ const Generator$j g$(j)_;
273
+
274
+ ]]
275
+ }; // class CartesianProductHolder$i
276
+
277
+ ]]
278
+
279
+ # endif // GTEST_HAS_COMBINE
280
+
281
+ } // namespace internal
282
+ } // namespace testing
283
+
284
+ #endif // GTEST_HAS_PARAM_TEST
285
+
286
+ #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
@@ -0,0 +1,731 @@
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: vladl@google.com (Vlad Losev)
31
+
32
+ // Type and function utilities for implementing parameterized tests.
33
+
34
+ #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
35
+ #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
36
+
37
+ #include <ctype.h>
38
+
39
+ #include <iterator>
40
+ #include <set>
41
+ #include <utility>
42
+ #include <vector>
43
+
44
+ // scripts/fuse_gtest.py depends on gtest's own header being #included
45
+ // *unconditionally*. Therefore these #includes cannot be moved
46
+ // inside #if GTEST_HAS_PARAM_TEST.
47
+ #include "gtest/internal/gtest-internal.h"
48
+ #include "gtest/internal/gtest-linked_ptr.h"
49
+ #include "gtest/internal/gtest-port.h"
50
+ #include "gtest/gtest-printers.h"
51
+
52
+ #if GTEST_HAS_PARAM_TEST
53
+
54
+ namespace testing {
55
+
56
+ // Input to a parameterized test name generator, describing a test parameter.
57
+ // Consists of the parameter value and the integer parameter index.
58
+ template <class ParamType>
59
+ struct TestParamInfo {
60
+ TestParamInfo(const ParamType& a_param, size_t an_index) :
61
+ param(a_param),
62
+ index(an_index) {}
63
+ ParamType param;
64
+ size_t index;
65
+ };
66
+
67
+ // A builtin parameterized test name generator which returns the result of
68
+ // testing::PrintToString.
69
+ struct PrintToStringParamName {
70
+ template <class ParamType>
71
+ std::string operator()(const TestParamInfo<ParamType>& info) const {
72
+ return PrintToString(info.param);
73
+ }
74
+ };
75
+
76
+ namespace internal {
77
+
78
+ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
79
+ //
80
+ // Outputs a message explaining invalid registration of different
81
+ // fixture class for the same test case. This may happen when
82
+ // TEST_P macro is used to define two tests with the same name
83
+ // but in different namespaces.
84
+ GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
85
+ CodeLocation code_location);
86
+
87
+ template <typename> class ParamGeneratorInterface;
88
+ template <typename> class ParamGenerator;
89
+
90
+ // Interface for iterating over elements provided by an implementation
91
+ // of ParamGeneratorInterface<T>.
92
+ template <typename T>
93
+ class ParamIteratorInterface {
94
+ public:
95
+ virtual ~ParamIteratorInterface() {}
96
+ // A pointer to the base generator instance.
97
+ // Used only for the purposes of iterator comparison
98
+ // to make sure that two iterators belong to the same generator.
99
+ virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
100
+ // Advances iterator to point to the next element
101
+ // provided by the generator. The caller is responsible
102
+ // for not calling Advance() on an iterator equal to
103
+ // BaseGenerator()->End().
104
+ virtual void Advance() = 0;
105
+ // Clones the iterator object. Used for implementing copy semantics
106
+ // of ParamIterator<T>.
107
+ virtual ParamIteratorInterface* Clone() const = 0;
108
+ // Dereferences the current iterator and provides (read-only) access
109
+ // to the pointed value. It is the caller's responsibility not to call
110
+ // Current() on an iterator equal to BaseGenerator()->End().
111
+ // Used for implementing ParamGenerator<T>::operator*().
112
+ virtual const T* Current() const = 0;
113
+ // Determines whether the given iterator and other point to the same
114
+ // element in the sequence generated by the generator.
115
+ // Used for implementing ParamGenerator<T>::operator==().
116
+ virtual bool Equals(const ParamIteratorInterface& other) const = 0;
117
+ };
118
+
119
+ // Class iterating over elements provided by an implementation of
120
+ // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
121
+ // and implements the const forward iterator concept.
122
+ template <typename T>
123
+ class ParamIterator {
124
+ public:
125
+ typedef T value_type;
126
+ typedef const T& reference;
127
+ typedef ptrdiff_t difference_type;
128
+
129
+ // ParamIterator assumes ownership of the impl_ pointer.
130
+ ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
131
+ ParamIterator& operator=(const ParamIterator& other) {
132
+ if (this != &other)
133
+ impl_.reset(other.impl_->Clone());
134
+ return *this;
135
+ }
136
+
137
+ const T& operator*() const { return *impl_->Current(); }
138
+ const T* operator->() const { return impl_->Current(); }
139
+ // Prefix version of operator++.
140
+ ParamIterator& operator++() {
141
+ impl_->Advance();
142
+ return *this;
143
+ }
144
+ // Postfix version of operator++.
145
+ ParamIterator operator++(int /*unused*/) {
146
+ ParamIteratorInterface<T>* clone = impl_->Clone();
147
+ impl_->Advance();
148
+ return ParamIterator(clone);
149
+ }
150
+ bool operator==(const ParamIterator& other) const {
151
+ return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
152
+ }
153
+ bool operator!=(const ParamIterator& other) const {
154
+ return !(*this == other);
155
+ }
156
+
157
+ private:
158
+ friend class ParamGenerator<T>;
159
+ explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
160
+ scoped_ptr<ParamIteratorInterface<T> > impl_;
161
+ };
162
+
163
+ // ParamGeneratorInterface<T> is the binary interface to access generators
164
+ // defined in other translation units.
165
+ template <typename T>
166
+ class ParamGeneratorInterface {
167
+ public:
168
+ typedef T ParamType;
169
+
170
+ virtual ~ParamGeneratorInterface() {}
171
+
172
+ // Generator interface definition
173
+ virtual ParamIteratorInterface<T>* Begin() const = 0;
174
+ virtual ParamIteratorInterface<T>* End() const = 0;
175
+ };
176
+
177
+ // Wraps ParamGeneratorInterface<T> and provides general generator syntax
178
+ // compatible with the STL Container concept.
179
+ // This class implements copy initialization semantics and the contained
180
+ // ParamGeneratorInterface<T> instance is shared among all copies
181
+ // of the original object. This is possible because that instance is immutable.
182
+ template<typename T>
183
+ class ParamGenerator {
184
+ public:
185
+ typedef ParamIterator<T> iterator;
186
+
187
+ explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
188
+ ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
189
+
190
+ ParamGenerator& operator=(const ParamGenerator& other) {
191
+ impl_ = other.impl_;
192
+ return *this;
193
+ }
194
+
195
+ iterator begin() const { return iterator(impl_->Begin()); }
196
+ iterator end() const { return iterator(impl_->End()); }
197
+
198
+ private:
199
+ linked_ptr<const ParamGeneratorInterface<T> > impl_;
200
+ };
201
+
202
+ // Generates values from a range of two comparable values. Can be used to
203
+ // generate sequences of user-defined types that implement operator+() and
204
+ // operator<().
205
+ // This class is used in the Range() function.
206
+ template <typename T, typename IncrementT>
207
+ class RangeGenerator : public ParamGeneratorInterface<T> {
208
+ public:
209
+ RangeGenerator(T begin, T end, IncrementT step)
210
+ : begin_(begin), end_(end),
211
+ step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
212
+ virtual ~RangeGenerator() {}
213
+
214
+ virtual ParamIteratorInterface<T>* Begin() const {
215
+ return new Iterator(this, begin_, 0, step_);
216
+ }
217
+ virtual ParamIteratorInterface<T>* End() const {
218
+ return new Iterator(this, end_, end_index_, step_);
219
+ }
220
+
221
+ private:
222
+ class Iterator : public ParamIteratorInterface<T> {
223
+ public:
224
+ Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
225
+ IncrementT step)
226
+ : base_(base), value_(value), index_(index), step_(step) {}
227
+ virtual ~Iterator() {}
228
+
229
+ virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
230
+ return base_;
231
+ }
232
+ virtual void Advance() {
233
+ value_ = static_cast<T>(value_ + step_);
234
+ index_++;
235
+ }
236
+ virtual ParamIteratorInterface<T>* Clone() const {
237
+ return new Iterator(*this);
238
+ }
239
+ virtual const T* Current() const { return &value_; }
240
+ virtual bool Equals(const ParamIteratorInterface<T>& other) const {
241
+ // Having the same base generator guarantees that the other
242
+ // iterator is of the same type and we can downcast.
243
+ GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
244
+ << "The program attempted to compare iterators "
245
+ << "from different generators." << std::endl;
246
+ const int other_index =
247
+ CheckedDowncastToActualType<const Iterator>(&other)->index_;
248
+ return index_ == other_index;
249
+ }
250
+
251
+ private:
252
+ Iterator(const Iterator& other)
253
+ : ParamIteratorInterface<T>(),
254
+ base_(other.base_), value_(other.value_), index_(other.index_),
255
+ step_(other.step_) {}
256
+
257
+ // No implementation - assignment is unsupported.
258
+ void operator=(const Iterator& other);
259
+
260
+ const ParamGeneratorInterface<T>* const base_;
261
+ T value_;
262
+ int index_;
263
+ const IncrementT step_;
264
+ }; // class RangeGenerator::Iterator
265
+
266
+ static int CalculateEndIndex(const T& begin,
267
+ const T& end,
268
+ const IncrementT& step) {
269
+ int end_index = 0;
270
+ for (T i = begin; i < end; i = static_cast<T>(i + step))
271
+ end_index++;
272
+ return end_index;
273
+ }
274
+
275
+ // No implementation - assignment is unsupported.
276
+ void operator=(const RangeGenerator& other);
277
+
278
+ const T begin_;
279
+ const T end_;
280
+ const IncrementT step_;
281
+ // The index for the end() iterator. All the elements in the generated
282
+ // sequence are indexed (0-based) to aid iterator comparison.
283
+ const int end_index_;
284
+ }; // class RangeGenerator
285
+
286
+
287
+ // Generates values from a pair of STL-style iterators. Used in the
288
+ // ValuesIn() function. The elements are copied from the source range
289
+ // since the source can be located on the stack, and the generator
290
+ // is likely to persist beyond that stack frame.
291
+ template <typename T>
292
+ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
293
+ public:
294
+ template <typename ForwardIterator>
295
+ ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
296
+ : container_(begin, end) {}
297
+ virtual ~ValuesInIteratorRangeGenerator() {}
298
+
299
+ virtual ParamIteratorInterface<T>* Begin() const {
300
+ return new Iterator(this, container_.begin());
301
+ }
302
+ virtual ParamIteratorInterface<T>* End() const {
303
+ return new Iterator(this, container_.end());
304
+ }
305
+
306
+ private:
307
+ typedef typename ::std::vector<T> ContainerType;
308
+
309
+ class Iterator : public ParamIteratorInterface<T> {
310
+ public:
311
+ Iterator(const ParamGeneratorInterface<T>* base,
312
+ typename ContainerType::const_iterator iterator)
313
+ : base_(base), iterator_(iterator) {}
314
+ virtual ~Iterator() {}
315
+
316
+ virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
317
+ return base_;
318
+ }
319
+ virtual void Advance() {
320
+ ++iterator_;
321
+ value_.reset();
322
+ }
323
+ virtual ParamIteratorInterface<T>* Clone() const {
324
+ return new Iterator(*this);
325
+ }
326
+ // We need to use cached value referenced by iterator_ because *iterator_
327
+ // can return a temporary object (and of type other then T), so just
328
+ // having "return &*iterator_;" doesn't work.
329
+ // value_ is updated here and not in Advance() because Advance()
330
+ // can advance iterator_ beyond the end of the range, and we cannot
331
+ // detect that fact. The client code, on the other hand, is
332
+ // responsible for not calling Current() on an out-of-range iterator.
333
+ virtual const T* Current() const {
334
+ if (value_.get() == NULL)
335
+ value_.reset(new T(*iterator_));
336
+ return value_.get();
337
+ }
338
+ virtual bool Equals(const ParamIteratorInterface<T>& other) const {
339
+ // Having the same base generator guarantees that the other
340
+ // iterator is of the same type and we can downcast.
341
+ GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
342
+ << "The program attempted to compare iterators "
343
+ << "from different generators." << std::endl;
344
+ return iterator_ ==
345
+ CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
346
+ }
347
+
348
+ private:
349
+ Iterator(const Iterator& other)
350
+ // The explicit constructor call suppresses a false warning
351
+ // emitted by gcc when supplied with the -Wextra option.
352
+ : ParamIteratorInterface<T>(),
353
+ base_(other.base_),
354
+ iterator_(other.iterator_) {}
355
+
356
+ const ParamGeneratorInterface<T>* const base_;
357
+ typename ContainerType::const_iterator iterator_;
358
+ // A cached value of *iterator_. We keep it here to allow access by
359
+ // pointer in the wrapping iterator's operator->().
360
+ // value_ needs to be mutable to be accessed in Current().
361
+ // Use of scoped_ptr helps manage cached value's lifetime,
362
+ // which is bound by the lifespan of the iterator itself.
363
+ mutable scoped_ptr<const T> value_;
364
+ }; // class ValuesInIteratorRangeGenerator::Iterator
365
+
366
+ // No implementation - assignment is unsupported.
367
+ void operator=(const ValuesInIteratorRangeGenerator& other);
368
+
369
+ const ContainerType container_;
370
+ }; // class ValuesInIteratorRangeGenerator
371
+
372
+ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
373
+ //
374
+ // Default parameterized test name generator, returns a string containing the
375
+ // integer test parameter index.
376
+ template <class ParamType>
377
+ std::string DefaultParamName(const TestParamInfo<ParamType>& info) {
378
+ Message name_stream;
379
+ name_stream << info.index;
380
+ return name_stream.GetString();
381
+ }
382
+
383
+ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
384
+ //
385
+ // Parameterized test name overload helpers, which help the
386
+ // INSTANTIATE_TEST_CASE_P macro choose between the default parameterized
387
+ // test name generator and user param name generator.
388
+ template <class ParamType, class ParamNameGenFunctor>
389
+ ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) {
390
+ return func;
391
+ }
392
+
393
+ template <class ParamType>
394
+ struct ParamNameGenFunc {
395
+ typedef std::string Type(const TestParamInfo<ParamType>&);
396
+ };
397
+
398
+ template <class ParamType>
399
+ typename ParamNameGenFunc<ParamType>::Type *GetParamNameGen() {
400
+ return DefaultParamName;
401
+ }
402
+
403
+ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
404
+ //
405
+ // Stores a parameter value and later creates tests parameterized with that
406
+ // value.
407
+ template <class TestClass>
408
+ class ParameterizedTestFactory : public TestFactoryBase {
409
+ public:
410
+ typedef typename TestClass::ParamType ParamType;
411
+ explicit ParameterizedTestFactory(ParamType parameter) :
412
+ parameter_(parameter) {}
413
+ virtual Test* CreateTest() {
414
+ TestClass::SetParam(&parameter_);
415
+ return new TestClass();
416
+ }
417
+
418
+ private:
419
+ const ParamType parameter_;
420
+
421
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
422
+ };
423
+
424
+ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
425
+ //
426
+ // TestMetaFactoryBase is a base class for meta-factories that create
427
+ // test factories for passing into MakeAndRegisterTestInfo function.
428
+ template <class ParamType>
429
+ class TestMetaFactoryBase {
430
+ public:
431
+ virtual ~TestMetaFactoryBase() {}
432
+
433
+ virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
434
+ };
435
+
436
+ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
437
+ //
438
+ // TestMetaFactory creates test factories for passing into
439
+ // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
440
+ // ownership of test factory pointer, same factory object cannot be passed
441
+ // into that method twice. But ParameterizedTestCaseInfo is going to call
442
+ // it for each Test/Parameter value combination. Thus it needs meta factory
443
+ // creator class.
444
+ template <class TestCase>
445
+ class TestMetaFactory
446
+ : public TestMetaFactoryBase<typename TestCase::ParamType> {
447
+ public:
448
+ typedef typename TestCase::ParamType ParamType;
449
+
450
+ TestMetaFactory() {}
451
+
452
+ virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
453
+ return new ParameterizedTestFactory<TestCase>(parameter);
454
+ }
455
+
456
+ private:
457
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
458
+ };
459
+
460
+ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
461
+ //
462
+ // ParameterizedTestCaseInfoBase is a generic interface
463
+ // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
464
+ // accumulates test information provided by TEST_P macro invocations
465
+ // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
466
+ // and uses that information to register all resulting test instances
467
+ // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
468
+ // a collection of pointers to the ParameterizedTestCaseInfo objects
469
+ // and calls RegisterTests() on each of them when asked.
470
+ class ParameterizedTestCaseInfoBase {
471
+ public:
472
+ virtual ~ParameterizedTestCaseInfoBase() {}
473
+
474
+ // Base part of test case name for display purposes.
475
+ virtual const string& GetTestCaseName() const = 0;
476
+ // Test case id to verify identity.
477
+ virtual TypeId GetTestCaseTypeId() const = 0;
478
+ // UnitTest class invokes this method to register tests in this
479
+ // test case right before running them in RUN_ALL_TESTS macro.
480
+ // This method should not be called more then once on any single
481
+ // instance of a ParameterizedTestCaseInfoBase derived class.
482
+ virtual void RegisterTests() = 0;
483
+
484
+ protected:
485
+ ParameterizedTestCaseInfoBase() {}
486
+
487
+ private:
488
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
489
+ };
490
+
491
+ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
492
+ //
493
+ // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
494
+ // macro invocations for a particular test case and generators
495
+ // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
496
+ // test case. It registers tests with all values generated by all
497
+ // generators when asked.
498
+ template <class TestCase>
499
+ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
500
+ public:
501
+ // ParamType and GeneratorCreationFunc are private types but are required
502
+ // for declarations of public methods AddTestPattern() and
503
+ // AddTestCaseInstantiation().
504
+ typedef typename TestCase::ParamType ParamType;
505
+ // A function that returns an instance of appropriate generator type.
506
+ typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
507
+ typedef typename ParamNameGenFunc<ParamType>::Type ParamNameGeneratorFunc;
508
+
509
+ explicit ParameterizedTestCaseInfo(
510
+ const char* name, CodeLocation code_location)
511
+ : test_case_name_(name), code_location_(code_location) {}
512
+
513
+ // Test case base name for display purposes.
514
+ virtual const string& GetTestCaseName() const { return test_case_name_; }
515
+ // Test case id to verify identity.
516
+ virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
517
+ // TEST_P macro uses AddTestPattern() to record information
518
+ // about a single test in a LocalTestInfo structure.
519
+ // test_case_name is the base name of the test case (without invocation
520
+ // prefix). test_base_name is the name of an individual test without
521
+ // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
522
+ // test case base name and DoBar is test base name.
523
+ void AddTestPattern(const char* test_case_name,
524
+ const char* test_base_name,
525
+ TestMetaFactoryBase<ParamType>* meta_factory) {
526
+ tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
527
+ test_base_name,
528
+ meta_factory)));
529
+ }
530
+ // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
531
+ // about a generator.
532
+ int AddTestCaseInstantiation(const string& instantiation_name,
533
+ GeneratorCreationFunc* func,
534
+ ParamNameGeneratorFunc* name_func,
535
+ const char* file,
536
+ int line) {
537
+ instantiations_.push_back(
538
+ InstantiationInfo(instantiation_name, func, name_func, file, line));
539
+ return 0; // Return value used only to run this method in namespace scope.
540
+ }
541
+ // UnitTest class invokes this method to register tests in this test case
542
+ // test cases right before running tests in RUN_ALL_TESTS macro.
543
+ // This method should not be called more then once on any single
544
+ // instance of a ParameterizedTestCaseInfoBase derived class.
545
+ // UnitTest has a guard to prevent from calling this method more then once.
546
+ virtual void RegisterTests() {
547
+ for (typename TestInfoContainer::iterator test_it = tests_.begin();
548
+ test_it != tests_.end(); ++test_it) {
549
+ linked_ptr<TestInfo> test_info = *test_it;
550
+ for (typename InstantiationContainer::iterator gen_it =
551
+ instantiations_.begin(); gen_it != instantiations_.end();
552
+ ++gen_it) {
553
+ const string& instantiation_name = gen_it->name;
554
+ ParamGenerator<ParamType> generator((*gen_it->generator)());
555
+ ParamNameGeneratorFunc* name_func = gen_it->name_func;
556
+ const char* file = gen_it->file;
557
+ int line = gen_it->line;
558
+
559
+ string test_case_name;
560
+ if ( !instantiation_name.empty() )
561
+ test_case_name = instantiation_name + "/";
562
+ test_case_name += test_info->test_case_base_name;
563
+
564
+ size_t i = 0;
565
+ std::set<std::string> test_param_names;
566
+ for (typename ParamGenerator<ParamType>::iterator param_it =
567
+ generator.begin();
568
+ param_it != generator.end(); ++param_it, ++i) {
569
+ Message test_name_stream;
570
+
571
+ std::string param_name = name_func(
572
+ TestParamInfo<ParamType>(*param_it, i));
573
+
574
+ GTEST_CHECK_(IsValidParamName(param_name))
575
+ << "Parameterized test name '" << param_name
576
+ << "' is invalid, in " << file
577
+ << " line " << line << std::endl;
578
+
579
+ GTEST_CHECK_(test_param_names.count(param_name) == 0)
580
+ << "Duplicate parameterized test name '" << param_name
581
+ << "', in " << file << " line " << line << std::endl;
582
+
583
+ test_param_names.insert(param_name);
584
+
585
+ test_name_stream << test_info->test_base_name << "/" << param_name;
586
+ MakeAndRegisterTestInfo(
587
+ test_case_name.c_str(),
588
+ test_name_stream.GetString().c_str(),
589
+ NULL, // No type parameter.
590
+ PrintToString(*param_it).c_str(),
591
+ code_location_,
592
+ GetTestCaseTypeId(),
593
+ TestCase::SetUpTestCase,
594
+ TestCase::TearDownTestCase,
595
+ test_info->test_meta_factory->CreateTestFactory(*param_it));
596
+ } // for param_it
597
+ } // for gen_it
598
+ } // for test_it
599
+ } // RegisterTests
600
+
601
+ private:
602
+ // LocalTestInfo structure keeps information about a single test registered
603
+ // with TEST_P macro.
604
+ struct TestInfo {
605
+ TestInfo(const char* a_test_case_base_name,
606
+ const char* a_test_base_name,
607
+ TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
608
+ test_case_base_name(a_test_case_base_name),
609
+ test_base_name(a_test_base_name),
610
+ test_meta_factory(a_test_meta_factory) {}
611
+
612
+ const string test_case_base_name;
613
+ const string test_base_name;
614
+ const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
615
+ };
616
+ typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
617
+ // Records data received from INSTANTIATE_TEST_CASE_P macros:
618
+ // <Instantiation name, Sequence generator creation function,
619
+ // Name generator function, Source file, Source line>
620
+ struct InstantiationInfo {
621
+ InstantiationInfo(const std::string &name_in,
622
+ GeneratorCreationFunc* generator_in,
623
+ ParamNameGeneratorFunc* name_func_in,
624
+ const char* file_in,
625
+ int line_in)
626
+ : name(name_in),
627
+ generator(generator_in),
628
+ name_func(name_func_in),
629
+ file(file_in),
630
+ line(line_in) {}
631
+
632
+ std::string name;
633
+ GeneratorCreationFunc* generator;
634
+ ParamNameGeneratorFunc* name_func;
635
+ const char* file;
636
+ int line;
637
+ };
638
+ typedef ::std::vector<InstantiationInfo> InstantiationContainer;
639
+
640
+ static bool IsValidParamName(const std::string& name) {
641
+ // Check for empty string
642
+ if (name.empty())
643
+ return false;
644
+
645
+ // Check for invalid characters
646
+ for (std::string::size_type index = 0; index < name.size(); ++index) {
647
+ if (!isalnum(name[index]) && name[index] != '_')
648
+ return false;
649
+ }
650
+
651
+ return true;
652
+ }
653
+
654
+ const string test_case_name_;
655
+ CodeLocation code_location_;
656
+ TestInfoContainer tests_;
657
+ InstantiationContainer instantiations_;
658
+
659
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
660
+ }; // class ParameterizedTestCaseInfo
661
+
662
+ // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
663
+ //
664
+ // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
665
+ // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
666
+ // macros use it to locate their corresponding ParameterizedTestCaseInfo
667
+ // descriptors.
668
+ class ParameterizedTestCaseRegistry {
669
+ public:
670
+ ParameterizedTestCaseRegistry() {}
671
+ ~ParameterizedTestCaseRegistry() {
672
+ for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
673
+ it != test_case_infos_.end(); ++it) {
674
+ delete *it;
675
+ }
676
+ }
677
+
678
+ // Looks up or creates and returns a structure containing information about
679
+ // tests and instantiations of a particular test case.
680
+ template <class TestCase>
681
+ ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
682
+ const char* test_case_name,
683
+ CodeLocation code_location) {
684
+ ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
685
+ for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
686
+ it != test_case_infos_.end(); ++it) {
687
+ if ((*it)->GetTestCaseName() == test_case_name) {
688
+ if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
689
+ // Complain about incorrect usage of Google Test facilities
690
+ // and terminate the program since we cannot guaranty correct
691
+ // test case setup and tear-down in this case.
692
+ ReportInvalidTestCaseType(test_case_name, code_location);
693
+ posix::Abort();
694
+ } else {
695
+ // At this point we are sure that the object we found is of the same
696
+ // type we are looking for, so we downcast it to that type
697
+ // without further checks.
698
+ typed_test_info = CheckedDowncastToActualType<
699
+ ParameterizedTestCaseInfo<TestCase> >(*it);
700
+ }
701
+ break;
702
+ }
703
+ }
704
+ if (typed_test_info == NULL) {
705
+ typed_test_info = new ParameterizedTestCaseInfo<TestCase>(
706
+ test_case_name, code_location);
707
+ test_case_infos_.push_back(typed_test_info);
708
+ }
709
+ return typed_test_info;
710
+ }
711
+ void RegisterTests() {
712
+ for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
713
+ it != test_case_infos_.end(); ++it) {
714
+ (*it)->RegisterTests();
715
+ }
716
+ }
717
+
718
+ private:
719
+ typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
720
+
721
+ TestCaseInfoContainer test_case_infos_;
722
+
723
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
724
+ };
725
+
726
+ } // namespace internal
727
+ } // namespace testing
728
+
729
+ #endif // GTEST_HAS_PARAM_TEST
730
+
731
+ #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_