summaryrefslogtreecommitdiff
path: root/FreeRTOS-Plus/Test/CMock/test/system/test_interactions/nonstandard_parsed_stuff_1.yml
blob: 01538ea329ecb89a10670122ed6bbfd533abeb53 (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
---
#The purpose of this test is to play with things like "const char const *" which isn't supported by some compilers
:cmock:
  :enforce_strict_ordering: 1
  :plugins:
  - :array
  - :cexception
  - :ignore

:systest:
  :types: |
    typedef struct _POINT_T {
      int x;
      int y;
    } POINT_T;

  :mockable: |
    #include  "CException.h"
    void foos(const char const * a);
    const char const * bars(void);

  :source: 
    :header: |   
      #include "CException.h" 
      void function_a(void);
      void function_b(void);
      void function_c(void);
      int function_d(void);

    :code: |
      void function_c(void) {
        CEXCEPTION_T e;
        Try {
          foos(bars());
        } Catch(e) { foos("err"); }
      }
      
  :tests:
    :common: |
      #include "CException.h"
      void setUp(void) {}
      void tearDown(void) {}
      
    :units:
    - :pass: TRUE
      :should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, passing'
      :code: |
        test()
        {
          bars_ExpectAndReturn("This is a\0 silly string");
          foos_Expect("This is a\0 wacky string");
          
          function_c();
        }
        
    - :pass: FALSE
      :should: 'handle standard c string as null terminated on not do crappy memory compares of a byte, finding failures'
      :code: |
        test()
        {
          bars_ExpectAndReturn("This is a silly string");
          foos_Expect("This is a wacky string");
          
          function_c();
        }

    - :pass: TRUE
      :should: 'handle an exception being caught'
      :code: |
        test()
        {
          bars_ExpectAndReturn("This is a\0 silly string");
          foos_ExpectAndThrow("This is a\0 wacky string", 55);
          foos_Expect("err");
          
          function_c();
        }

    - :pass: FALSE
      :should: 'handle an exception being caught but still catch following errors'
      :code: |
        test()
        {
          bars_ExpectAndReturn("This is a\0 silly string");
          foos_ExpectAndThrow("This is a\0 wacky string", 55);
          foos_Expect("wrong error");
          
          function_c();
        }

...