Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
f747b07d
Commit
f747b07d
authored
9 years ago
by
Martine Lenders
Browse files
Options
Downloads
Patches
Plain Diff
unittests: adapt ng_pktbuf tests for new API
parent
41b0a266
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/unittests/tests-ipv6_hdr/tests-ipv6_hdr.c
+5
-6
5 additions, 6 deletions
tests/unittests/tests-ipv6_hdr/tests-ipv6_hdr.c
tests/unittests/tests-pktbuf/tests-pktbuf.c
+256
-234
256 additions, 234 deletions
tests/unittests/tests-pktbuf/tests-pktbuf.c
with
261 additions
and
240 deletions
tests/unittests/tests-ipv6_hdr/tests-ipv6_hdr.c
+
5
−
6
View file @
f747b07d
...
...
@@ -304,6 +304,7 @@ static void test_ipv6_hdr_build__wrong_src_len(void)
ng_ipv6_addr_t
src
=
DEFAULT_TEST_SRC
;
ng_ipv6_addr_t
dst
=
DEFAULT_TEST_DST
;
ng_pktbuf_init
();
TEST_ASSERT_NULL
(
ng_ipv6_hdr_build
(
NULL
,
(
uint8_t
*
)
&
src
,
sizeof
(
ng_ipv6_addr_t
)
+
TEST_UINT8
,
(
uint8_t
*
)
&
dst
,
...
...
@@ -316,6 +317,7 @@ static void test_ipv6_hdr_build__wrong_dst_len(void)
ng_ipv6_addr_t
src
=
DEFAULT_TEST_SRC
;
ng_ipv6_addr_t
dst
=
DEFAULT_TEST_DST
;
ng_pktbuf_init
();
TEST_ASSERT_NULL
(
ng_ipv6_hdr_build
(
NULL
,
(
uint8_t
*
)
&
src
,
sizeof
(
ng_ipv6_addr_t
),
(
uint8_t
*
)
&
dst
,
...
...
@@ -329,7 +331,7 @@ static void test_ipv6_hdr_build__src_NULL(void)
ng_pktsnip_t
*
pkt
;
ng_ipv6_hdr_t
*
hdr
;
TEST_ASSERT
(
ng_pktbuf_i
s_empty
()
);
ng_pktbuf_i
nit
(
);
TEST_ASSERT_NOT_NULL
((
pkt
=
ng_ipv6_hdr_build
(
NULL
,
NULL
,
0
,
(
uint8_t
*
)
&
dst
,
sizeof
(
ng_ipv6_addr_t
))));
hdr
=
pkt
->
data
;
...
...
@@ -341,7 +343,6 @@ static void test_ipv6_hdr_build__src_NULL(void)
TEST_ASSERT_EQUAL_INT
(
0
,
hdr
->
hl
);
TEST_ASSERT
(
ng_ipv6_addr_equal
(
&
dst
,
&
hdr
->
dst
));
TEST_ASSERT
(
!
ng_pktbuf_is_empty
());
ng_pktbuf_reset
();
}
static
void
test_ipv6_hdr_build__dst_NULL
(
void
)
...
...
@@ -350,7 +351,7 @@ static void test_ipv6_hdr_build__dst_NULL(void)
ng_pktsnip_t
*
pkt
;
ng_ipv6_hdr_t
*
hdr
;
TEST_ASSERT
(
ng_pktbuf_i
s_empty
()
);
ng_pktbuf_i
nit
(
);
TEST_ASSERT_NOT_NULL
((
pkt
=
ng_ipv6_hdr_build
(
NULL
,
(
uint8_t
*
)
&
src
,
sizeof
(
ng_ipv6_addr_t
),
NULL
,
0
)));
...
...
@@ -363,7 +364,6 @@ static void test_ipv6_hdr_build__dst_NULL(void)
TEST_ASSERT_EQUAL_INT
(
0
,
hdr
->
hl
);
TEST_ASSERT
(
ng_ipv6_addr_equal
(
&
src
,
&
hdr
->
src
));
TEST_ASSERT
(
!
ng_pktbuf_is_empty
());
ng_pktbuf_reset
();
}
static
void
test_ipv6_hdr_build__complete
(
void
)
...
...
@@ -373,7 +373,7 @@ static void test_ipv6_hdr_build__complete(void)
ng_pktsnip_t
*
pkt
;
ng_ipv6_hdr_t
*
hdr
;
TEST_ASSERT
(
ng_pktbuf_i
s_empty
()
);
ng_pktbuf_i
nit
(
);
TEST_ASSERT_NOT_NULL
((
pkt
=
ng_ipv6_hdr_build
(
NULL
,
(
uint8_t
*
)
&
src
,
sizeof
(
ng_ipv6_addr_t
),
(
uint8_t
*
)
&
dst
,
...
...
@@ -388,7 +388,6 @@ static void test_ipv6_hdr_build__complete(void)
TEST_ASSERT
(
ng_ipv6_addr_equal
(
&
src
,
&
hdr
->
src
));
TEST_ASSERT
(
ng_ipv6_addr_equal
(
&
dst
,
&
hdr
->
dst
));
TEST_ASSERT
(
!
ng_pktbuf_is_empty
());
ng_pktbuf_reset
();
}
Test
*
tests_ipv6_hdr_tests
(
void
)
...
...
This diff is collapsed.
Click to expand it.
tests/unittests/tests-pktbuf/tests-pktbuf.c
+
256
−
234
View file @
f747b07d
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