ceedling 0.15.1 → 0.15.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 (295) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +9 -13
  4. data/README.md +21 -3
  5. data/{rakefile.rb → Rakefile} +0 -0
  6. data/lib/ceedling/version.rb +4 -4
  7. data/lib/ceedling/version.rb.erb +1 -1
  8. data/release/version.info +1 -1
  9. data/vendor/c_exception/Gemfile +1 -1
  10. data/vendor/c_exception/Gemfile.lock +12 -0
  11. data/vendor/c_exception/{docs/license.txt → LICENSE.txt} +9 -9
  12. data/vendor/c_exception/README.md +146 -0
  13. data/vendor/c_exception/{rakefile.rb → Rakefile} +6 -5
  14. data/vendor/c_exception/lib/CException.c +9 -6
  15. data/vendor/c_exception/release/build.info +1 -1
  16. data/vendor/c_exception/release/version.info +1 -1
  17. data/vendor/c_exception/test/CExceptionConfig.h +2 -0
  18. data/vendor/c_exception/test/TestException.c +4 -1
  19. data/vendor/cmock/README.md +24 -0
  20. data/vendor/cmock/{rakefile.rb → Rakefile} +12 -12
  21. data/vendor/cmock/docs/CMock Summary.odt +0 -0
  22. data/vendor/cmock/docs/CMock Summary.pdf +0 -0
  23. data/vendor/cmock/docs/CMock_Summary.md +130 -111
  24. data/vendor/cmock/docs/license.txt +1 -1
  25. data/vendor/cmock/lib/cmock.rb +36 -12
  26. data/vendor/cmock/lib/cmock_config.rb +39 -36
  27. data/vendor/cmock/lib/cmock_generator.rb +33 -25
  28. data/vendor/cmock/lib/cmock_generator_plugin_expect_any_args.rb +68 -0
  29. data/vendor/cmock/lib/cmock_generator_plugin_ignore.rb +18 -42
  30. data/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +2 -2
  31. data/vendor/cmock/lib/cmock_generator_utils.rb +39 -29
  32. data/vendor/cmock/lib/cmock_header_parser.rb +46 -39
  33. data/vendor/cmock/rakefile_helper.rb +38 -38
  34. data/vendor/cmock/src/cmock.c +20 -4
  35. data/vendor/cmock/src/cmock.h +6 -1
  36. data/vendor/cmock/src/cmock_internals.h +26 -3
  37. data/vendor/cmock/targets/clang_strict.yml +85 -0
  38. data/vendor/cmock/targets/gcc.yml +4 -2
  39. data/vendor/cmock/targets/gcc_64.yml +55 -0
  40. data/vendor/cmock/test/c/TestCMockC.c +3 -3
  41. data/vendor/cmock/test/c/TestCMockCDynamic.c +11 -11
  42. data/vendor/cmock/test/c/TestCMockCDynamic_Runner.c +4 -2
  43. data/vendor/cmock/test/c/TestCMockC_Runner.c +1 -1
  44. data/vendor/cmock/test/system/systest_generator.rb +38 -26
  45. data/vendor/cmock/test/system/test_compilation/const.h +8 -3
  46. data/vendor/cmock/test/system/test_interactions/all_plugins_but_other_limits.yml +92 -58
  47. data/vendor/cmock/test/system/test_interactions/all_plugins_coexist.yml +53 -48
  48. data/vendor/cmock/test/system/test_interactions/array_and_pointer_handling.yml +58 -56
  49. data/vendor/cmock/test/system/test_interactions/basic_expect_and_return.yml +19 -18
  50. data/vendor/cmock/test/system/test_interactions/expect_and_return_custom_types.yml +13 -13
  51. data/vendor/cmock/test/system/test_interactions/expect_and_return_treat_as.yml +20 -20
  52. data/vendor/cmock/test/system/test_interactions/expect_any_args.yml +238 -0
  53. data/vendor/cmock/test/system/test_interactions/fancy_pointer_handling.yml +36 -34
  54. data/vendor/cmock/test/system/test_interactions/ignore_and_return.yml +24 -15
  55. data/vendor/cmock/test/system/test_interactions/nonstandard_parsed_stuff_2.yml +11 -11
  56. data/vendor/cmock/test/system/test_interactions/return_thru_ptr_and_expect_any_args.yml +235 -0
  57. data/vendor/cmock/test/system/test_interactions/return_thru_ptr_ignore_arg.yml +22 -26
  58. data/vendor/cmock/test/system/test_interactions/stubs_with_callbacks.yml +31 -31
  59. data/vendor/cmock/test/unit/cmock_generator_main_test.rb +141 -109
  60. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb +82 -0
  61. data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_test.rb +17 -81
  62. data/vendor/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +10 -10
  63. data/vendor/cmock/test/unit/cmock_generator_utils_test.rb +47 -41
  64. data/vendor/cmock/test/unit/cmock_header_parser_test.rb +290 -227
  65. data/vendor/unity/{rakefile.rb → Rakefile} +13 -6
  66. data/vendor/unity/auto/colour_prompt.rb +33 -12
  67. data/vendor/unity/auto/generate_test_runner.rb +67 -63
  68. data/vendor/unity/auto/parseOutput.rb +189 -0
  69. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_1}/makefile +41 -40
  70. data/vendor/unity/examples/example_1/readme.txt +5 -0
  71. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_1}/src/ProductionCode.c +24 -24
  72. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_1}/src/ProductionCode.h +3 -3
  73. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_1}/src/ProductionCode2.c +9 -9
  74. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_1}/src/ProductionCode2.h +2 -2
  75. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_1}/test/TestProductionCode.c +62 -62
  76. data/vendor/unity/examples/{test → example_1/test}/TestProductionCode2.c +31 -31
  77. data/vendor/unity/examples/{test/no_ruby → example_1/test/test_runners}/TestProductionCode2_Runner.c +46 -46
  78. data/vendor/unity/examples/{test/no_ruby → example_1/test/test_runners}/TestProductionCode_Runner.c +50 -50
  79. data/vendor/unity/examples/example_2/makefile +45 -0
  80. data/vendor/unity/examples/example_2/readme.txt +5 -0
  81. data/vendor/unity/examples/{src → example_2/src}/ProductionCode.c +24 -24
  82. data/vendor/unity/examples/{src → example_2/src}/ProductionCode.h +3 -3
  83. data/vendor/unity/examples/{src → example_2/src}/ProductionCode2.c +9 -9
  84. data/vendor/unity/examples/{src → example_2/src}/ProductionCode2.h +2 -2
  85. data/vendor/unity/examples/{test → example_2/test}/TestProductionCode.c +64 -62
  86. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_2}/test/TestProductionCode2.c +33 -31
  87. data/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +9 -0
  88. data/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +11 -0
  89. data/vendor/unity/examples/example_2/test/test_runners/all_tests.c +12 -0
  90. data/vendor/unity/examples/{helper → example_3/helper}/UnityHelper.c +10 -10
  91. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/helper/UnityHelper.h +12 -12
  92. data/vendor/unity/examples/{makefile → example_3/makefile} +41 -40
  93. data/vendor/unity/examples/{rakefile.rb → example_3/rakefile.rb} +44 -43
  94. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/rakefile_helper.rb +256 -256
  95. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/readme.txt +18 -17
  96. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/src/ProductionCode.c +24 -24
  97. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/src/ProductionCode.h +3 -3
  98. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/src/ProductionCode2.c +9 -9
  99. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/src/ProductionCode2.h +2 -2
  100. data/vendor/{c_exception/vendor/unity/targets/gcc_64.yml → unity/examples/example_3/target_gcc_32.yml} +46 -44
  101. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/test/TestProductionCode.c +62 -62
  102. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/test/TestProductionCode2.c +31 -31
  103. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/test/no_ruby/TestProductionCode2_Runner.c +46 -46
  104. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/test/no_ruby/TestProductionCode_Runner.c +50 -50
  105. data/vendor/unity/extras/eclipse/error_parsers.txt +26 -0
  106. data/vendor/unity/extras/fixture/src/unity_fixture.c +4 -1
  107. data/vendor/unity/extras/fixture/src/unity_fixture.h +17 -16
  108. data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +7 -7
  109. data/vendor/unity/extras/fixture/test/unity_fixture_Test.c +17 -0
  110. data/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +1 -0
  111. data/vendor/unity/makefile +6 -4
  112. data/vendor/unity/rakefile_helper.rb +36 -27
  113. data/vendor/unity/src/unity.c +180 -181
  114. data/vendor/unity/src/unity.h +64 -2
  115. data/vendor/unity/src/unity_internals.h +188 -102
  116. data/vendor/unity/targets/clang_strict.yml +83 -0
  117. data/vendor/unity/targets/gcc_32.yml +5 -0
  118. data/vendor/unity/targets/gcc_64.yml +5 -0
  119. data/vendor/{c_exception/vendor/unity/targets/gcc.yml → unity/targets/gcc_auto_limits.yml} +5 -2
  120. data/vendor/{cmock/vendor/unity/targets/gcc_64.yml → unity/targets/gcc_auto_sizeof.yml} +6 -3
  121. data/vendor/{cmock/vendor/unity/targets/gcc.yml → unity/targets/gcc_auto_stdint.yml} +4 -2
  122. data/vendor/unity/test/expectdata/testsample_cmd.c +57 -54
  123. data/vendor/unity/test/expectdata/testsample_def.c +53 -50
  124. data/vendor/unity/test/expectdata/testsample_mock_cmd.c +79 -76
  125. data/vendor/unity/test/expectdata/testsample_mock_def.c +75 -72
  126. data/vendor/unity/test/expectdata/testsample_mock_new1.c +88 -85
  127. data/vendor/unity/test/expectdata/testsample_mock_new2.c +88 -85
  128. data/vendor/unity/test/expectdata/testsample_mock_param.c +76 -73
  129. data/vendor/unity/test/expectdata/testsample_mock_run1.c +88 -85
  130. data/vendor/unity/test/expectdata/testsample_mock_run2.c +88 -85
  131. data/vendor/unity/test/expectdata/testsample_mock_yaml.c +89 -86
  132. data/vendor/unity/test/expectdata/testsample_new1.c +63 -60
  133. data/vendor/unity/test/expectdata/testsample_new2.c +66 -63
  134. data/vendor/unity/test/expectdata/testsample_param.c +54 -51
  135. data/vendor/unity/test/expectdata/testsample_run1.c +63 -60
  136. data/vendor/unity/test/expectdata/testsample_run2.c +66 -63
  137. data/vendor/unity/test/expectdata/testsample_yaml.c +67 -64
  138. data/vendor/unity/test/test_generate_test_runner.rb +66 -72
  139. data/vendor/unity/test/testunity.c +591 -111
  140. metadata +58 -195
  141. data/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +0 -94
  142. data/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +0 -39
  143. data/vendor/c_exception/vendor/unity/auto/generate_config.yml +0 -36
  144. data/vendor/c_exception/vendor/unity/auto/generate_module.rb +0 -202
  145. data/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +0 -313
  146. data/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +0 -23
  147. data/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +0 -139
  148. data/vendor/c_exception/vendor/unity/docs/Unity Summary.odt +0 -0
  149. data/vendor/c_exception/vendor/unity/docs/Unity Summary.pdf +0 -0
  150. data/vendor/c_exception/vendor/unity/docs/Unity Summary.txt +0 -217
  151. data/vendor/c_exception/vendor/unity/docs/license.txt +0 -31
  152. data/vendor/c_exception/vendor/unity/examples/helper/UnityHelper.c +0 -10
  153. data/vendor/c_exception/vendor/unity/examples/helper/UnityHelper.h +0 -12
  154. data/vendor/c_exception/vendor/unity/examples/makefile +0 -40
  155. data/vendor/c_exception/vendor/unity/examples/rakefile.rb +0 -32
  156. data/vendor/c_exception/vendor/unity/examples/rakefile_helper.rb +0 -256
  157. data/vendor/c_exception/vendor/unity/examples/test/no_ruby/TestProductionCode_Runner.c +0 -50
  158. data/vendor/c_exception/vendor/unity/extras/fixture/build/MakefileWorker.mk +0 -331
  159. data/vendor/c_exception/vendor/unity/extras/fixture/build/filterGcov.sh +0 -61
  160. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +0 -37
  161. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +0 -178
  162. data/vendor/c_exception/vendor/unity/extras/fixture/readme.txt +0 -9
  163. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +0 -381
  164. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +0 -81
  165. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +0 -44
  166. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +0 -16
  167. data/vendor/c_exception/vendor/unity/extras/fixture/test/main/AllTests.c +0 -21
  168. data/vendor/c_exception/vendor/unity/extras/fixture/test/testunity_fixture.c +0 -39
  169. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +0 -321
  170. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +0 -40
  171. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.c +0 -56
  172. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.h +0 -17
  173. data/vendor/c_exception/vendor/unity/makefile +0 -35
  174. data/vendor/c_exception/vendor/unity/rakefile.rb +0 -59
  175. data/vendor/c_exception/vendor/unity/rakefile_helper.rb +0 -240
  176. data/vendor/c_exception/vendor/unity/release/build.info +0 -2
  177. data/vendor/c_exception/vendor/unity/release/version.info +0 -2
  178. data/vendor/c_exception/vendor/unity/src/unity.c +0 -979
  179. data/vendor/c_exception/vendor/unity/src/unity.h +0 -232
  180. data/vendor/c_exception/vendor/unity/src/unity_internals.h +0 -424
  181. data/vendor/c_exception/vendor/unity/targets/hitech_picc18.yml +0 -101
  182. data/vendor/c_exception/vendor/unity/targets/iar_arm_v4.yml +0 -89
  183. data/vendor/c_exception/vendor/unity/targets/iar_arm_v5.yml +0 -79
  184. data/vendor/c_exception/vendor/unity/targets/iar_arm_v5_3.yml +0 -79
  185. data/vendor/c_exception/vendor/unity/targets/iar_armcortex_LM3S9B92_v5_4.yml +0 -93
  186. data/vendor/c_exception/vendor/unity/targets/iar_cortexm3_v5.yml +0 -83
  187. data/vendor/c_exception/vendor/unity/targets/iar_msp430.yml +0 -94
  188. data/vendor/c_exception/vendor/unity/targets/iar_sh2a_v6.yml +0 -85
  189. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_cmd.c +0 -54
  190. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_def.c +0 -50
  191. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_cmd.c +0 -76
  192. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_def.c +0 -72
  193. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new1.c +0 -85
  194. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new2.c +0 -85
  195. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_param.c +0 -73
  196. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run1.c +0 -85
  197. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run2.c +0 -85
  198. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_yaml.c +0 -86
  199. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_new1.c +0 -60
  200. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_new2.c +0 -63
  201. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_param.c +0 -51
  202. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_run1.c +0 -60
  203. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_run2.c +0 -63
  204. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_yaml.c +0 -64
  205. data/vendor/c_exception/vendor/unity/test/test_generate_test_runner.rb +0 -94
  206. data/vendor/c_exception/vendor/unity/test/testdata/mocksample.c +0 -51
  207. data/vendor/c_exception/vendor/unity/test/testdata/sample.yml +0 -9
  208. data/vendor/c_exception/vendor/unity/test/testdata/testsample.c +0 -51
  209. data/vendor/c_exception/vendor/unity/test/testparameterized.c +0 -101
  210. data/vendor/c_exception/vendor/unity/test/testunity.c +0 -2024
  211. data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
  212. data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
  213. data/vendor/cmock/vendor/c_exception/docs/license.txt +0 -30
  214. data/vendor/cmock/vendor/c_exception/docs/readme.txt +0 -236
  215. data/vendor/cmock/vendor/c_exception/lib/CException.c +0 -39
  216. data/vendor/cmock/vendor/c_exception/lib/CException.h +0 -70
  217. data/vendor/cmock/vendor/c_exception/makefile +0 -24
  218. data/vendor/cmock/vendor/c_exception/rakefile.rb +0 -41
  219. data/vendor/cmock/vendor/c_exception/release/build.info +0 -2
  220. data/vendor/cmock/vendor/c_exception/release/version.info +0 -2
  221. data/vendor/cmock/vendor/c_exception/test/CExceptionConfig.h +0 -27
  222. data/vendor/cmock/vendor/c_exception/test/TestException.c +0 -291
  223. data/vendor/cmock/vendor/c_exception/test/TestException_Runner.c +0 -62
  224. data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +0 -94
  225. data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +0 -39
  226. data/vendor/cmock/vendor/unity/auto/generate_config.yml +0 -36
  227. data/vendor/cmock/vendor/unity/auto/generate_module.rb +0 -202
  228. data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +0 -313
  229. data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +0 -23
  230. data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +0 -139
  231. data/vendor/cmock/vendor/unity/docs/Unity Summary.odt +0 -0
  232. data/vendor/cmock/vendor/unity/docs/Unity Summary.pdf +0 -0
  233. data/vendor/cmock/vendor/unity/docs/Unity Summary.txt +0 -217
  234. data/vendor/cmock/vendor/unity/docs/license.txt +0 -31
  235. data/vendor/cmock/vendor/unity/examples/helper/UnityHelper.c +0 -10
  236. data/vendor/cmock/vendor/unity/examples/rakefile.rb +0 -32
  237. data/vendor/cmock/vendor/unity/examples/readme.txt +0 -18
  238. data/vendor/cmock/vendor/unity/examples/test/no_ruby/TestProductionCode2_Runner.c +0 -46
  239. data/vendor/cmock/vendor/unity/extras/fixture/build/MakefileWorker.mk +0 -331
  240. data/vendor/cmock/vendor/unity/extras/fixture/build/filterGcov.sh +0 -61
  241. data/vendor/cmock/vendor/unity/extras/fixture/rakefile.rb +0 -37
  242. data/vendor/cmock/vendor/unity/extras/fixture/rakefile_helper.rb +0 -178
  243. data/vendor/cmock/vendor/unity/extras/fixture/readme.txt +0 -9
  244. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +0 -381
  245. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +0 -81
  246. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +0 -44
  247. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +0 -16
  248. data/vendor/cmock/vendor/unity/extras/fixture/test/main/AllTests.c +0 -21
  249. data/vendor/cmock/vendor/unity/extras/fixture/test/testunity_fixture.c +0 -39
  250. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +0 -321
  251. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +0 -40
  252. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.c +0 -56
  253. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.h +0 -17
  254. data/vendor/cmock/vendor/unity/makefile +0 -35
  255. data/vendor/cmock/vendor/unity/rakefile.rb +0 -48
  256. data/vendor/cmock/vendor/unity/rakefile_helper.rb +0 -240
  257. data/vendor/cmock/vendor/unity/release/build.info +0 -2
  258. data/vendor/cmock/vendor/unity/release/version.info +0 -2
  259. data/vendor/cmock/vendor/unity/src/unity.c +0 -979
  260. data/vendor/cmock/vendor/unity/src/unity.h +0 -232
  261. data/vendor/cmock/vendor/unity/src/unity_internals.h +0 -424
  262. data/vendor/cmock/vendor/unity/targets/hitech_picc18.yml +0 -101
  263. data/vendor/cmock/vendor/unity/targets/iar_arm_v4.yml +0 -89
  264. data/vendor/cmock/vendor/unity/targets/iar_arm_v5.yml +0 -79
  265. data/vendor/cmock/vendor/unity/targets/iar_arm_v5_3.yml +0 -79
  266. data/vendor/cmock/vendor/unity/targets/iar_armcortex_LM3S9B92_v5_4.yml +0 -93
  267. data/vendor/cmock/vendor/unity/targets/iar_cortexm3_v5.yml +0 -83
  268. data/vendor/cmock/vendor/unity/targets/iar_msp430.yml +0 -94
  269. data/vendor/cmock/vendor/unity/targets/iar_sh2a_v6.yml +0 -85
  270. data/vendor/cmock/vendor/unity/test/expectdata/testsample_cmd.c +0 -54
  271. data/vendor/cmock/vendor/unity/test/expectdata/testsample_def.c +0 -50
  272. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c +0 -76
  273. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_def.c +0 -72
  274. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c +0 -85
  275. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c +0 -85
  276. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_param.c +0 -73
  277. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c +0 -85
  278. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c +0 -85
  279. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c +0 -86
  280. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new1.c +0 -60
  281. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new2.c +0 -63
  282. data/vendor/cmock/vendor/unity/test/expectdata/testsample_param.c +0 -51
  283. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run1.c +0 -60
  284. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run2.c +0 -63
  285. data/vendor/cmock/vendor/unity/test/expectdata/testsample_yaml.c +0 -64
  286. data/vendor/cmock/vendor/unity/test/test_generate_test_runner.rb +0 -94
  287. data/vendor/cmock/vendor/unity/test/testdata/mocksample.c +0 -51
  288. data/vendor/cmock/vendor/unity/test/testdata/sample.yml +0 -9
  289. data/vendor/cmock/vendor/unity/test/testdata/testsample.c +0 -51
  290. data/vendor/cmock/vendor/unity/test/testparameterized.c +0 -101
  291. data/vendor/cmock/vendor/unity/test/testunity.c +0 -2024
  292. data/vendor/unity/Gemfile +0 -4
  293. data/vendor/unity/examples/helper/UnityHelper.h +0 -12
  294. data/vendor/unity/examples/rakefile_helper.rb +0 -256
  295. data/vendor/unity/examples/readme.txt +0 -18
@@ -0,0 +1,82 @@
1
+ # ==========================================
2
+ # CMock Project - Automatic Mock Generation for C
3
+ # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
4
+ # [Released under MIT License. Please refer to license.txt for details]
5
+ # ==========================================
6
+
7
+ require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
8
+ require 'cmock_generator_plugin_expect_any_args.rb'
9
+
10
+ class CMockGeneratorPluginExpectAnyArgsTest < Test::Unit::TestCase
11
+ def setup
12
+ create_mocks :config, :utils
13
+ @config.stubs!(:respond_to?).returns(true)
14
+ @cmock_generator_plugin_expect_any_args = CMockGeneratorPluginExpectAnyArgs.new(@config, @utils)
15
+ end
16
+
17
+ def teardown
18
+ end
19
+
20
+ should "have set up internal accessors correctly on init" do
21
+ assert_equal(@config, @cmock_generator_plugin_expect_any_args.config)
22
+ assert_equal(@utils, @cmock_generator_plugin_expect_any_args.utils)
23
+ assert_equal(3, @cmock_generator_plugin_expect_any_args.priority)
24
+ end
25
+
26
+ should "not have any additional include file requirements" do
27
+ assert(!@cmock_generator_plugin_expect_any_args.respond_to?(:include_files))
28
+ end
29
+
30
+ should "handle function declarations for functions without return values" do
31
+ function = {:name => "Mold", :args_string => "void", :return => test_return[:void]}
32
+ expected = "#define Mold_ExpectAnyArgs() Mold_CMockExpectAnyArgs(__LINE__)\nvoid Mold_CMockExpectAnyArgs(UNITY_LINE_TYPE cmock_line);\n"
33
+ returned = @cmock_generator_plugin_expect_any_args.mock_function_declarations(function)
34
+ assert_equal(expected, returned)
35
+ end
36
+
37
+ should "handle function declarations for functions that returns something" do
38
+ function = {:name => "Fungus", :args_string => "void", :return => test_return[:string]}
39
+ expected = "#define Fungus_ExpectAnyArgsAndReturn(cmock_retval) Fungus_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval)\n"+
40
+ "void Fungus_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, const char* cmock_to_return);\n"
41
+ returned = @cmock_generator_plugin_expect_any_args.mock_function_declarations(function)
42
+ assert_equal(expected, returned)
43
+ end
44
+
45
+ should "add required code to implementation with void function" do
46
+ function = {:name => "Mold", :args_string => "void", :return => test_return[:void]}
47
+ expected = [" if (cmock_call_instance->IgnoreMode == CMOCK_ARG_NONE)\n",
48
+ " {\n",
49
+ " return;\n",
50
+ " }\n"
51
+ ].join
52
+ returned = @cmock_generator_plugin_expect_any_args.mock_implementation(function)
53
+ assert_equal(expected, returned)
54
+ end
55
+
56
+ should "add required code to implementation with return functions" do
57
+ function = {:name => "Fungus", :args_string => "void", :return => test_return[:int]}
58
+ retval = test_return[:int].merge({ :name => "cmock_call_instance->ReturnVal"})
59
+ @utils.expect.code_assign_argument_quickly("Mock.Fungus_FinalReturn", retval).returns(' mock_retval_0')
60
+ expected = [" if (cmock_call_instance->IgnoreMode == CMOCK_ARG_NONE)\n",
61
+ " {\n",
62
+ " mock_retval_0",
63
+ " return cmock_call_instance->ReturnVal;\n",
64
+ " }\n"
65
+ ].join
66
+ returned = @cmock_generator_plugin_expect_any_args.mock_implementation(function)
67
+ assert_equal(expected, returned)
68
+ end
69
+
70
+ should "add a new mock interface for ignoring when function had no return value" do
71
+ function = {:name => "Slime", :args => [], :args_string => "void", :return => test_return[:void]}
72
+ expected = ["void Slime_CMockExpectAnyArgs(UNITY_LINE_TYPE cmock_line)\n",
73
+ "{\n",
74
+ "mock_return_1",
75
+ " cmock_call_instance->IgnoreMode = CMOCK_ARG_NONE;\n",
76
+ "}\n\n"
77
+ ].join
78
+ @utils.expect.code_add_base_expectation("Slime", true).returns("mock_return_1")
79
+ returned = @cmock_generator_plugin_expect_any_args.mock_interfaces(function)
80
+ assert_equal(expected, returned)
81
+ end
82
+ end
@@ -2,7 +2,7 @@
2
2
  # CMock Project - Automatic Mock Generation for C
3
3
  # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
4
4
  # [Released under MIT License. Please refer to license.txt for details]
5
- # ==========================================
5
+ # ==========================================
6
6
 
7
7
  require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
8
8
  require 'cmock_generator_plugin_ignore'
@@ -10,50 +10,37 @@ require 'cmock_generator_plugin_ignore'
10
10
  class CMockGeneratorPluginIgnoreTest < Test::Unit::TestCase
11
11
  def setup
12
12
  create_mocks :config, :utils
13
- @config.expect.ignore.returns(:args_and_calls)
14
13
  @config.stubs!(:respond_to?).returns(true)
15
14
  @cmock_generator_plugin_ignore = CMockGeneratorPluginIgnore.new(@config, @utils)
16
-
17
- @config.expect.ignore.returns(:args_only)
18
- @cmock_generator_plugin_ignore_just_args = CMockGeneratorPluginIgnore.new(@config, @utils)
19
15
  end
20
16
 
21
17
  def teardown
22
18
  end
23
-
19
+
24
20
  should "have set up internal accessors correctly on init" do
25
21
  assert_equal(@config, @cmock_generator_plugin_ignore.config)
26
22
  assert_equal(@utils, @cmock_generator_plugin_ignore.utils)
27
23
  assert_equal(2, @cmock_generator_plugin_ignore.priority)
