Fix broken tests for supporting exclude_setjmp. Verify cexception won't be run when this is enabled.

This commit is contained in:
Mark VanderVoord
2021-01-29 10:47:52 -05:00
parent aa5113e012
commit dd00b96f0d
3 changed files with 17 additions and 1 deletions
+3
View File
@@ -55,6 +55,7 @@ describe CMockGenerator, "Verify CMockGenerator Module" do
@config.expect :subdir, nil
@config.expect :fail_on_unexpected_calls, true
@config.expect :treat_inlines, :exclude
@config.expect :exclude_setjmp_h, false
@cmock_generator = CMockGenerator.new(@config, @file_writer, @utils, @plugins)
@cmock_generator.module_name = @module_name
@cmock_generator.module_ext = '.h'
@@ -75,6 +76,7 @@ describe CMockGenerator, "Verify CMockGenerator Module" do
@config.expect :subdir, nil
@config.expect :fail_on_unexpected_calls, true
@config.expect :treat_inlines, :exclude
@config.expect :exclude_setjmp_h, false
@cmock_generator_strict = CMockGenerator.new(@config, @file_writer, @utils, @plugins)
@cmock_generator_strict.module_name = @module_name
@cmock_generator_strict.module_ext = '.h'
@@ -145,6 +147,7 @@ describe CMockGenerator, "Verify CMockGenerator Module" do
@config.expect :subdir, nil
@config.expect :fail_on_unexpected_calls, true
@config.expect :treat_inlines, :exclude
@config.expect :exclude_setjmp_h, false
@cmock_generator2 = CMockGenerator.new(@config, @file_writer, @utils, @plugins)
@cmock_generator2.module_name = "Pout-Pout Fish"
@cmock_generator2.module_ext = '.h'
@@ -11,6 +11,9 @@ describe CMockGeneratorPluginCexception, "Verify CMockGeneratorPluginCexception
before do
create_mocks :config, :utils
@config.expect :exclude_setjmp_h, false
@cmock_generator_plugin_cexception = CMockGeneratorPluginCexception.new(@config, @utils)
end
@@ -93,4 +96,13 @@ describe CMockGeneratorPluginCexception, "Verify CMockGeneratorPluginCexception
assert_equal(expected, returned)
end
it "should throw an exception if we try to use this plugin when setjmp disabled" do
@config.expect :exclude_setjmp_h, true
assert_raises RuntimeError do
@cmock_generator_plugin_cexception = CMockGeneratorPluginCexception.new(@config, @utils)
end
end
end
+2 -1
View File
@@ -18,7 +18,8 @@ describe CMockPluginManager, "Verify CMockPluginManager Module" do
:respond_to => true,
:when_ptr => :compare_data,
:enforce_strict_ordering => false,
:ignore => :args_and_calls
:ignore => :args_and_calls,
:exclude_setjmp_h => false
)
def @config.plugins