mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-09-17 07:39:57 +00:00
- 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user