Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmp_tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dominik Loidolt
cmp_tool
Commits
0bfbf3c4
Commit
0bfbf3c4
authored
1 year ago
by
Dominik Loidolt
Browse files
Options
Downloads
Patches
Plain Diff
Update compression entity unit tests
parent
3c309cdf
No related branches found
No related tags found
1 merge request
!30
Enhanced Error Handling in Chunk Compression Functions
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/cmp_entity/test_cmp_entity.c
+12
-4
12 additions, 4 deletions
test/cmp_entity/test_cmp_entity.c
with
12 additions
and
4 deletions
test/cmp_entity/test_cmp_entity.c
+
12
−
4
View file @
0bfbf3c4
...
...
@@ -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
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment