Skip to content
Snippets Groups Projects
Commit 0bfbf3c4 authored by Dominik Loidolt's avatar Dominik Loidolt
Browse files

Update compression entity unit tests

parent 3c309cdf
No related branches found
No related tags found
1 merge request!30Enhanced Error Handling in Chunk Compression Functions
......@@ -464,7 +464,7 @@ void test_cmp_ent_data_type(void)
/* error cases */
raw_mode_flag = 0;
data_type = 0x8000;
data_type = (enum cmp_data_type)0x8000;
error = cmp_ent_set_data_type(&ent, data_type, raw_mode_flag);
TEST_ASSERT_TRUE(error);
error = cmp_ent_set_data_type(NULL, data_type, raw_mode_flag);
......@@ -1334,7 +1334,11 @@ void test_cmp_ent_get_data_buf(void)
/* compression data type not supported test */
error = cmp_ent_set_data_type(&ent, DATA_TYPE_UNKNOWN, 0);
TEST_ASSERT_FALSE(error);
adr = cmp_ent_get_data_buf(&ent);
TEST_ASSERT_NULL(adr);
error = cmp_ent_set_data_type(&ent, (enum cmp_data_type)234, 1);
TEST_ASSERT_FALSE(error);
adr = cmp_ent_get_data_buf(&ent);
TEST_ASSERT_NULL(adr);
}
......@@ -1767,7 +1771,7 @@ void test_cmp_ent_create(void)
cmp_size_byte = 100;
size = cmp_ent_create(NULL, data_type, raw_mode_flag, cmp_size_byte);
TEST_ASSERT_EQUAL_UINT32(0, size);
data_type = 0xFFF;
data_type = (enum cmp_data_type)0xFFF; /* undefined data type */
raw_mode_flag = 1;
cmp_size_byte = 100;
size = cmp_ent_create(NULL, data_type, raw_mode_flag, cmp_size_byte);
......@@ -1985,7 +1989,7 @@ void test_cmp_ent_print(void)
uint64_t start_time, end_time;
uint16_t model_id;
uint8_t model_counter;
struct cmp_cfg cfg;
struct cmp_cfg cfg = {0};
int cmp_size_bits;
struct cmp_max_used_bits max_used_bits = {0};
......@@ -2107,7 +2111,7 @@ void test_cmp_ent_parse(void)
free(ent);
cfg.data_type = DATA_TYPE_S_FX;
cfg.data_type = DATA_TYPE_CHUNK;
cfg.cmp_mode = CMP_MODE_MODEL_ZERO;
version_id = 0x800F0003;
size = cmp_ent_build(NULL, version_id, start_time, end_time, model_id,
......@@ -2120,5 +2124,9 @@ void test_cmp_ent_parse(void)
cmp_ent_parse(ent);
/* unknown data product type */
cmp_ent_set_data_type(ent, DATA_TYPE_UNKNOWN, 0);
cmp_ent_parse(ent);
free(ent);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment