Friendler failure message if a mock is unable to allocate memory for itself (which is likely to happen if your production environment has no heap and you neglect to define one for your test environment)

git-svn-id: http://cmock.svn.sourceforge.net/svnroot/cmock/trunk@144 bf332499-1b4d-0410-844d-d2d48d5cc64c
This commit is contained in:
ajwitte
2009-11-04 16:51:31 +00:00
parent 81d94eeca9
commit f63d8d7813
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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"
+2 -2
View File
@@ -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" +