61#include "Mock_rkhsm.h"
62#include "Mock_rkhsma.h"
69static RKHROM RKH_ROM_T base = {0, 0,
"receiver"};
73static RKH_ST_T state = {{RKH_BASIC,
"state"}};
74static RKH_ST_T pseudoState = {{RKH_CHOICE,
"pseudoState"}};
98test_FlagAfterInit(
void)
103 TEST_ASSERT_NOT_NULL(output);
104 TEST_ASSERT_EQUAL(
RKH_FLG, *output);
108test_NotFullAfterInit(
void)
117test_NotEmptyThenEmpty(
void)
123 TEST_ASSERT_EQUAL(0, nData);
127test_GetPutOneValue(
void)
138 TEST_ASSERT_NOT_NULL(output);
139 TEST_ASSERT_EQUAL(expected, *output);
152 TEST_ASSERT_NOT_NULL(output);
153 TEST_ASSERT_EQUAL(
RKH_FLG, *output);
155 TEST_ASSERT_NOT_NULL(output);
156 TEST_ASSERT_EQUAL(1, *output);
158 TEST_ASSERT_NOT_NULL(output);
159 TEST_ASSERT_EQUAL(2, *output);
161 TEST_ASSERT_NOT_NULL(output);
162 TEST_ASSERT_EQUAL(3, *output);
179test_EmptyToFullToEmpty(
void)
194 TEST_ASSERT_EQUAL(0, nData);
212 TEST_ASSERT_NOT_NULL(output);
215 TEST_ASSERT_EQUAL(128, *output);
219test_GetFromEmptyReturnsNull(
void)
226test_GetContinuousBlock(
void)
234 for (i = 0; i < qty; i++)
239 TEST_ASSERT_EQUAL(qty, nData);
241 for (i = 0; i < nData; i++, output++)
242 TEST_ASSERT_EQUAL((rui8_t)i, *output);
246test_GetManyFromEmptyUsingWholeBlock(
void)
252 TEST_ASSERT_EQUAL(0, nGetElem);
256test_GetManyElemsLessThanStoredUsingWholeBlock(
void)
260 memset(block, 0xaa, 8);
266 TEST_ASSERT_EQUAL(3, nGetElem);
267 TEST_ASSERT_EQUAL(
RKH_FLG, block[0]);
268 TEST_ASSERT_EQUAL(1, block[1]);
269 TEST_ASSERT_EQUAL(2, block[2]);
270 TEST_ASSERT_EQUAL(0xaa, block[3]);
274test_GetManyElemsEqualThanStoredWholeBlock(
void)
278 memset(block, 0xaa, 8);
284 TEST_ASSERT_EQUAL(4, nGetElem);
285 TEST_ASSERT_EQUAL(
RKH_FLG, block[0]);
286 TEST_ASSERT_EQUAL(1, block[1]);
287 TEST_ASSERT_EQUAL(2, block[2]);
288 TEST_ASSERT_EQUAL(3, block[3]);
289 TEST_ASSERT_EQUAL(0xaa, block[4]);
293test_GetManyElemsMoreThanStoredUsingWholeBlock(
void)
297 memset(block, 0xaa, 8);
303 TEST_ASSERT_EQUAL(4, nGetElem);
304 TEST_ASSERT_EQUAL(
RKH_FLG, block[0]);
305 TEST_ASSERT_EQUAL(1, block[1]);
306 TEST_ASSERT_EQUAL(2, block[2]);
307 TEST_ASSERT_EQUAL(3, block[3]);
308 TEST_ASSERT_EQUAL(0xaa, block[4]);
312test_GetManyElemsEqualThanStoredWrapAroundUsingWholeBlock(
void)
317 memset(block, 0xaa, 8);
326 TEST_ASSERT_EQUAL(4, nGetElem);
327 TEST_ASSERT_EQUAL(0xaa, block[0]);
332 TEST_ASSERT_EQUAL(0xaa, block[5]);
336test_GetManyElemsLessThanStoredWrapAroundUsingWholeBlock(
void)
341 memset(block, 0xaa, 8);
350 TEST_ASSERT_EQUAL(3, nGetElem);
351 TEST_ASSERT_EQUAL(0xaa, block[0]);
355 TEST_ASSERT_EQUAL(0xaa, block[4]);
359test_GetManyElemsMoreThanStoredWrapAroundUsingWholeBlock(
void)
373 TEST_ASSERT_EQUAL(0xaa, block[0]);
#define RKH_CFG_TRC_SIZEOF_STREAM
Specify the maximum number of trace events in the stream. The smaller this number,...
Specifies the trace stream manager (circular buffer).
rui8_t * rkh_trc_get_block(TRCQTY_T *nget)
Retrieves a pointer to a contiguous block of data from the trace stream.
TRCQTY_T rkh_trc_getWholeBlock(rui8_t *destBlock, TRCQTY_T nElem)
Copies the last nElem bytes of the stream to destBlock. Frequently, this function is used by the ca...
void rkh_trc_put(rui8_t b)
Put a data byte into the trace stream.
rui8_t * rkh_trc_get(void)
Retrieves a pointer to oldest stored byte in the trace stream. Frequently, this function is used by t...
void rkh_trcStream_init(void)
Initializes the RKH's trace stream.
Represents events without parameters.
Describes the SMA (active object in UML).
Describes the common properties of regular states (basic, composite, and submachine).