diff --git a/lib/cmock_generator.rb b/lib/cmock_generator.rb index e349b3f..5bd9ebe 100644 --- a/lib/cmock_generator.rb +++ b/lib/cmock_generator.rb @@ -110,7 +110,7 @@ class CMockGenerator def create_mock_verify_function(file, functions) file << "void #{@mock_name}_Verify(void)\n{\n" - file << " TEST_ASSERT_EQUAL(0, Mock.allocFailure);\n" + file << " TEST_ASSERT_EQUAL_MESSAGE(0, Mock.allocFailure, \"Unable to allocate memory for mock\");\n" file << functions.collect {|function| @plugins.run(:mock_verify, function)}.join if (@ordered) file << " if (GlobalOrderError)\n" diff --git a/test/unit/cmock_generator_main_test.rb b/test/unit/cmock_generator_main_test.rb index 712493e..0f55132 100644 --- a/test/unit/cmock_generator_main_test.rb +++ b/test/unit/cmock_generator_main_test.rb @@ -207,7 +207,7 @@ class CMockGeneratorTest < Test::Unit::TestCase functions = [] output = [] expected = [ "void MockPoutPoutFish_Verify(void)\n{\n", - " TEST_ASSERT_EQUAL(0, Mock.allocFailure);\n", + " TEST_ASSERT_EQUAL_MESSAGE(0, Mock.allocFailure, \"Unable to allocate memory for mock\");\n", "", "}\n\n" ] @@ -223,7 +223,7 @@ class CMockGeneratorTest < Test::Unit::TestCase ] output = [] expected = [ "void MockPoutPoutFish_Verify(void)\n{\n", - " TEST_ASSERT_EQUAL(0, Mock.allocFailure);\n", + " TEST_ASSERT_EQUAL_MESSAGE(0, Mock.allocFailure, \"Unable to allocate memory for mock\");\n", " Uno_First" + " Dos_First" + " Uno_Second" +