Skip to content

Commit 3b9b9fb

Browse files
committed
unit-tests: Remove CRC tests now that the source patch is reverted
Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
1 parent 1b48098 commit 3b9b9fb

1 file changed

Lines changed: 0 additions & 40 deletions

File tree

tests/unit-tests/test-cp-phy.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -260,45 +260,6 @@ int test_cp_build_packet_chlng(struct osdp *ctx)
260260
return 0;
261261
}
262262

263-
int test_cp_build_packet_with_crc(struct osdp *ctx)
264-
{
265-
int len;
266-
struct osdp_pd *p = GET_CURRENT_PD(ctx);
267-
reset_pd_packet_state(p);
268-
uint8_t packet[512] = { CMD_POLL };
269-
270-
printf(SUB_1 "Testing cp_build_and_send_packet with CRC -- ");
271-
SET_FLAG(p, PD_FLAG_CP_USE_CRC);
272-
273-
if ((len = test_cp_build_and_send_packet(p, packet, 1, 512)) < 0) {
274-
CLEAR_FLAG(p, PD_FLAG_CP_USE_CRC);
275-
return -1;
276-
}
277-
278-
/* Check if the control byte has CRC flag set (bit 2) */
279-
int mark_offset = 0;
280-
#ifndef OPT_OSDP_SKIP_MARK_BYTE
281-
mark_offset = 1;
282-
#endif
283-
uint8_t control_byte = packet[mark_offset + 4]; /* SOM + addr + len_lsb + len_msb + control */
284-
285-
CLEAR_FLAG(p, PD_FLAG_CP_USE_CRC);
286-
287-
if (!(control_byte & 0x04)) {
288-
printf("failed! CRC flag not set in control byte (0x%02x)\n", control_byte);
289-
return -1;
290-
}
291-
292-
/* Verify the packet length includes CRC (2 bytes) instead of checksum (1 byte) */
293-
if (len != (mark_offset + 5 + 1 + 2)) { /* header + data + CRC */
294-
printf("failed! Expected CRC packet length %d, got %d\n", mark_offset + 5 + 1 + 2, len);
295-
return -1;
296-
}
297-
298-
printf("success!\n");
299-
return 0;
300-
}
301-
302263
int test_phy_decode_packet_nak(struct osdp *ctx)
303264
{
304265
uint8_t *buf;
@@ -840,7 +801,6 @@ void run_cp_phy_tests(struct test *t)
840801
DO_TEST(t, test_cp_build_packet_poll);
841802
DO_TEST(t, test_cp_build_packet_id);
842803
DO_TEST(t, test_cp_build_packet_chlng);
843-
DO_TEST(t, test_cp_build_packet_with_crc);
844804
DO_TEST(t, test_phy_build_packet_without_mark);
845805
DO_TEST(t, test_phy_packet_multiple_commands);
846806
DO_TEST(t, test_phy_decode_packet_ack);

0 commit comments

Comments
 (0)