28
24
  end
29
-
25
+
30
26
  should "not have any additional include file requirements" do
31
27
  assert(!@cmock_generator_plugin_ignore.respond_to?(:include_files))
32
28
  end
33
-
29
+
34
30
  should "add a required variable to the instance structure" do
35
31
  function = {:name => "Grass", :args => [], :return => test_return[:void]}
36
32
  expected = " int Grass_IgnoreBool;\n"
37
33
  returned = @cmock_generator_plugin_ignore.instance_structure(function)
38
34
  assert_equal(expected, returned)
39
35
  end
40
-
41
- should "handle function declarations for functions without return values when args_only" do
42
- function = {:name => "Mold", :args_string => "void", :return => test_return[:void]}
43
- expected = "#define Mold_Ignore() Mold_CMockIgnore(__LINE__)\nvoid Mold_CMockIgnore(UNITY_LINE_TYPE cmock_line);\n"
44
- @config.expect.ignore.returns(:args_only)
45
- returned = @cmock_generator_plugin_ignore.mock_function_declarations(function)
46
- assert_equal(expected, returned)
47
- end
48
-
49
- should "handle function declarations for functions without return values when args_and_calls" do
36
+
37
+ should "handle function declarations for functions without return values" do
50
38
  function = {:name => "Mold", :args_string => "void", :return => test_return[:void]}
51
39
  expected = "#define Mold_Ignore() Mold_CMockIgnore()\nvoid Mold_CMockIgnore(void);\n"
52
- @config.expect.ignore.returns(:args_and_calls)
53
40
  returned = @cmock_generator_plugin_ignore.mock_function_declarations(function)
