test: test algorithms-c

This commit is contained in:
cscherr 2025-07-11 11:03:36 +02:00
parent bad5730a8d
commit 727800ba2f
Signed by: cscherrNT
GPG key ID: 8E2B45BC51A27EA7
7 changed files with 38 additions and 42 deletions

View file

@ -0,0 +1,5 @@
SemanticTokens:
DisabledKinds: [InactiveCode]
CompileFlags: # Tweak the parse settings, example directory given to show format
Add:
- "-Wall"

View file

@ -0,0 +1,10 @@
-I
./build/vendor/unity/src/
-I
./build/vendor/cmock/src/
-I
./src/crc/
-I
./src/hash/
-I
./src/

View file

@ -0,0 +1,2 @@
#include "crc_common.h"
const char CRC_CHECK_DATA[CRC_CHECK_DATA_LEN] = {"123456789"};

View file

@ -0,0 +1,7 @@
#ifndef CRC_COMMON_H
#define CRC_COMMON_H
#define CRC_CHECK_DATA_LEN 9
extern const char CRC_CHECK_DATA[CRC_CHECK_DATA_LEN];
#endif // !CRC_COMMON_H

View file

@ -1,21 +1,11 @@
#ifdef TEST
#include "unity.h"
#include "crc.h"
void setUp(void)
{
}
void setUp(void) {}
void tearDown(void)
{
}
void tearDown(void) {}
void test_crc_NeedToImplement(void)
{
void test_crc_NeedToImplement(void) {
TEST_IGNORE_MESSAGE("Need to Implement crc");
}
#endif // TEST

View file

@ -1,21 +1,13 @@
#ifdef TEST
#include "crc_common.h"
#include "unity.h"
#include "crc32.h"
void setUp(void)
{
}
void setUp(void) {}
void tearDown(void)
{
}
void tearDown(void) {}
void test_crc32_NeedToImplement(void)
{
TEST_IGNORE_MESSAGE("Need to Implement crc32");
void test_crc32_check(void) {
TEST_ASSERT_EQUAL_INT(crc32_checksum(CRC_CHECK_DATA, CRC_CHECK_DATA_LEN),
0xCBF43926);
}
#endif // TEST

View file

@ -1,21 +1,11 @@
#ifdef TEST
#include "unity.h"
#include "hash.h"
void setUp(void)
{
}
void setUp(void) {}
void tearDown(void)
{
}
void tearDown(void) {}
void test_hash_NeedToImplement(void)
{
void test_hash_NeedToImplement(void) {
TEST_IGNORE_MESSAGE("Need to Implement hash");
}
#endif // TEST