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,498 @@
1
+ // Copyright 2007, 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 file implements Matcher<const string&>, Matcher<string>, and
35
+ // utilities for defining matchers.
36
+
37
+ #include "gmock/gmock-matchers.h"
38
+ #include "gmock/gmock-generated-matchers.h"
39
+
40
+ #include <string.h>
41
+ #include <sstream>
42
+ #include <string>
43
+
44
+ namespace testing {
45
+
46
+ // Constructs a matcher that matches a const string& whose value is
47
+ // equal to s.
48
+ Matcher<const internal::string&>::Matcher(const internal::string& s) {
49
+ *this = Eq(s);
50
+ }
51
+
52
+ // Constructs a matcher that matches a const string& whose value is
53
+ // equal to s.
54
+ Matcher<const internal::string&>::Matcher(const char* s) {
55
+ *this = Eq(internal::string(s));
56
+ }
57
+
58
+ // Constructs a matcher that matches a string whose value is equal to s.
59
+ Matcher<internal::string>::Matcher(const internal::string& s) { *this = Eq(s); }
60
+
61
+ // Constructs a matcher that matches a string whose value is equal to s.
62
+ Matcher<internal::string>::Matcher(const char* s) {
63
+ *this = Eq(internal::string(s));
64
+ }
65
+
66
+ #if GTEST_HAS_STRING_PIECE_
67
+ // Constructs a matcher that matches a const StringPiece& whose value is
68
+ // equal to s.
69
+ Matcher<const StringPiece&>::Matcher(const internal::string& s) {
70
+ *this = Eq(s);
71
+ }
72
+
73
+ // Constructs a matcher that matches a const StringPiece& whose value is
74
+ // equal to s.
75
+ Matcher<const StringPiece&>::Matcher(const char* s) {
76
+ *this = Eq(internal::string(s));
77
+ }
78
+
79
+ // Constructs a matcher that matches a const StringPiece& whose value is
80
+ // equal to s.
81
+ Matcher<const StringPiece&>::Matcher(StringPiece s) {
82
+ *this = Eq(s.ToString());
83
+ }
84
+
85
+ // Constructs a matcher that matches a StringPiece whose value is equal to s.
86
+ Matcher<StringPiece>::Matcher(const internal::string& s) {
87
+ *this = Eq(s);
88
+ }
89
+
90
+ // Constructs a matcher that matches a StringPiece whose value is equal to s.
91
+ Matcher<StringPiece>::Matcher(const char* s) {
92
+ *this = Eq(internal::string(s));
93
+ }
94
+
95
+ // Constructs a matcher that matches a StringPiece whose value is equal to s.
96
+ Matcher<StringPiece>::Matcher(StringPiece s) {
97
+ *this = Eq(s.ToString());
98
+ }
99
+ #endif // GTEST_HAS_STRING_PIECE_
100
+
101
+ namespace internal {
102
+
103
+ // Joins a vector of strings as if they are fields of a tuple; returns
104
+ // the joined string.
105
+ GTEST_API_ string JoinAsTuple(const Strings& fields) {
106
+ switch (fields.size()) {
107
+ case 0:
108
+ return "";
109
+ case 1:
110
+ return fields[0];
111
+ default:
112
+ string result = "(" + fields[0];
113
+ for (size_t i = 1; i < fields.size(); i++) {
114
+ result += ", ";
115
+ result += fields[i];
116
+ }
117
+ result += ")";
118
+ return result;
119
+ }
120
+ }
121
+
122
+ // Returns the description for a matcher defined using the MATCHER*()
123
+ // macro where the user-supplied description string is "", if
124
+ // 'negation' is false; otherwise returns the description of the
125
+ // negation of the matcher. 'param_values' contains a list of strings
126
+ // that are the print-out of the matcher's parameters.
127
+ GTEST_API_ string FormatMatcherDescription(bool negation,
128
+ const char* matcher_name,
129
+ const Strings& param_values) {
130
+ string result = ConvertIdentifierNameToWords(matcher_name);
131
+ if (param_values.size() >= 1)
132
+ result += " " + JoinAsTuple(param_values);
133
+ return negation ? "not (" + result + ")" : result;
134
+ }
135
+
136
+ // FindMaxBipartiteMatching and its helper class.
137
+ //
138
+ // Uses the well-known Ford-Fulkerson max flow method to find a maximum
139
+ // bipartite matching. Flow is considered to be from left to right.
140
+ // There is an implicit source node that is connected to all of the left
141
+ // nodes, and an implicit sink node that is connected to all of the
142
+ // right nodes. All edges have unit capacity.
143
+ //
144
+ // Neither the flow graph nor the residual flow graph are represented
145
+ // explicitly. Instead, they are implied by the information in 'graph' and
146
+ // a vector<int> called 'left_' whose elements are initialized to the
147
+ // value kUnused. This represents the initial state of the algorithm,
148
+ // where the flow graph is empty, and the residual flow graph has the
149
+ // following edges:
150
+ // - An edge from source to each left_ node
151
+ // - An edge from each right_ node to sink
152
+ // - An edge from each left_ node to each right_ node, if the
153
+ // corresponding edge exists in 'graph'.
154
+ //
155
+ // When the TryAugment() method adds a flow, it sets left_[l] = r for some
156
+ // nodes l and r. This induces the following changes:
157
+ // - The edges (source, l), (l, r), and (r, sink) are added to the
158
+ // flow graph.
159
+ // - The same three edges are removed from the residual flow graph.
160
+ // - The reverse edges (l, source), (r, l), and (sink, r) are added
161
+ // to the residual flow graph, which is a directional graph
162
+ // representing unused flow capacity.
163
+ //
164
+ // When the method augments a flow (moving left_[l] from some r1 to some
165
+ // other r2), this can be thought of as "undoing" the above steps with
166
+ // respect to r1 and "redoing" them with respect to r2.
167
+ //
168
+ // It bears repeating that the flow graph and residual flow graph are
169
+ // never represented explicitly, but can be derived by looking at the
170
+ // information in 'graph' and in left_.
171
+ //
172
+ // As an optimization, there is a second vector<int> called right_ which
173
+ // does not provide any new information. Instead, it enables more
174
+ // efficient queries about edges entering or leaving the right-side nodes
175
+ // of the flow or residual flow graphs. The following invariants are
176
+ // maintained:
177
+ //
178
+ // left[l] == kUnused or right[left[l]] == l
179
+ // right[r] == kUnused or left[right[r]] == r
180
+ //
181
+ // . [ source ] .
182
+ // . ||| .
183
+ // . ||| .
184
+ // . ||\--> left[0]=1 ---\ right[0]=-1 ----\ .
185
+ // . || | | .
186
+ // . |\---> left[1]=-1 \--> right[1]=0 ---\| .
187
+ // . | || .
188
+ // . \----> left[2]=2 ------> right[2]=2 --\|| .
189
+ // . ||| .
190
+ // . elements matchers vvv .
191
+ // . [ sink ] .
192
+ //
193
+ // See Also:
194
+ // [1] Cormen, et al (2001). "Section 26.2: The Ford-Fulkerson method".
195
+ // "Introduction to Algorithms (Second ed.)", pp. 651-664.
196
+ // [2] "Ford-Fulkerson algorithm", Wikipedia,
197
+ // 'http://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm'
198
+ class MaxBipartiteMatchState {
199
+ public:
200
+ explicit MaxBipartiteMatchState(const MatchMatrix& graph)
201
+ : graph_(&graph),
202
+ left_(graph_->LhsSize(), kUnused),
203
+ right_(graph_->RhsSize(), kUnused) {
204
+ }
205
+
206
+ // Returns the edges of a maximal match, each in the form {left, right}.
207
+ ElementMatcherPairs Compute() {
208
+ // 'seen' is used for path finding { 0: unseen, 1: seen }.
209
+ ::std::vector<char> seen;
210
+ // Searches the residual flow graph for a path from each left node to
211
+ // the sink in the residual flow graph, and if one is found, add flow
212
+ // to the graph. It's okay to search through the left nodes once. The
213
+ // edge from the implicit source node to each previously-visited left
214
+ // node will have flow if that left node has any path to the sink
215
+ // whatsoever. Subsequent augmentations can only add flow to the
216
+ // network, and cannot take away that previous flow unit from the source.
217
+ // Since the source-to-left edge can only carry one flow unit (or,
218
+ // each element can be matched to only one matcher), there is no need
219
+ // to visit the left nodes more than once looking for augmented paths.
220
+ // The flow is known to be possible or impossible by looking at the
221
+ // node once.
222
+ for (size_t ilhs = 0; ilhs < graph_->LhsSize(); ++ilhs) {
223
+ // Reset the path-marking vector and try to find a path from
224
+ // source to sink starting at the left_[ilhs] node.
225
+ GTEST_CHECK_(left_[ilhs] == kUnused)
226
+ << "ilhs: " << ilhs << ", left_[ilhs]: " << left_[ilhs];
227
+ // 'seen' initialized to 'graph_->RhsSize()' copies of 0.
228
+ seen.assign(graph_->RhsSize(), 0);
229
+ TryAugment(ilhs, &seen);
230
+ }
231
+ ElementMatcherPairs result;
232
+ for (size_t ilhs = 0; ilhs < left_.size(); ++ilhs) {
233
+ size_t irhs = left_[ilhs];
234
+ if (irhs == kUnused) continue;
235
+ result.push_back(ElementMatcherPair(ilhs, irhs));
236
+ }
237
+ return result;
238
+ }
239
+
240
+ private:
241
+ static const size_t kUnused = static_cast<size_t>(-1);
242
+
243
+ // Perform a depth-first search from left node ilhs to the sink. If a
244
+ // path is found, flow is added to the network by linking the left and
245
+ // right vector elements corresponding each segment of the path.
246
+ // Returns true if a path to sink was found, which means that a unit of
247
+ // flow was added to the network. The 'seen' vector elements correspond
248
+ // to right nodes and are marked to eliminate cycles from the search.
249
+ //
250
+ // Left nodes will only be explored at most once because they
251
+ // are accessible from at most one right node in the residual flow
252
+ // graph.
253
+ //
254
+ // Note that left_[ilhs] is the only element of left_ that TryAugment will
255
+ // potentially transition from kUnused to another value. Any other
256
+ // left_ element holding kUnused before TryAugment will be holding it
257
+ // when TryAugment returns.
258
+ //
259
+ bool TryAugment(size_t ilhs, ::std::vector<char>* seen) {
260
+ for (size_t irhs = 0; irhs < graph_->RhsSize(); ++irhs) {
261
+ if ((*seen)[irhs])
262
+ continue;
263
+ if (!graph_->HasEdge(ilhs, irhs))
264
+ continue;
265
+ // There's an available edge from ilhs to irhs.
266
+ (*seen)[irhs] = 1;
267
+ // Next a search is performed to determine whether
268
+ // this edge is a dead end or leads to the sink.
269
+ //
270
+ // right_[irhs] == kUnused means that there is residual flow from
271
+ // right node irhs to the sink, so we can use that to finish this
272
+ // flow path and return success.
273
+ //
274
+ // Otherwise there is residual flow to some ilhs. We push flow
275
+ // along that path and call ourselves recursively to see if this
276
+ // ultimately leads to sink.
277
+ if (right_[irhs] == kUnused || TryAugment(right_[irhs], seen)) {
278
+ // Add flow from left_[ilhs] to right_[irhs].
279
+ left_[ilhs] = irhs;
280
+ right_[irhs] = ilhs;
281
+ return true;
282
+ }
283
+ }
284
+ return false;
285
+ }
286
+
287
+ const MatchMatrix* graph_; // not owned
288
+ // Each element of the left_ vector represents a left hand side node
289
+ // (i.e. an element) and each element of right_ is a right hand side
290
+ // node (i.e. a matcher). The values in the left_ vector indicate
291
+ // outflow from that node to a node on the the right_ side. The values
292
+ // in the right_ indicate inflow, and specify which left_ node is
293
+ // feeding that right_ node, if any. For example, left_[3] == 1 means
294
+ // there's a flow from element #3 to matcher #1. Such a flow would also
295
+ // be redundantly represented in the right_ vector as right_[1] == 3.
296
+ // Elements of left_ and right_ are either kUnused or mutually
297
+ // referent. Mutually referent means that left_[right_[i]] = i and
298
+ // right_[left_[i]] = i.
299
+ ::std::vector<size_t> left_;
300
+ ::std::vector<size_t> right_;
301
+
302
+ GTEST_DISALLOW_ASSIGN_(MaxBipartiteMatchState);
303
+ };
304
+
305
+ const size_t MaxBipartiteMatchState::kUnused;
306
+
307
+ GTEST_API_ ElementMatcherPairs
308
+ FindMaxBipartiteMatching(const MatchMatrix& g) {
309
+ return MaxBipartiteMatchState(g).Compute();
310
+ }
311
+
312
+ static void LogElementMatcherPairVec(const ElementMatcherPairs& pairs,
313
+ ::std::ostream* stream) {
314
+ typedef ElementMatcherPairs::const_iterator Iter;
315
+ ::std::ostream& os = *stream;
316
+ os << "{";
317
+ const char *sep = "";
318
+ for (Iter it = pairs.begin(); it != pairs.end(); ++it) {
319
+ os << sep << "\n ("
320
+ << "element #" << it->first << ", "
321
+ << "matcher #" << it->second << ")";
322
+ sep = ",";
323
+ }
324
+ os << "\n}";
325
+ }
326
+
327
+ // Tries to find a pairing, and explains the result.
328
+ GTEST_API_ bool FindPairing(const MatchMatrix& matrix,
329
+ MatchResultListener* listener) {
330
+ ElementMatcherPairs matches = FindMaxBipartiteMatching(matrix);
331
+
332
+ size_t max_flow = matches.size();
333
+ bool result = (max_flow == matrix.RhsSize());
334
+
335
+ if (!result) {
336
+ if (listener->IsInterested()) {
337
+ *listener << "where no permutation of the elements can "
338
+ "satisfy all matchers, and the closest match is "
339
+ << max_flow << " of " << matrix.RhsSize()
340
+ << " matchers with the pairings:\n";
341
+ LogElementMatcherPairVec(matches, listener->stream());
342
+ }
343
+ return false;
344
+ }
345
+
346
+ if (matches.size() > 1) {
347
+ if (listener->IsInterested()) {
348
+ const char *sep = "where:\n";
349
+ for (size_t mi = 0; mi < matches.size(); ++mi) {
350
+ *listener << sep << " - element #" << matches[mi].first
351
+ << " is matched by matcher #" << matches[mi].second;
352
+ sep = ",\n";
353
+ }
354
+ }
355
+ }
356
+ return true;
357
+ }
358
+
359
+ bool MatchMatrix::NextGraph() {
360
+ for (size_t ilhs = 0; ilhs < LhsSize(); ++ilhs) {
361
+ for (size_t irhs = 0; irhs < RhsSize(); ++irhs) {
362
+ char& b = matched_[SpaceIndex(ilhs, irhs)];
363
+ if (!b) {
364
+ b = 1;
365
+ return true;
366
+ }
367
+ b = 0;
368
+ }
369
+ }
370
+ return false;
371
+ }
372
+
373
+ void MatchMatrix::Randomize() {
374
+ for (size_t ilhs = 0; ilhs < LhsSize(); ++ilhs) {
375
+ for (size_t irhs = 0; irhs < RhsSize(); ++irhs) {
376
+ char& b = matched_[SpaceIndex(ilhs, irhs)];
377
+ b = static_cast<char>(rand() & 1); // NOLINT
378
+ }
379
+ }
380
+ }
381
+
382
+ string MatchMatrix::DebugString() const {
383
+ ::std::stringstream ss;
384
+ const char *sep = "";
385
+ for (size_t i = 0; i < LhsSize(); ++i) {
386
+ ss << sep;
387
+ for (size_t j = 0; j < RhsSize(); ++j) {
388
+ ss << HasEdge(i, j);
389
+ }
390
+ sep = ";";
391
+ }
392
+ return ss.str();
393
+ }
394
+
395
+ void UnorderedElementsAreMatcherImplBase::DescribeToImpl(
396
+ ::std::ostream* os) const {
397
+ if (matcher_describers_.empty()) {
398
+ *os << "is empty";
399
+ return;
400
+ }
401
+ if (matcher_describers_.size() == 1) {
402
+ *os << "has " << Elements(1) << " and that element ";
403
+ matcher_describers_[0]->DescribeTo(os);
404
+ return;
405
+ }
406
+ *os << "has " << Elements(matcher_describers_.size())
407
+ << " and there exists some permutation of elements such that:\n";
408
+ const char* sep = "";
409
+ for (size_t i = 0; i != matcher_describers_.size(); ++i) {
410
+ *os << sep << " - element #" << i << " ";
411
+ matcher_describers_[i]->DescribeTo(os);
412
+ sep = ", and\n";
413
+ }
414
+ }
415
+
416
+ void UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(
417
+ ::std::ostream* os) const {
418
+ if (matcher_describers_.empty()) {
419
+ *os << "isn't empty";
420
+ return;
421
+ }
422
+ if (matcher_describers_.size() == 1) {
423
+ *os << "doesn't have " << Elements(1)
424
+ << ", or has " << Elements(1) << " that ";
425
+ matcher_describers_[0]->DescribeNegationTo(os);
426
+ return;
427
+ }
428
+ *os << "doesn't have " << Elements(matcher_describers_.size())
429
+ << ", or there exists no permutation of elements such that:\n";
430
+ const char* sep = "";
431
+ for (size_t i = 0; i != matcher_describers_.size(); ++i) {
432
+ *os << sep << " - element #" << i << " ";
433
+ matcher_describers_[i]->DescribeTo(os);
434
+ sep = ", and\n";
435
+ }
436
+ }
437
+
438
+ // Checks that all matchers match at least one element, and that all
439
+ // elements match at least one matcher. This enables faster matching
440
+ // and better error reporting.
441
+ // Returns false, writing an explanation to 'listener', if and only
442
+ // if the success criteria are not met.
443
+ bool UnorderedElementsAreMatcherImplBase::
444
+ VerifyAllElementsAndMatchersAreMatched(
445
+ const ::std::vector<string>& element_printouts,
446
+ const MatchMatrix& matrix,
447
+ MatchResultListener* listener) const {
448
+ bool result = true;
449
+ ::std::vector<char> element_matched(matrix.LhsSize(), 0);
450
+ ::std::vector<char> matcher_matched(matrix.RhsSize(), 0);
451
+
452
+ for (size_t ilhs = 0; ilhs < matrix.LhsSize(); ilhs++) {
453
+ for (size_t irhs = 0; irhs < matrix.RhsSize(); irhs++) {
454
+ char matched = matrix.HasEdge(ilhs, irhs);
455
+ element_matched[ilhs] |= matched;
456
+ matcher_matched[irhs] |= matched;
457
+ }
458
+ }
459
+
460
+ {
461
+ const char* sep =
462
+ "where the following matchers don't match any elements:\n";
463
+ for (size_t mi = 0; mi < matcher_matched.size(); ++mi) {
464
+ if (matcher_matched[mi])
465
+ continue;
466
+ result = false;
467
+ if (listener->IsInterested()) {
468
+ *listener << sep << "matcher #" << mi << ": ";
469
+ matcher_describers_[mi]->DescribeTo(listener->stream());
470
+ sep = ",\n";
471
+ }
472
+ }
473
+ }
474
+
475
+ {
476
+ const char* sep =
477
+ "where the following elements don't match any matchers:\n";
478
+ const char* outer_sep = "";
479
+ if (!result) {
480
+ outer_sep = "\nand ";
481
+ }
482
+ for (size_t ei = 0; ei < element_matched.size(); ++ei) {
483
+ if (element_matched[ei])
484
+ continue;
485
+ result = false;
486
+ if (listener->IsInterested()) {
487
+ *listener << outer_sep << sep << "element #" << ei << ": "
488
+ << element_printouts[ei];
489
+ sep = ",\n";
490
+ outer_sep = "";
491
+ }
492
+ }
493
+ }
494
+ return result;
495
+ }
496
+
497
+ } // namespace internal
498
+ } // namespace testing