Skip to content

Commit 4ba7eb7

Browse files
committed
tests: crc: Add test-case to validate CRC24Q RTCM3
Validating both a frame without CRC (should return calculated CRC), and with CRC (should return 0 as a match). Signed-off-by: Luis Ubieda <luisf@croxel.com>
1 parent f1eb14f commit 4ba7eb7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/unit/crc/main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ ZTEST(crc, test_crc24_pgp)
9090
zassert_equal(crc24_pgp_update(0x00BA353A, test2 + 5, 4), 0x0021CF02);
9191
}
9292

93+
ZTEST(crc, test_crc24q_rtcm3)
94+
{
95+
uint8_t test1[] = {0xD3, 0x00, 0x04, 0x4C, 0xE0, 0x00, 0x80};
96+
uint8_t test2[] = {0xD3, 0x00, 0x04, 0x4C, 0xE0, 0x00, 0x80, 0xED, 0xED, 0xD6};
97+
98+
zassert_equal(crc24q_rtcm3(test1, sizeof(test1)), 0xEDEDD6);
99+
zassert_equal(crc24q_rtcm3(test2, sizeof(test2)), 0x000000);
100+
}
101+
93102
ZTEST(crc, test_crc16)
94103
{
95104
uint8_t test[] = { '1', '2', '3', '4', '5', '6', '7', '8', '9' };

0 commit comments

Comments
 (0)