summaryrefslogtreecommitdiff
path: root/FreeRTOS-Plus/Test/CMock/test/system/test_interactions/newer_standards_stuff1.yml
blob: 6843eae6069539f7fc047b70ad30dfca13012381 (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
---
#The purpose of this test is to pull in some standard library stuff from C99
:cmock:
  :includes:
    - "<stdint.h>"
    - "<limits.h>"

:systest:
  :types: |
    #include <stdint.h>
    #include <limits.h>
  
  
  :mockable: |
    int32_t foo(int32_t a);

  :source: 
    :header: |    
      int8_t function_a(void);

    :code: |
      int8_t function_a(void) {
        return (int8_t)(INT_MIN == foo(INT_MAX));
      }
      
  :tests:
    :common: |
      void setUp(void) {}
      void tearDown(void) {}
      
    :units:
    - :pass: TRUE
      :should: 'handle handle a simple comparison of C99 types which pass'
      :code: |
        test()
        {
          foo_ExpectAndReturn(INT_MAX, INT_MIN);
          
          TEST_ASSERT_TRUE(function_a());
        }

    - :pass: FALSE
      :should: 'handle handle a simple comparison of C99 types which fail'
      :code: |
        test()
        {
          foo_ExpectAndReturn(INT_MIN, INT_MIN);
          
          TEST_ASSERT_TRUE(function_a());
        }
        
...