54
41
  assert_equal(expected, returned)
55
42
  end
56
-
43
+
57
44
  should "handle function declarations for functions that returns something" do
58
45
  function = {:name => "Fungus", :args_string => "void", :return => test_return[:string]}
59
46
  expected = "#define Fungus_IgnoreAndReturn(cmock_retval) Fungus_CMockIgnoreAndReturn(__LINE__, cmock_retval)\n"+
@@ -61,69 +48,34 @@ class CMockGeneratorPluginIgnoreTest < Test::Unit::TestCase
61
48
  returned = @cmock_generator_plugin_ignore.mock_function_declarations(function)
62
49
  assert_equal(expected, returned)
63
50
  end
64
-
65
- should "add required code to implementation precheck with void function (when :args_and_calls)" do
51
+
52
+ should "add required code to implementation precheck with void function" do
66
53
  function = {:name => "Mold", :args_string => "void", :return => test_return[:void]}
67
54
  expected = [" if (Mock.Mold_IgnoreBool)\n",
68
55
  " {\n",
69
56
  " return;\n",
70
57
  " }\n"
71
58
  ].join
72
- returned = @cmock_generator_plugin_ignore.mock_implementation_for_ignores(function)
73
- assert_equal(expected, returned)
74
- end
75
-
76
- should "add required code to implementation precheck with return functions (when :args_and_calls)" do
77
- function = {:name => "Fungus", :args_string => "void", :return => test_return[:int]}
78
- retval = test_return[:int].merge({ :name => "cmock_call_instance->ReturnVal"})
79
- @utils.expect.code_assign_argument_quickly("Mock.Fungus_FinalReturn", retval).returns(' mock_retval_0')
80
- expected = [" if (Mock.Fungus_IgnoreBool)\n",
81
- " {\n",
82
- " if (cmock_call_instance == NULL)\n",
83
- " return Mock.Fungus_FinalReturn;\n",
84
- " mock_retval_0",
85
- " return cmock_call_instance->ReturnVal;\n",
86
- " }\n"
87
- ].join
88
- returned = @cmock_generator_plugin_ignore.mock_implementation_for_ignores(function)
89
- assert_equal(expected, returned)
90
- end
91
-
92
- should "not add code to implementation prefix (when :args_only)" do
93
- function = {:name => "Fungus", :args_string => "void", :return => test_return[:int]}
94
- retval = test_return[:int].merge({ :name => "cmock_call_instance->ReturnVal"})
95
- expected = ""
96
59
  returned = @cmock_generator_plugin_ignore.mock_implementation_precheck(function)
97
60
  assert_equal(expected, returned)
98
61
  end
99
-
100
- should "add required code to implementation with void function (when :args_only)" do
101
- function = {:name => "Mold", :args_string => "void", :return => test_return[:void]}
102
- expected = [" if (Mock.Mold_IgnoreBool)\n",
103
- " {\n",
104
- " return;\n",
105
- " }\n"
106
- ].join
107
- returned = @cmock_generator_plugin_ignore_just_args.mock_implementation(function)
108
- assert_equal(expected, returned)
109
- end
110
-
111
- should "add required code to implementation with return functions (when :args_only)" do
62
+
63
+ should "add required code to implementation precheck with return functions" do
112
64
  function = {:name => "Fungus", :args_string => "void", :return => test_return[:int]}
113
65
  retval = test_return[:int].merge({ :name => "cmock_call_instance->ReturnVal"})
114
66
  @utils.expect.code_assign_argument_quickly("Mock.Fungus_FinalReturn", retval).returns(' mock_retval_0')
115
67
  expected = [" if (Mock.Fungus_IgnoreBool)\n",
116
68
  " {\n",
117
69
  " if (cmock_call_instance == NULL)\n",
118
- " return Mock.Fungus_FinalReturn;\n",
70
+ " return (int)Mock.Fungus_FinalReturn;\n",
119
71
  " mock_retval_0",
120
- " return cmock_call_instance->ReturnVal;\n",
72
+ " return (int)cmock_call_instance->ReturnVal;\n",
121
73
  " }\n"
122
74
  ].join
123
- returned = @cmock_generator_plugin_ignore_just_args.mock_implementation(function)
75
+ returned = @cmock_generator_plugin_ignore.mock_implementation_precheck(function)
124
76
  assert_equal(expected, returned)
125
77
  end
126
-
78
+
127
79
  should "add a new mock interface for ignoring when function had no return value" do
128
80
  function = {:name => "Slime", :args => [], :args_string => "void", :return => test_return[:void]}
129
81
  expected = ["void Slime_CMockIgnore(void)\n",
@@ -131,28 +83,12 @@ class CMockGeneratorPluginIgnoreTest < Test::Unit::TestCase
131
83
  " Mock.Slime_IgnoreBool = (int)1;\n",
132
84
  "}\n\n"
133
85
  ].join
134
- @config.expect.ignore.returns(:args_and_calls)
135
- returned = @cmock_generator_plugin_ignore.mock_interfaces(function)
136
- assert_equal(expected, returned)
137
- end
138
-
139
- should "add a new mock interface for ignoring when function had no return value and we are checking args only" do
140
- function = {:name => "Slime", :args => [], :args_string => "void", :return => test_return[:void]}
141
- expected = ["void Slime_CMockIgnore(UNITY_LINE_TYPE cmock_line)\n",
142
- "{\n",
143
- "mock_return_1",
144
- " Mock.Slime_IgnoreBool = (int)1;\n",
145
- "}\n\n"
146
- ].join
147
- @config.expect.ignore.returns(:args_only)
148
- @utils.expect.code_add_base_expectation("Slime", true).returns("mock_return_1")
149
86
  returned = @cmock_generator_plugin_ignore.mock_interfaces(function)
150
87
  assert_equal(expected, returned)
151
88
  end
152
-
89
+
153
90
  should "add a new mock interface for ignoring when function has return value" do
154
91
  function = {:name => "Slime", :args => [], :args_string => "void", :return => test_return[:int]}
155
- @config.expect.ignore.returns(:args_and_calls)
156
92
  @utils.expect.code_add_base_expectation("Slime", false).returns("mock_return_1")
157
93
  expected = ["void Slime_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return)\n",
158
94
  "{\n",
@@ -164,5 +100,5 @@ class CMockGeneratorPluginIgnoreTest < Test::Unit::TestCase
164
100
  returned = @cmock_generator_plugin_ignore.mock_interfaces(function)
165
101
  assert_equal(expected, returned)
166
102
  end
167
-
103
+
168
104
  end
@@ -2,7 +2,7 @@
2
2
  # CMock Project - Automatic Mock Generation for C
3
3
  # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
4
4
  # [Released under MIT License. Please refer to license.txt for details]
5
- # ==========================================
5
+ # ==========================================
6
6
 
7
7
  require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
8
8
  require 'cmock_generator_plugin_return_thru_ptr'
@@ -21,7 +21,7 @@ class CMockGeneratorPluginReturnThruPtrTest < Test::Unit::TestCase
21
21
  :contains_ptr? => false}
22
22
 
23
23
  # void Pine(int chicken, const int beef, int *tofu)
