firmware  v0.1.2
Chromation Spectrometer Dev-Kit
Lis_faked.c
Go to the documentation of this file.
1 
37 #include "Lis_faked.h"
38 #include "Mock.h" // record call history in "mock"
39 #include "Lis.h"
40 
41 /* =====[ Mock LisReadout ]===== */
42 static RecordedCall * Record_LisReadout(uint16_t arg1)
43 { // Define **what is recorded** when fake is called.
44  char const *call_name = "LisReadout";
45  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
46  RecordedArg *record_of_arg1 = RecordedArg_new(SetupRecord_uint16_t);
47  *((uint16_t *)record_of_arg1->pArg) = arg1;
48  // Store the arg records in the call record.
49  RecordArg(record_of_this_call, record_of_arg1);
50  return record_of_this_call;
51 }
52 void LisReadout_fake(uint16_t num_pixels)
53 {
58  RecordActualCall(mock, Record_LisReadout(num_pixels));
59 }
60 
61 /* =====[ Mock LisExpose ]===== */
62 static RecordedCall * Record_LisExpose(void)
63 { // Define **what is recorded** when fake is called.
64  char const *call_name = "LisExpose";
65  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
66  return record_of_this_call;
67 }
68 void LisExpose_fake(void)
69 {
73  RecordActualCall(mock, Record_LisExpose());
74 }
75 
76 /* =====[ Mock LisWriteConfig ]===== */
77 static RecordedCall * Record_LisWriteConfig(void)
78 { // Define **what is recorded** when fake is called.
79  char const *call_name = "LisWriteConfig";
80  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
81  return record_of_this_call;
82 }
84 {
88  RecordActualCall(mock, Record_LisWriteConfig());
89 }
90 
91 /* =====[ Mock _ConfigAs28bits() ]===== */
92 static RecordedCall * Record__ConfigAs28bits(uint8_t * arg1)
93 { // Define **what is recorded** when fake is called.
94  char const *call_name = "_ConfigAs28bits";
95  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
96  RecordedArg *record_of_arg1 = RecordedArg_new(SetupRecord_p_uint8_t);
97  *((uint8_t **)record_of_arg1->pArg) = arg1;
98  // Store the arg records in the call record.
99  RecordArg(record_of_this_call, record_of_arg1);
100  return record_of_this_call;
101 }
102 void _ConfigAs28bits_fake(uint8_t * config)
103 {
108  RecordActualCall(mock, Record__ConfigAs28bits(config));
109 }
110 
111 /* =====[ Mock _WaitForLisClkLow() ]===== */
112 static RecordedCall * Record__WaitForLisClkLow(void)
113 { // Define **what is recorded** when fake is called.
114  char const *call_name = "_WaitForLisClkLow";
115  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
116  return record_of_this_call;
117 }
119 {
123  RecordActualCall(mock, Record__WaitForLisClkLow());
124 }
125 
126 /* =====[ Mock _WaitForLisClkHigh() ]===== */
127 static RecordedCall * Record__WaitForLisClkHigh(void)
128 { // Define **what is recorded** when fake is called.
129  char const *call_name = "_WaitForLisClkHigh";
130  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
131  return record_of_this_call;
132 }
134 {
138  RecordActualCall(mock, Record__WaitForLisClkHigh());
139 }
140 
141 /* =====[ Mock _EnterLisProgrammingMode() ]===== */
142 static RecordedCall * Record__EnterLisProgrammingMode(void)
143 { // Define **what is recorded** when fake is called.
144  char const *call_name = "_EnterLisProgrammingMode";
145  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
146  return record_of_this_call;
147 }
149 {
153  RecordActualCall(mock, Record__EnterLisProgrammingMode());
154 }
155 
156 /* =====[ Mock _WriteLisConfigBit ]===== */
157 static RecordedCall * Record__WriteLisConfigBit(uint8_t * arg1, uint8_t arg2)
158 { // Define **what is recorded** when fake is called.
159  char const *call_name = "_WriteLisConfigBit";
160  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
161  RecordedArg *record_of_arg1 = RecordedArg_new(SetupRecord_p_uint8_t);
162  RecordedArg *record_of_arg2 = RecordedArg_new(SetupRecord_uint8_t);
163  *((uint8_t **)record_of_arg1->pArg) = arg1;
164  *((uint8_t *)record_of_arg2->pArg) = arg2;
165  // Store the arg records in the call record.
166  RecordArg(record_of_this_call, record_of_arg1);
167  RecordArg(record_of_this_call, record_of_arg2);
168  return record_of_this_call;
169 }
170 void _WriteLisConfigBit_fake(uint8_t const * config, uint8_t bit_index)
171 {
177  RecordActualCall(mock, Record__WriteLisConfigBit // call name
178  (
179  (uint8_t *)config, // arg1
180  bit_index // arg2
181  )
182  );
183 }
184 
185 /* =====[ Mock _Write28bitLisConfig() ]===== */
186 static RecordedCall * Record__Write28bitLisConfig(uint8_t * arg1)
187 { // Define **what is recorded** when fake is called.
188  char const *call_name = "_Write28bitLisConfig";
189  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
190  RecordedArg *record_of_arg1 = RecordedArg_new(SetupRecord_p_uint8_t);
191  *((uint8_t **)record_of_arg1->pArg) = arg1;
192  // Store the arg records in the call record.
193  RecordArg(record_of_this_call, record_of_arg1);
194  return record_of_this_call;
195 }
196 void _Write28bitLisConfig_fake(uint8_t * config)
197 {
202  RecordActualCall(mock, Record__Write28bitLisConfig(config));
203 }
204 
205 /* =====[ Mock _ExitLisProgrammingMode() ]===== */
206 static RecordedCall * Record__ExitLisProgrammingMode(void)
207 { // Define **what is recorded** when fake is called.
208  char const *call_name = "_ExitLisProgrammingMode";
209  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
210  return record_of_this_call;
211 }
213 {
217  RecordActualCall(mock, Record__ExitLisProgrammingMode());
218 }
void LisReadout_fake(uint16_t num_pixels)
Definition: Lis_faked.c:52
void _EnterLisProgrammingMode_fake(void)
Definition: Lis_faked.c:148
void _WriteLisConfigBit_fake(uint8_t const *config, uint8_t bit_index)
Definition: Lis_faked.c:170
void LisWriteConfig_fake(void)
Definition: Lis_faked.c:83
void _Write28bitLisConfig_fake(uint8_t *config)
Definition: Lis_faked.c:196
void _WaitForLisClkHigh_fake(void)
Definition: Lis_faked.c:133
void _ConfigAs28bits_fake(uint8_t *config)
Definition: Lis_faked.c:102
void _WaitForLisClkLow_fake(void)
Definition: Lis_faked.c:118
void LisExpose_fake(void)
Definition: Lis_faked.c:68
void _ExitLisProgrammingMode_fake(void)
Definition: Lis_faked.c:212