summaryrefslogtreecommitdiff
path: root/FreeRTOS-Plus/Test/CMock/test/system/test_interactions/unity_ignores.yml
blob: 8595122b275affd16f5656088dff7d226f1df09a (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
:cmock:
  :plugins:
  - # none

:systest:
  :types: |
    #define UINT32 unsigned int

  :mockable: |
    UINT32 foo(UINT32 a);
    void bar(void);

  :source: 
    :header: |
      UINT32 function_a(int a);
      void function_b(void);

    :code: |
      UINT32 function_a(int a)    
      {
        bar();
        return foo((UINT32)a);
      }    

      void function_b(void) 
      {
        bar();
      }
      
  :tests:
    :common: |
      void setUp(void) {}
      void tearDown(void) {}
      
    :units:
    - :pass: :ignore
      :should: 'ignore incorrect expects after the TEST_IGNORE call'
      :code: |
        test()
        {
          TEST_IGNORE();
          bar_Expect();
          foo_ExpectAndReturn(10, 20);
          TEST_ASSERT_EQUAL(40, function_a(30));
        }
      
    - :pass: :ignore
      :should: 'ignore missing expects after the TEST_IGNORE call'
      :code: |
        test()
        {
          TEST_IGNORE();
          foo_ExpectAndReturn(10, 20);
          TEST_ASSERT_EQUAL(20, function_a(10));
        }
      
    - :pass: :ignore
      :should: 'ignore extra expects after the TEST_IGNORE call'
      :code: |
        test()
        {
          TEST_IGNORE();
          bar_Expect();
          bar_Expect();
          foo_ExpectAndReturn(10, 20);
          foo_ExpectAndReturn(10, 20);
          foo_ExpectAndReturn(10, 20);
          TEST_ASSERT_EQUAL(20, function_a(10));
        }
      
    - :pass: :ignore
      :should: 'ignore no expects after the TEST_IGNORE call'
      :code: |
        test()
        {
          TEST_IGNORE();
          TEST_ASSERT_EQUAL(20, function_a(10));
        }
        
    - :pass: :ignore
      :should: 'ignore extra expects after the TEST_IGNORE call even if it happens later'
      :code: |
        test()
        {
          bar_Expect();
          foo_ExpectAndReturn(10, 20);
          function_a(10);
          
          TEST_IGNORE();
          bar_Expect();
          foo_ExpectAndReturn(10, 20);
          TEST_ASSERT_EQUAL(40, function_a(30));
        }
        
    - :pass: false
      :should: 'still fail if there are expect problems before the TEST_IGNORE'
      :code: |
        test()
        {
          bar_Expect();
          foo_ExpectAndReturn(10, 20);
          function_a(30);
          
          TEST_IGNORE();
          bar_Expect();
          foo_ExpectAndReturn(10, 20);
          TEST_ASSERT_EQUAL(40, function_a(30));
        }
        
    - :pass: false
      :should: 'still fail if there are missing expect problems before the TEST_IGNORE'
      :code: |
        test()
        {
          bar_Expect();
          function_a(10);
          
          TEST_IGNORE();
          bar_Expect();
          foo_ExpectAndReturn(10, 20);
          TEST_ASSERT_EQUAL(40, function_a(30));
        }
        
    - :pass: :ignore
      :should: 'ignore if extra expects before the TEST_IGNORE because it ignored the rest of the test that might have made calls to it'
      :code: |
        test()
        {
          bar_Expect();
          bar_Expect();
          foo_ExpectAndReturn(10, 20);
          function_a(10);
          
          TEST_IGNORE();
          foo_ExpectAndReturn(10, 20);
          TEST_ASSERT_EQUAL(40, function_a(30));
        }
...