summaryrefslogtreecommitdiff
path: root/FreeRTOS-Plus/Test/CMock/test/system/test_interactions/nonstandard_parsed_stuff_2.yml
blob: 506e7ee8a15622eaa1d76ddf301c9b9149033676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
#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** pa = (unsigned char**)(&a);

          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 b[] = { 5, 6, 7, 8, 9, 0 };
          unsigned char** pa = (unsigned char**)(&a);
          unsigned char** pb = (unsigned char**)(&b);

          bar_ExpectAndReturn(pa);
          foo_Expect(pb);

          function_a();
        }
...