24
- @complex_func = {:name => "Pine",
24
+ @complex_func = {:name => "Pine",
25
25
  :args => [{ :type => "int",
26
26
  :name => "chicken",
27
27
  :ptr? => false,
@@ -35,7 +35,7 @@ class CMockGeneratorPluginReturnThruPtrTest < Test::Unit::TestCase
35
35
  :name => "tofu",
36
36
  :ptr? => true,
37
37
  }],
38
- :return => test_return[:void],
38
+ :return => test_return[:void],
39
39
  :contains_ptr? => true }
40
40
 
41
41
  #no strict ordering
@@ -54,13 +54,13 @@ class CMockGeneratorPluginReturnThruPtrTest < Test::Unit::TestCase
54
54
  @utils.expect.ptr_or_str?('int*').returns(true)
55
55
  @utils.expect.ptr_or_str?('int*').returns(true)
56
56
  end
57
-
57
+
58
58
  should "have set up internal accessors correctly on init" do
59
59
  assert_equal(@utils, @cmock_generator_plugin_return_thru_ptr.utils)
60
- assert_equal(9, @cmock_generator_plugin_return_thru_ptr.priority)
60
+ assert_equal(1, @cmock_generator_plugin_return_thru_ptr.priority)
61
61
  end
62
-
63
- should "not include any additional include files" do
62
+
63
+ should "not include any additional include files" do
64
64
  assert(!@cmock_generator_plugin_return_thru_ptr.respond_to?(:include_files))
65
65
  end
66
66
 
@@ -68,7 +68,7 @@ class CMockGeneratorPluginReturnThruPtrTest < Test::Unit::TestCase
68
68
  returned = @cmock_generator_plugin_return_thru_ptr.instance_typedefs(@void_func)
69
69
  assert_equal("", returned)
70
70
  end
71
-
71
+
72
72
  should "add to tyepdef structure mock needs of functions of style 'void func(int chicken, int* pork)'" do
73
73
  complex_func_expect()
74
74
  expected = " int ReturnThruPtr_tofu_Used;\n" +
@@ -86,12 +86,12 @@ class CMockGeneratorPluginReturnThruPtrTest < Test::Unit::TestCase
86
86
 
87
87
  should "add a mock function declaration only for non-const pointer arguments" do
88
88
  complex_func_expect();
89
-
89
+
90
90
  expected =
91
91
  "#define Pine_ReturnThruPtr_tofu(tofu)" +
92
92
  " Pine_CMockReturnMemThruPtr_tofu(__LINE__, tofu, sizeof(*tofu))\n" +
93
93
  "#define Pine_ReturnArrayThruPtr_tofu(tofu, cmock_len)" +
94
- " Pine_CMockReturnMemThruPtr_tofu(__LINE__, tofu, cmock_len * sizeof(*tofu))\n" +
94
+ " Pine_CMockReturnMemThruPtr_tofu(__LINE__, tofu, (int)(cmock_len * (int)sizeof(*tofu)))\n" +
95
95
  "#define Pine_ReturnMemThruPtr_tofu(tofu, cmock_size)" +
96
96
  " Pine_CMockReturnMemThruPtr_tofu(__LINE__, tofu, cmock_size)\n" +
97
97
  "void Pine_CMockReturnMemThruPtr_tofu(UNITY_LINE_TYPE cmock_line, int* tofu, int cmock_size);\n"
@@ -2,7 +2,7 @@
2
2
  # CMock Project - Automatic Mock Generation for C
3
3
  # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
4
4
  # [Released under MIT License. Please refer to license.txt for details]
5
- # ==========================================
5
+ # ==========================================
6
6
 
7
7
  require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
8
8
  require 'cmock_generator_utils'
@@ -10,36 +10,40 @@ require 'cmock_generator_utils'
10
10
  class CMockGeneratorUtilsTest < Test::Unit::TestCase
11
11
  def setup
12
12
  create_mocks :config, :unity_helper, :unity_helper
13
-
13
+
14
14
  @config.expect.when_ptr.returns(:compare_ptr)
15
15
  @config.expect.enforce_strict_ordering.returns(false)
16
16
  @config.expect.plugins.returns([])
17
17
  @config.expect.plugins.returns([])
18
18
  @config.expect.plugins.returns([])
19
19
  @config.expect.plugins.returns([])
20
+ @config.expect.plugins.returns([])
21
+ @config.expect.plugins.returns([])
20
22
  @config.expect.treat_as.returns({'int' => 'INT','short' => 'INT16','long' => 'INT','char' => 'INT8','char*' => 'STRING'})
21
23
  @cmock_generator_utils_simple = CMockGeneratorUtils.new(@config, {:unity_helper => @unity_helper})
22
24
 
23
25
  @config.expect.when_ptr.returns(:smart)
24
26
  @config.expect.enforce_strict_ordering.returns(true)
25
- @config.expect.plugins.returns([:array, :cexception, :return_thru_ptr, :ignore_arg])
26
- @config.expect.plugins.returns([:array, :cexception, :return_thru_ptr, :ignore_arg])
27
- @config.expect.plugins.returns([:array, :cexception, :return_thru_ptr, :ignore_arg])
28
- @config.expect.plugins.returns([:array, :cexception, :return_thru_ptr, :ignore_arg])
27
+ @config.expect.plugins.returns([:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore])
28
+ @config.expect.plugins.returns([:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore])
29
+ @config.expect.plugins.returns([:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore])
30
+ @config.expect.plugins.returns([:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore])
31
+ @config.expect.plugins.returns([:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore])
32
+ @config.expect.plugins.returns([:array, :cexception, :return_thru_ptr, :ignore_arg, :ignore])
29
33
  @config.expect.treat_as.returns({'int' => 'INT','short' => 'INT16','long' => 'INT','char' => 'INT8','uint32_t' => 'HEX32','char*' => 'STRING'})
30
34
  @cmock_generator_utils_complex = CMockGeneratorUtils.new(@config, {:unity_helper => @unity_helper, :A=>1, :B=>2})
31
35
  end
32
36
 
33
37
  def teardown
34
38
  end
35
-
39
+
36
40
  should "have set up internal accessors correctly on init" do
37
41
  assert_equal(@config, @cmock_generator_utils_simple.config)
38
42
  assert_equal({:unity_helper => @unity_helper}, @cmock_generator_utils_simple.helpers)
39
43
  assert_equal(false, @cmock_generator_utils_simple.arrays)
40
44
  assert_equal(false, @cmock_generator_utils_simple.cexception)
41
45
  end
42
-
46
+
43
47
  should "have set up internal accessors correctly on init, complete with passed helpers" do
44
48
  assert_equal(@config, @cmock_generator_utils_complex.config)
45
49
  assert_equal({:unity_helper => @unity_helper, :A=>1, :B=>2},@cmock_generator_utils_complex.helpers)
@@ -52,7 +56,7 @@ class CMockGeneratorUtilsTest < Test::Unit::TestCase
52
56
  assert_equal(true, @cmock_generator_utils_simple.ptr_or_str?('int*'))
53
57
  assert_equal(true, @cmock_generator_utils_simple.ptr_or_str?('char*'))
54
58
  end
55
-
59
+
56
60
  should "add code for a base expectation with no plugins" do
57
61
  expected =
58
62
  " CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_Apple_CALL_INSTANCE));\n" +
@@ -63,42 +67,44 @@ class CMockGeneratorUtilsTest < Test::Unit::TestCase
63
67
  output = @cmock_generator_utils_simple.code_add_base_expectation("Apple")
64
68
  assert_equal(expected, output)
65
69
  end
66
-
70
+
67
71
  should "add code for a base expectation with all plugins" do
68
72
  expected =
69
73
  " CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_Apple_CALL_INSTANCE));\n" +
70
74
  " CMOCK_Apple_CALL_INSTANCE* cmock_call_instance = (CMOCK_Apple_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);\n" +
71
75
  " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, \"CMock has run out of memory. Please allocate more.\");\n" +
72
76
  " Mock.Apple_CallInstance = CMock_Guts_MemChain(Mock.Apple_CallInstance, cmock_guts_index);\n" +
73
- " cmock_call_instance->LineNumber = cmock_line;\n" +
77
+ " Mock.Apple_IgnoreBool = (int)0;\n" +
78
+ " cmock_call_instance->LineNumber = cmock_line;\n" +
74
79
  " cmock_call_instance->CallOrder = ++GlobalExpectCount;\n" +
75
80
  " cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;\n"
76
81
  output = @cmock_generator_utils_complex.code_add_base_expectation("Apple", true)
77
82
  assert_equal(expected, output)
78
83
  end
79
-
84
+
80
85
  should "add code for a base expectation with all plugins and ordering not supported" do
81
86
  expected =
82
87
  " CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_Apple_CALL_INSTANCE));\n" +
83
88
  " CMOCK_Apple_CALL_INSTANCE* cmock_call_instance = (CMOCK_Apple_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);\n" +
84
89
  " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, \"CMock has run out of memory. Please allocate more.\");\n" +
85
90
  " Mock.Apple_CallInstance = CMock_Guts_MemChain(Mock.Apple_CallInstance, cmock_guts_index);\n" +
91
+ " Mock.Apple_IgnoreBool = (int)0;\n" +
86
92
  " cmock_call_instance->LineNumber = cmock_line;\n" +
87
93
  " cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;\n"
88
94
  output = @cmock_generator_utils_complex.code_add_base_expectation("Apple", false)
89
95
  assert_equal(expected, output)
90
96
  end
91
-
97
+
92
98
  should "add argument expectations for values when no array plugin" do
93
99
  arg1 = { :name => "Orange", :const? => false, :type => 'int', :ptr? => false }
94
100
  expected1 = " cmock_call_instance->Expected_Orange = Orange;\n"
95
-
101
+
96
102
  arg2 = { :name => "Lemon", :const? => true, :type => 'const char*', :ptr? => true }
97
103
  expected2 = " cmock_call_instance->Expected_Lemon = (const char*)Lemon;\n"
98
-
104
+
99
105
  arg3 = { :name => "Kiwi", :const? => false, :type => 'KIWI_T*', :ptr? => true }
100
106
  expected3 = " cmock_call_instance->Expected_Kiwi = Kiwi;\n"
101
-
107
+
102
108
  arg4 = { :name => "Lime", :const? => false, :type => 'LIME_T', :ptr? => false }
103
109
  expected4 = " memcpy(&cmock_call_instance->Expected_Lime, &Lime, sizeof(LIME_T));\n"
104
110
 
@@ -107,23 +113,23 @@ class CMockGeneratorUtilsTest < Test::Unit::TestCase
107
113
  assert_equal(expected3, @cmock_generator_utils_simple.code_add_an_arg_expectation(arg3))
108
114
  assert_equal(expected4, @cmock_generator_utils_simple.code_add_an_arg_expectation(arg4))
109
115
  end
110
-
116
+
111
117
  should "add argument expectations for values when array plugin enabled" do
112
118
  arg1 = { :name => "Orange", :const? => false, :type => 'int', :ptr? => false }
113
119
  expected1 = " cmock_call_instance->Expected_Orange = Orange;\n" +
114
120
  " cmock_call_instance->IgnoreArg_Orange = 0;\n"
115
-
121
+
116
122
  arg2 = { :name => "Lemon", :const? => true, :type => 'const char*', :ptr? => true }
117
123
  expected2 = " cmock_call_instance->Expected_Lemon = (const char*)Lemon;\n" +
118
124
  " cmock_call_instance->Expected_Lemon_Depth = Lemon_Depth;\n" +
119
125
  " cmock_call_instance->IgnoreArg_Lemon = 0;\n"
120
-
126
+
121
127
  arg3 = { :name => "Kiwi", :const? => false, :type => 'KIWI_T*', :ptr? => true }
122
128
  expected3 = " cmock_call_instance->Expected_Kiwi = Kiwi;\n" +
123
129
  " cmock_call_instance->Expected_Kiwi_Depth = Kiwi_Depth;\n" +
124
130
  " cmock_call_instance->IgnoreArg_Kiwi = 0;\n" +
125
131
  " cmock_call_instance->ReturnThruPtr_Kiwi_Used = 0;\n"
126
-
132
+
127
133
  arg4 = { :name => "Lime", :const? => false, :type => 'LIME_T', :ptr? => false }
128
134
  expected4 = " memcpy(&cmock_call_instance->Expected_Lime, &Lime, sizeof(LIME_T));\n" +
129
135
  " cmock_call_instance->IgnoreArg_Lime = 0;\n"
@@ -133,19 +139,19 @@ class CMockGeneratorUtilsTest < Test::Unit::TestCase
133
139
  assert_equal(expected3, @cmock_generator_utils_complex.code_add_an_arg_expectation(arg3, 'Lemon_Depth'))
134
140
  assert_equal(expected4, @cmock_generator_utils_complex.code_add_an_arg_expectation(arg4))
135
141
  end
136
-
142
+
137
143
  should 'not have an argument loader when the function has no arguments' do
138
144
  function = { :name => "Melon", :args_string => "void" }
139
-
145
+
140
146
  assert_equal("", @cmock_generator_utils_complex.code_add_argument_loader(function))
141
147
  end
142
-
148
+
143
149
  should 'create an argument loader when the function has arguments' do
144
- function = { :name => "Melon",
150
+ function = { :name => "Melon",
145
151
  :args_string => "stuff",
146
152
  :args => [test_arg[:int_ptr], test_arg[:mytype], test_arg[:string]]
147
153
  }
148
- expected = "void CMockExpectParameters_Melon(CMOCK_Melon_CALL_INSTANCE* cmock_call_instance, stuff)\n{\n" +
154
+ expected = "void CMockExpectParameters_Melon(CMOCK_Melon_CALL_INSTANCE* cmock_call_instance, stuff)\n{\n" +
149
155
  " cmock_call_instance->Expected_MyIntPtr = MyIntPtr;\n" +
150
156
  " memcpy(&cmock_call_instance->Expected_MyMyType, &MyMyType, sizeof(MY_TYPE));\n" +
151
157
  " cmock_call_instance->Expected_MyStr = (char*)MyStr;\n" +
@@ -154,11 +160,11 @@ class CMockGeneratorUtilsTest < Test::Unit::TestCase
154
160
  end
155
161
 
156
162
  should 'create an argument loader when the function has arguments supporting arrays' do
157
- function = { :name => "Melon",
163
+ function = { :name => "Melon",
158
164
  :args_string => "stuff",
159
165
  :args => [test_arg[:int_ptr], test_arg[:mytype], test_arg[:string]]
160
166
  }
161
- expected = "void CMockExpectParameters_Melon(CMOCK_Melon_CALL_INSTANCE* cmock_call_instance, int* MyIntPtr, int MyIntPtr_Depth, const MY_TYPE MyMyType, const char* MyStr)\n{\n" +
167
+ expected = "void CMockExpectParameters_Melon(CMOCK_Melon_CALL_INSTANCE* cmock_call_instance, int* MyIntPtr, int MyIntPtr_Depth, const MY_TYPE MyMyType, const char* MyStr)\n{\n" +
162
168
  " cmock_call_instance->Expected_MyIntPtr = MyIntPtr;\n" +
163
169
  " cmock_call_instance->Expected_MyIntPtr_Depth = MyIntPtr_Depth;\n" +
164
170
  " cmock_call_instance->IgnoreArg_MyIntPtr = 0;\n" +
@@ -170,15 +176,15 @@ class CMockGeneratorUtilsTest < Test::Unit::TestCase
170
176
  "}\n\n"
171
177
  assert_equal(expected, @cmock_generator_utils_complex.code_add_argument_loader(function))
172
178
  end
173
-
179
+
174
180
  should "not call argument loader if there are no arguments to actually use for this function" do
175
181
  function = { :name => "Pineapple", :args_string => "void" }
176
-
182
+
177
183
  assert_equal("", @cmock_generator_utils_complex.code_call_argument_loader(function))
178
184
  end
179
185
 
180
186
  should 'call an argument loader when the function has arguments' do
181
- function = { :name => "Pineapple",
187
+ function = { :name => "Pineapple",
182
188
  :args_string => "stuff",
183
189
  :args => [test_arg[:int_ptr], test_arg[:mytype], test_arg[:string]]
184
190
  }
@@ -187,14 +193,14 @@ class CMockGeneratorUtilsTest < Test::Unit::TestCase
187
193
  end
188
194
 
189
195
  should 'call an argument loader when the function has arguments with arrays' do
190
- function = { :name => "Pineapple",
196
+ function = { :name => "Pineapple",
191
197
  :args_string => "stuff",
192
198
  :args => [test_arg[:int_ptr], test_arg[:mytype], test_arg[:string]]
193
199
  }
194
200
  expected = " CMockExpectParameters_Pineapple(cmock_call_instance, MyIntPtr, 1, MyMyType, MyStr);\n"
195
201
  assert_equal(expected, @cmock_generator_utils_complex.code_call_argument_loader(function))
196
202
  end
197
-
203
+
198
204
  should 'handle a simple assert when requested' do
199
205
  function = { :name => 'Pear' }
200
206
  arg = test_arg[:int]
@@ -217,7 +223,7 @@ class CMockGeneratorUtilsTest < Test::Unit::TestCase
217
223
  @unity_helper.expect.get_helper('char*').returns(['UNITY_TEST_ASSERT_EQUAL_STRING',''])
218
224
  assert_equal(expected, @cmock_generator_utils_simple.code_verify_an_arg_expectation(function, arg))
219
225
  end
220
-
226
+
221
227
  should 'handle custom types as memory compares when we have no better way to do it' do
222
228
  function = { :name => 'Pear' }
223
229
  arg = test_arg[:mytype]
@@ -233,7 +239,7 @@ class CMockGeneratorUtilsTest < Test::Unit::TestCase
233
239
  @unity_helper.expect.get_helper('MY_TYPE').returns(['UNITY_TEST_ASSERT_EQUAL_MY_TYPE',''])
234
240
  assert_equal(expected, @cmock_generator_utils_simple.code_verify_an_arg_expectation(function, arg))
235
241
  end
236
-
242
+
237
243
  should 'handle pointers to custom types with array handlers, even if the array extension is turned off' do
238
244
  function = { :name => 'Pear' }
239
245
  arg = test_arg[:mytype]
@@ -249,7 +255,7 @@ class CMockGeneratorUtilsTest < Test::Unit::TestCase
249
255
  @unity_helper.expect.get_helper('int').returns(['UNITY_TEST_ASSERT_EQUAL_INT',''])
250
256
  assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg))
251
257
  end
252
-
258
+
253
259
  should 'handle an array comparison with array plugin enabled' do
254
260
  function = { :name => 'Pear' }
255
261
  arg = test_arg[:int_ptr]
@@ -265,7 +271,7 @@ class CMockGeneratorUtilsTest < Test::Unit::TestCase
265
271
  @unity_helper.expect.get_helper('int*').returns(['UNITY_TEST_ASSERT_EQUAL_INT_ARRAY',''])
266
272
  assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg))
267
273
  end
268
-
274
+
269
275
  should 'handle const char as string compares with array plugin enabled' do
270
276
  function = { :name => 'Pear' }
271
277
  arg = test_arg[:string]
@@ -273,15 +279,15 @@ class CMockGeneratorUtilsTest < Test::Unit::TestCase
273
279
  @unity_helper.expect.get_helper('char*').returns(['UNITY_TEST_ASSERT_EQUAL_STRING',''])
274
280
  assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg))
