- cleaned up an error or two when using memory compares

- can use array assertions for non-arrays
- can sometimes get away with normal assertions for arrays (doesn't yet go through array, just first element)
- made parsing_challenges test better

git-svn-id: http://cmock.svn.sourceforge.net/svnroot/cmock/trunk@159 bf332499-1b4d-0410-844d-d2d48d5cc64c
This commit is contained in:
mvandervoord
2010-03-30 03:36:08 +00:00
parent 14d639bbd8
commit 436ffe0fee
5 changed files with 128 additions and 72 deletions
+10 -2
View File
@@ -10,9 +10,16 @@ class CMockUnityHelperParser
def get_helper(ctype)
lookup = ctype.gsub(/(?:^|(\S?)(\s*)|(\W))const(?:$|(\s*)(\S)|(\W))/,'\1\3\5\6').strip.gsub(/\s+/,'_')
return @c_types[lookup] if (@c_types[lookup])
return [@c_types[lookup], ''] if (@c_types[lookup])
if (lookup =~ /\*$/)
lookup = lookup.gsub(/\*$/,'')
return [@c_types[lookup], '*'] if (@c_types[lookup])
else
lookup = lookup + '*'
return [@c_types[lookup], '&'] if (@c_types[lookup])
end
raise("Don't know how to test #{ctype} and memory tests are disabled!") unless @config.memcmp_if_unknown
return @fallback
return [@fallback, '']
end
private ###########################
@@ -21,6 +28,7 @@ class CMockUnityHelperParser
c_types = {}
@config.treat_as.each_pair do |ctype, expecttype|
c_types[ctype.gsub(/\s+/,'_')] = "UNITY_TEST_ASSERT_EQUAL_#{expecttype}"
c_types[ctype.gsub(/\s+/,'_')+'*'] = "UNITY_TEST_ASSERT_EQUAL_#{expecttype}_ARRAY"
end
c_types
end