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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dominik Loidolt
cmp_tool
Commits
27cd0924
Commit
27cd0924
authored
8 months ago
by
Dominik Loidolt
Browse files
Options
Downloads
Patches
Plain Diff
Refactor: simplify size verification logic in chunk round trip compression test
parent
f8293d9a
No related branches found
No related tags found
1 merge request
!34
Update cmp_tool to version v0.13
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_common/chunk_round_trip.c
+3
-5
3 additions, 5 deletions
test/test_common/chunk_round_trip.c
with
3 additions
and
5 deletions
test/test_common/chunk_round_trip.c
+
3
−
5
View file @
27cd0924
...
@@ -111,19 +111,17 @@ uint32_t chunk_round_trip(const void *chunk, uint32_t chunk_size,
...
@@ -111,19 +111,17 @@ uint32_t chunk_round_trip(const void *chunk, uint32_t chunk_size,
cmp_size
=
compress_chunk
(
chunk
,
chunk_size
,
chunk_model
,
updated_chunk_model
,
cmp_size
=
compress_chunk
(
chunk
,
chunk_size
,
chunk_model
,
updated_chunk_model
,
dst
,
dst_capacity
,
cmp_par
);
dst
,
dst_capacity
,
cmp_par
);
if
(
!
cmp_is_error
(
cmp_size
))
{
/* seco
u
nd run wi
c
h dst = NULL */
if
(
!
cmp_is_error
(
cmp_size
))
{
/* second run wi
t
h dst = NULL */
uint32_t
cmp_size2
;
uint32_t
cmp_size2
;
/* reset model if in-place update was used */
/* reset model if in-place update was used */
if
(
chunk_model
&&
updated_chunk_model
==
chunk_model
)
if
(
chunk_model
&&
updated_chunk_model
==
chunk_model
)
memcpy
(
updated_chunk_model
,
model_cpy
,
chunk_size
);
memcpy
(
updated_chunk_model
,
model_cpy
,
chunk_size
);
cmp_size2
=
compress_chunk
(
chunk
,
chunk_size
,
chunk_model
,
updated_chunk_model
,
cmp_size2
=
compress_chunk
(
chunk
,
chunk_size
,
chunk_model
,
updated_chunk_model
,
NULL
,
dst_capacity
,
cmp_par
);
NULL
,
dst_capacity
,
cmp_par
);
if
(
cmp_get_error_code
(
cmp_size
)
==
CMP_ERROR_SMALL_BUFFER
)
if
(
cmp_get_error_code
(
cmp_size
)
!=
CMP_ERROR_SMALL_BUFFER
)
TEST_ASSERT
(
!
cmp_is_error
(
cmp_size
));
else
TEST_ASSERT
(
cmp_size
==
cmp_size2
);
TEST_ASSERT
(
cmp_size
==
cmp_size2
);
}
}
...
...
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