275
281
  end
276
-
282
+
277
283
  should 'handle custom types as memory compares when we have no better way to do it with array plugin enabled' do
278
284
  function = { :name => 'Pear' }
279
285
  arg = test_arg[:mytype]
280
- expected = " if (!cmock_call_instance->IgnoreArg_MyMyType)\n {\n UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_MyMyType), (void*)(&MyMyType), sizeof(MY_TYPE), cmock_line, \"Function 'Pear' called with unexpected value for argument 'MyMyType'.\");\n }\n"
281
- @unity_helper.expect.get_helper('MY_TYPE').returns(['UNITY_TEST_ASSERT_EQUAL_MEMORY','&'])
286
+ expected = " if (!cmock_call_instance->IgnoreArg_MyMyType)\n {\n if (&cmock_call_instance->Expected_MyMyType == NULL)\n { UNITY_TEST_ASSERT_NULL(MyMyType, cmock_line, \"Expected NULL. Function 'Pear' called with unexpected value for argument 'MyMyType'.\"); }\n else\n { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(&cmock_call_instance->Expected_MyMyType), (void*)(&MyMyType), sizeof(MY_TYPE), 1, cmock_line, \"Function 'Pear' called with unexpected value for argument 'MyMyType'.\"); }\n }\n"
287
+ @unity_helper.expect.get_helper('MY_TYPE').returns(['UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY','&'])
282
288
  assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg))
283
289
  end
284
-
290
+
285
291
  should 'handle custom types with custom handlers when available, even if they do not support the extra message with array plugin enabled' do
286
292
  function = { :name => 'Pear' }
287
293
  arg = test_arg[:mytype]
@@ -305,7 +311,7 @@ class CMockGeneratorUtilsTest < Test::Unit::TestCase
305
311
  @unity_helper.expect.get_helper('MY_TYPE*').returns(['UNITY_TEST_ASSERT_EQUAL_MY_TYPE_ARRAY',''])
306
312
  assert_equal(expected, @cmock_generator_utils_complex.code_verify_an_arg_expectation(function, arg))
307
313
  end
308
-
314
+
309
315
  should 'handle custom types with array handlers when array plugin is enabled for non-array types' do
310
316
  function = { :name => 'Pear' }
311
317
  arg = test_arg[:mytype]