test: test algorithms-c
This commit is contained in:
parent
bad5730a8d
commit
727800ba2f
7 changed files with 38 additions and 42 deletions
5
crates/algorithms/algorithms-c/.clangd
Normal file
5
crates/algorithms/algorithms-c/.clangd
Normal file
|
@ -0,0 +1,5 @@
|
|||
SemanticTokens:
|
||||
DisabledKinds: [InactiveCode]
|
||||
CompileFlags: # Tweak the parse settings, example directory given to show format
|
||||
Add:
|
||||
- "-Wall"
|
10
crates/algorithms/algorithms-c/compile_flags.txt
Normal file
10
crates/algorithms/algorithms-c/compile_flags.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
-I
|
||||
./build/vendor/unity/src/
|
||||
-I
|
||||
./build/vendor/cmock/src/
|
||||
-I
|
||||
./src/crc/
|
||||
-I
|
||||
./src/hash/
|
||||
-I
|
||||
./src/
|
2
crates/algorithms/algorithms-c/test/crc/crc_common.c
Normal file
2
crates/algorithms/algorithms-c/test/crc/crc_common.c
Normal file
|
@ -0,0 +1,2 @@
|
|||
#include "crc_common.h"
|
||||
const char CRC_CHECK_DATA[CRC_CHECK_DATA_LEN] = {"123456789"};
|
7
crates/algorithms/algorithms-c/test/crc/crc_common.h
Normal file
7
crates/algorithms/algorithms-c/test/crc/crc_common.h
Normal 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
|
|
@ -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)
|
||||
{
|
||||
TEST_IGNORE_MESSAGE("Need to Implement crc");
|
||||
void test_crc_NeedToImplement(void) {
|
||||
TEST_IGNORE_MESSAGE("Need to Implement crc");
|
||||
}
|
||||
|
||||
#endif // TEST
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
TEST_IGNORE_MESSAGE("Need to Implement hash");
|
||||
void test_hash_NeedToImplement(void) {
|
||||
TEST_IGNORE_MESSAGE("Need to Implement hash");
|
||||
}
|
||||
|
||||
#endif // TEST
|
||||
|
|
Loading…
Add table
Reference in a new issue