Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libnux
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EBRAINS RI
Tech Hub
Apps
BrainScaleS
libnux
Commits
561eedf0
Commit
561eedf0
authored
3 years ago
by
Aron Leibfried
Browse files
Options
Downloads
Patches
Plain Diff
Add test names for bitformatting and helper test
Change-Id: Id27a5ff2b03f7ec67d39e0acd12ed8b0802ed59c
parent
02f816f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/vx/test_bitformatting.cpp
+8
-0
8 additions, 0 deletions
test/vx/test_bitformatting.cpp
test/vx/test_helper.cpp
+8
-0
8 additions, 0 deletions
test/vx/test_helper.cpp
with
16 additions
and
0 deletions
test/vx/test_bitformatting.cpp
+
8
−
0
View file @
561eedf0
...
...
@@ -5,6 +5,8 @@ using namespace libnux::vx;
void
test_reverse_byte
()
{
testcase_begin
(
__func__
);
uint8_t
byte_1
=
170
;
test_equal
(
reverse_byte
(
byte_1
),
85
);
...
...
@@ -13,10 +15,14 @@ void test_reverse_byte()
uint8_t
byte_3
=
0
;
test_equal
(
reverse_byte
(
byte_3
),
0
);
testcase_end
();
}
void
test_vector_reverse_bytes
()
{
testcase_begin
(
__func__
);
__vector
uint8_t
test_vector
;
for
(
uint8_t
i
=
0
;
i
<
sizeof
(
__vector
uint8_t
);
i
++
)
{
...
...
@@ -28,6 +34,8 @@ void test_vector_reverse_bytes()
for
(
uint8_t
i
=
0
;
i
<
sizeof
(
__vector
uint8_t
);
i
++
)
{
test_equal
(
test_vector
[
i
],
reverse_byte
(
i
));
}
testcase_end
();
}
void
start
()
...
...
This diff is collapsed.
Click to expand it.
test/vx/test_helper.cpp
+
8
−
0
View file @
561eedf0
...
...
@@ -7,6 +7,8 @@ using namespace libnux::vx;
void
test_abs_diff
()
{
testcase_begin
(
__func__
);
uint8_t
u8bit_1
=
150
;
uint8_t
u8bit_2
=
15
;
test_equal
(
abs_diff
(
u8bit_1
,
u8bit_2
),
static_cast
<
uint8_t
>
(
135
));
...
...
@@ -26,15 +28,21 @@ void test_abs_diff()
int16_t
s16bit_1
=
-
1000
;
int16_t
s16bit_2
=
-
100
;
test_equal
(
abs_diff
(
s16bit_1
,
s16bit_2
),
static_cast
<
int16_t
>
(
900
));
testcase_end
();
}
void
test_find_max_amount
()
{
testcase_begin
(
__func__
);
std
::
array
<
uint8_t
,
10
>
array_1
{
4
,
17
,
193
,
4
,
193
,
10
,
5
,
3
,
4
,
0
};
test_equal
(
find_max_amount
(
array_1
),
static_cast
<
uint8_t
>
(
4
));
std
::
array
<
uint16_t
,
5
>
array_2
{
1600
,
300
,
1600
,
300
,
1600
};
test_equal
(
find_max_amount
(
array_2
),
static_cast
<
uint16_t
>
(
1600
));
testcase_end
();
}
void
start
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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