32 TEST_ASSERT_EQUAL_UINT8(0xAB, len);
36 const uint8_t pkt[] = {1, 2, 3, 4, 5};
41 TEST_ASSERT_EQUAL_UINT8(
sizeof pkt, len);
42 TEST_ASSERT_EQUAL_HEX8_ARRAY(pkt, buf,
sizeof pkt);
48 const uint8_t
a[] = {0xAA};
49 const uint8_t
b[] = {0xBB, 0xBB};
55 TEST_ASSERT_EQUAL_UINT8(1, len);
56 TEST_ASSERT_EQUAL_HEX8(0xAA, buf[0]);
58 TEST_ASSERT_EQUAL_UINT8(2, len);
59 TEST_ASSERT_EQUAL_HEX8(0xBB, buf[0]);
68 for (uint8_t i = 0; i < 20; i++) {
69 const uint8_t pkt[] = {i,
static_cast<uint8_t
>(i + 100)};
72 TEST_ASSERT_EQUAL_UINT8(
sizeof pkt, len);
73 TEST_ASSERT_EQUAL_HEX8_ARRAY(pkt, buf,
sizeof pkt);
80 for (uint8_t i = 0; i < 8; i++) {
83 const uint8_t extra = 0xEE;
87 for (uint8_t i = 0; i < 8; i++) {
89 TEST_ASSERT_EQUAL_HEX8(i, buf[0]);
95 const uint8_t pkt[] = {1};
103 const uint8_t pkt[8] = {0};
115 const uint8_t pkt[] = {9, 8, 7};
119 TEST_ASSERT_EQUAL_UINT8(
sizeof pkt,
n);
120 TEST_ASSERT_EQUAL_HEX8_ARRAY(pkt,
back,
sizeof pkt);
124 const uint8_t pkt[] = {1, 2};
133 const uint8_t
a[] = {1};
134 const uint8_t
b[] = {2, 3};
140 TEST_ASSERT_EQUAL_HEX8_ARRAY(
b,
back,
sizeof b);
145 const uint8_t pkt[] = {1};
152 const uint8_t pkt[] = {1};
*brief create JSON pointer *sa reference_tokens const string_t const string_t & b
*brief create JSON pointer *sa reference_tokens const string_t & a
return reference_tokens back()
*brief user defined string literal for JSON values *sa std::size_t n
void reset(bool chip_present)
void set_send_result(RadioStatus result)
uint8_t last_sent(uint8_t *out, uint8_t out_cap)
bool inject(const uint8_t *bytes, uint8_t len)
RadioStatus radio_receive(uint8_t *buf, uint8_t max_len, uint8_t &len)
RadioStatus radio_probe()
RadioStatus radio_send(const uint8_t *bytes, uint8_t len)
static void test_inject_refuses_when_queue_full(void)
static void test_send_is_visible_to_the_test(void)
static void test_receive_is_first_in_first_out(void)
static void test_receive_drops_packet_bigger_than_buffer(void)
static void test_receive_returns_injected_packet_with_its_length(void)
static void test_inject_refuses_empty_packet(void)
static void test_reset_forgets_what_was_sent(void)
static void test_receive_keeps_working_after_queue_wraps(void)
static void test_probe_reports_not_found_when_chip_missing(void)
static void test_receive_with_nothing_waiting_returns_no_data(void)
static void test_send_gives_the_failure_the_test_asks_for(void)
static void test_probe_ok_when_chip_present(void)
static void test_send_counts_each_packet(void)
static void test_send_fails_when_chip_missing(void)