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
db4796b0
You need to sign in or sign up before continuing.
Commit
db4796b0
authored
6 years ago
by
Martine Lenders
Browse files
Options
Downloads
Patches
Plain Diff
tests: adapt lwip_sock_udp tests for API change
parent
01ef01f0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/lwip_sock_udp/main.c
+33
-0
33 additions, 0 deletions
tests/lwip_sock_udp/main.c
with
33 additions
and
0 deletions
tests/lwip_sock_udp/main.c
+
33
−
0
View file @
db4796b0
...
@@ -117,6 +117,21 @@ static void test_sock_udp_create4__only_local(void)
...
@@ -117,6 +117,21 @@ static void test_sock_udp_create4__only_local(void)
assert
(
-
ENOTCONN
==
sock_udp_get_remote
(
&
_sock
,
&
ep
));
assert
(
-
ENOTCONN
==
sock_udp_get_remote
(
&
_sock
,
&
ep
));
}
}
static
void
test_sock_udp_create4__only_local_port0
(
void
)
{
static
const
sock_udp_ep_t
local
=
{
.
family
=
AF_INET
,
.
port
=
0U
};
sock_udp_ep_t
ep
;
assert
(
0
==
sock_udp_create
(
&
_sock
,
&
local
,
NULL
,
SOCK_FLAGS_REUSE_EP
));
assert
(
0
==
sock_udp_get_local
(
&
_sock
,
&
ep
));
assert
(
AF_INET
==
ep
.
family
);
assert
(
0
==
ep
.
addr
.
ipv4_u32
);
assert
(
SOCK_ADDR_ANY_NETIF
==
ep
.
netif
);
assert
(
0U
!=
ep
.
port
);
assert
(
-
ENOTCONN
==
sock_udp_get_remote
(
&
_sock
,
&
ep
));
}
static
void
test_sock_udp_create4__only_local_reuse_ep
(
void
)
static
void
test_sock_udp_create4__only_local_reuse_ep
(
void
)
{
{
static
const
sock_udp_ep_t
local
=
{
.
family
=
AF_INET
,
static
const
sock_udp_ep_t
local
=
{
.
family
=
AF_INET
,
...
@@ -694,6 +709,22 @@ static void test_sock_udp_create6__only_local(void)
...
@@ -694,6 +709,22 @@ static void test_sock_udp_create6__only_local(void)
assert
(
-
ENOTCONN
==
sock_udp_get_remote
(
&
_sock
,
&
ep
));
assert
(
-
ENOTCONN
==
sock_udp_get_remote
(
&
_sock
,
&
ep
));
}
}
static
void
test_sock_udp_create6__only_local_port0
(
void
)
{
static
const
sock_udp_ep_t
local
=
{
.
family
=
AF_INET6
,
.
port
=
0U
};
sock_udp_ep_t
ep
;
assert
(
0
==
sock_udp_create
(
&
_sock
,
&
local
,
NULL
,
SOCK_FLAGS_REUSE_EP
));
assert
(
0
==
sock_udp_get_local
(
&
_sock
,
&
ep
));
assert
(
AF_INET6
==
ep
.
family
);
assert
(
memcmp
(
&
ipv6_addr_unspecified
,
&
ep
.
addr
.
ipv6
,
sizeof
(
ipv6_addr_t
))
==
0
);
assert
(
SOCK_ADDR_ANY_NETIF
==
ep
.
netif
);
assert
(
0U
!=
ep
.
port
);
assert
(
-
ENOTCONN
==
sock_udp_get_remote
(
&
_sock
,
&
ep
));
}
static
void
test_sock_udp_create6__only_local_reuse_ep
(
void
)
static
void
test_sock_udp_create6__only_local_reuse_ep
(
void
)
{
{
static
const
sock_udp_ep_t
local
=
{
.
family
=
AF_INET6
,
static
const
sock_udp_ep_t
local
=
{
.
family
=
AF_INET6
,
...
@@ -1256,6 +1287,7 @@ int main(void)
...
@@ -1256,6 +1287,7 @@ int main(void)
CALL
(
test_sock_udp_create4__EINVAL_netif
());
CALL
(
test_sock_udp_create4__EINVAL_netif
());
CALL
(
test_sock_udp_create4__no_endpoints
());
CALL
(
test_sock_udp_create4__no_endpoints
());
CALL
(
test_sock_udp_create4__only_local
());
CALL
(
test_sock_udp_create4__only_local
());
CALL
(
test_sock_udp_create4__only_local_port0
());
CALL
(
test_sock_udp_create4__only_local_reuse_ep
());
CALL
(
test_sock_udp_create4__only_local_reuse_ep
());
CALL
(
test_sock_udp_create4__only_remote
());
CALL
(
test_sock_udp_create4__only_remote
());
CALL
(
test_sock_udp_create4__full
());
CALL
(
test_sock_udp_create4__full
());
...
@@ -1301,6 +1333,7 @@ int main(void)
...
@@ -1301,6 +1333,7 @@ int main(void)
CALL
(
test_sock_udp_create6__EINVAL_netif
());
CALL
(
test_sock_udp_create6__EINVAL_netif
());
CALL
(
test_sock_udp_create6__no_endpoints
());
CALL
(
test_sock_udp_create6__no_endpoints
());
CALL
(
test_sock_udp_create6__only_local
());
CALL
(
test_sock_udp_create6__only_local
());
CALL
(
test_sock_udp_create6__only_local_port0
());
CALL
(
test_sock_udp_create6__only_local_reuse_ep
());
CALL
(
test_sock_udp_create6__only_local_reuse_ep
());
CALL
(
test_sock_udp_create6__only_remote
());
CALL
(
test_sock_udp_create6__only_remote
());
CALL
(
test_sock_udp_create6__full
());
CALL
(
test_sock_udp_create6__full
());
...
...
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