Files
CMock/test/system/test_interactions/nonstandard_parsed_stuff_2.yml
Mark VanderVoord e5f89062a0 Update to latest Unity, raising warning / error level in the process.
Clean up some warnings. Purposefully accept them in tests where we're verifying it still mocks when those issues exist.
2026-07-07 17:08:36 -04:00

70 lines
2.1 KiB
YAML

# =========================================================================
# CMock - Automatic Mock Generation for C
# ThrowTheSwitch.org
# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams
# SPDX-License-Identifier: MIT
# =========================================================================
---
#The purpose of this test is to play with our really rough multidimensional array support, which involves an implicit cast not supported everywhere
:cmock:
:plugins:
- :array
:systest:
:types: |
:mockable: |
void foo(unsigned char** a);
unsigned char** bar(void);
:source:
:header: |
void function_a(void);
:code: |
void function_a(void) {
foo(bar());
}
:tests:
:common: |
void setUp(void) {}
void tearDown(void) {}
:units:
- :pass: TRUE
: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)'
:code: |
test()
{
unsigned char a[] = { 1, 2, 3, 4, 5, 6 };
unsigned char* aa[] = { &a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7] };
unsigned char** pa = (unsigned char**)(aa);
bar_ExpectAndReturn(pa);
foo_Expect(pa);
function_a();
}
- :pass: FALSE
: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)'
:code: |
test()
{
unsigned char a[] = { 1, 2, 3, 4, 5, 6 };
unsigned char* aa[] = { &a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7] };
unsigned char b[] = { 5, 6, 7, 8, 9, 0 };
unsigned char* bb[] = { &b[0], &b[1], &b[2], &b[3], &b[4], &b[5], &b[6], &b[7] };
unsigned char** pa = (unsigned char**)(aa);
unsigned char** pb = (unsigned char**)(bb);
bar_ExpectAndReturn(pa);
foo_Expect(pb);
function_a();
}
...