mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-10-11 11:27:32 +00:00
- fixed issue where cmock wanted to treat function pointers as memory compares if they were not typedefs. This was ok on some platforms but not others.
git-svn-id: http://cmock.svn.sourceforge.net/svnroot/cmock/trunk@197 bf332499-1b4d-0410-844d-d2d48d5cc64c
This commit is contained in:
@@ -24,6 +24,7 @@ class CMockUnityHelperParser
|
|||||||
lookup = lookup + '*'
|
lookup = lookup + '*'
|
||||||
return [@c_types[lookup], '&'] if (@c_types[lookup])
|
return [@c_types[lookup], '&'] if (@c_types[lookup])
|
||||||
end
|
end
|
||||||
|
return ['UNITY_TEST_ASSERT_EQUAL_PTR', ''] if (ctype =~ /cmock_\w+_ptr\d+/)
|
||||||
raise("Don't know how to test #{ctype} and memory tests are disabled!") unless @config.memcmp_if_unknown
|
raise("Don't know how to test #{ctype} and memory tests are disabled!") unless @config.memcmp_if_unknown
|
||||||
return (lookup =~ /\*$/) ? [@fallback, '&'] : [@fallback, '']
|
return (lookup =~ /\*$/) ? [@fallback, '&'] : [@fallback, '']
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,11 +2,15 @@
|
|||||||
:cmock:
|
:cmock:
|
||||||
:plugins:
|
:plugins:
|
||||||
- # none
|
- # none
|
||||||
|
:treat_as:
|
||||||
|
FUNCTION_T: PTR
|
||||||
|
|
||||||
:systest:
|
:systest:
|
||||||
:types: |
|
:types: |
|
||||||
|
typedef void (*FUNCTION_T)(void);
|
||||||
|
|
||||||
:mockable: |
|
:mockable: |
|
||||||
|
void takes_function_type( FUNCTION_T myfunc );
|
||||||
void takes_function_ptr( unsigned int (*func_ptr)(int, char) );
|
void takes_function_ptr( unsigned int (*func_ptr)(int, char) );
|
||||||
void takes_const_function_ptr( unsigned int (* const)(int, char) );
|
void takes_const_function_ptr( unsigned int (* const)(int, char) );
|
||||||
unsigned short (*returns_function_ptr( const char op_code ))( int, long int );
|
unsigned short (*returns_function_ptr( const char op_code ))( int, long int );
|
||||||
|
|||||||
Reference in New Issue
Block a user