| 1 |
--- |
| 2 |
|
| 3 |
:cmock: |
| 4 |
:plugins: |
| 5 |
- :array |
| 6 |
|
| 7 |
:systest: |
| 8 |
:types: | |
| 9 |
|
| 10 |
|
| 11 |
:mockable: | |
| 12 |
void foo(unsigned char** a); |
| 13 |
unsigned char** bar(void); |
| 14 |
|
| 15 |
:source: |
| 16 |
:header: | |
| 17 |
void function_a(void); |
| 18 |
|
| 19 |
:code: | |
| 20 |
void function_a(void) { |
| 21 |
foo(bar()); |
| 22 |
} |
| 23 |
|
| 24 |
:tests: |
| 25 |
:common: | |
| 26 |
void setUp(void) {} |
| 27 |
void tearDown(void) {} |
| 28 |
|
| 29 |
:units: |
| 30 |
- :pass: TRUE |
| 31 |
:should: 'handle two dimensional array of unsigned characters just like we would handle a single dimensional array in expect (where we really only care about first element)' |
| 32 |
:code: | |
| 33 |
test() |
| 34 |
{ |
| 35 |
unsigned char a[] = { 1, 2, 3, 4, 5, 6 }; |
| 36 |
unsigned char** pa = (unsigned char**)(&a); |
| 37 |
|
| 38 |
bar_ExpectAndReturn(pa); |
| 39 |
foo_Expect(pa); |
| 40 |
|
| 41 |
function_a(); |
| 42 |
} |
| 43 |
|
| 44 |
- :pass: FALSE |
| 45 |
:should: 'handle two dimensional array of unsigned characters just like we would handle a single dimensional array in expect as failures (where we really only care about first element)' |
| 46 |
:code: | |
| 47 |
test() |
| 48 |
{ |
| 49 |
unsigned char a[] = { 1, 2, 3, 4, 5, 6 }; |
| 50 |
unsigned char b[] = { 5, 6, 7, 8, 9, 0 }; |
| 51 |
unsigned char** pa = (unsigned char**)(&a); |
| 52 |
unsigned char** pb = (unsigned char**)(&b); |
| 53 |
|
| 54 |
bar_ExpectAndReturn(pa); |
| 55 |
foo_Expect(pb); |
| 56 |
|
| 57 |
function_a(); |
| 58 |
} |
| 59 |
... |