mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-08-29 14:29:58 +00:00
- Improved handling of pointer types as function arguments
git-svn-id: http://cmock.svn.sourceforge.net/svnroot/cmock/trunk@220 bf332499-1b4d-0410-844d-d2d48d5cc64c
This commit is contained in:
+1
-1
@@ -60,7 +60,7 @@ class CMockConfig
|
||||
options[:plugins].map! {|p| p.to_sym}
|
||||
@options = options
|
||||
|
||||
treat_as_map = standard_treat_as_map().clone
|
||||
treat_as_map = standard_treat_as_map()#.clone
|
||||
treat_as_map.merge!(@options[:treat_as])
|
||||
@options[:treat_as] = treat_as_map
|
||||
|
||||
|
||||
@@ -34,11 +34,12 @@ class CMockUnityHelperParser
|
||||
def map_C_types
|
||||
c_types = {}
|
||||
@config.treat_as.each_pair do |ctype, expecttype|
|
||||
c_type = ctype.gsub(/\s+/,'_')
|
||||
if (expecttype =~ /\*/)
|
||||
c_types[ctype.gsub(/\s+/,'_')] = "UNITY_TEST_ASSERT_EQUAL_#{expecttype.gsub(/\*/,'')}_ARRAY"
|
||||
c_types[c_type] = "UNITY_TEST_ASSERT_EQUAL_#{expecttype.gsub(/\*/,'')}_ARRAY"
|
||||
else
|
||||
c_types[ctype.gsub(/\s+/,'_')] = "UNITY_TEST_ASSERT_EQUAL_#{expecttype}"
|
||||
c_types[ctype.gsub(/\s+/,'_')+'*'] = "UNITY_TEST_ASSERT_EQUAL_#{expecttype}_ARRAY"
|
||||
c_types[c_type] = "UNITY_TEST_ASSERT_EQUAL_#{expecttype}"
|
||||
c_types[c_type+'*'] ||= "UNITY_TEST_ASSERT_EQUAL_#{expecttype}_ARRAY"
|
||||
end
|
||||
end
|
||||
c_types
|
||||
|
||||
@@ -4,4 +4,8 @@
|
||||
[Released under MIT License. Please refer to license.txt for details]
|
||||
========================================== */
|
||||
|
||||
#ifndef WIN32
|
||||
#define __stdcall
|
||||
#endif
|
||||
|
||||
int __stdcall this_uses_calling_conventions(int b);
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
}
|
||||
|
||||
- :pass: TRUE
|
||||
:should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, passing'
|
||||
:should: 'handle standard c string as null terminated and not do crappy memory compares of a byte, passing'
|
||||
:code: |
|
||||
test()
|
||||
{
|
||||
@@ -198,7 +198,7 @@
|
||||
}
|
||||
|
||||
- :pass: FALSE
|
||||
:should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, finding failures'
|
||||
:should: 'handle standard c string as null terminated and not do crappy memory compares of a byte, finding failures'
|
||||
:code: |
|
||||
test()
|
||||
{
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user