Skip to content

Commit

Permalink
tests: provide gnrc_sock_ip tests
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Aug 26, 2016
1 parent 10b39e2 commit b6f6ee1
Show file tree
Hide file tree
Showing 4 changed files with 824 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/net/gnrc/sock/ip/gnrc_sock_ip.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ int sock_ip_create(sock_ip_t *sock, const sock_ip_ep_t *local,
}
memcpy(&sock->local, local, sizeof(sock_ip_t));
}
gnrc_sock_create(&sock->reg, GNRC_NETTYPE_IPV6,
proto);
memset(&sock->remote, 0, sizeof(sock_ip_t));
if (remote != NULL) {
if (gnrc_af_not_supported(remote->family)) {
return -EAFNOSUPPORT;
}
memcpy(&sock->remote, remote, sizeof(sock_ip_t));
}
gnrc_sock_create(&sock->reg, GNRC_NETTYPE_IPV6,
proto);
sock->flags = flags;
return 0;
}
Expand Down
20 changes: 20 additions & 0 deletions tests/gnrc_sock_ip/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
APPLICATION = gnrc_sock_ip

BOARD ?= native

RIOTBASE ?= $(CURDIR)/../..

USEMODULE += gnrc_sock_ip
USEMODULE += gnrc_ipv6
USEMODULE += ps

CFLAGS += -DDEVELHELP
CFLAGS += -DGNRC_PKTBUF_SIZE=200
CFLAGS += -DTEST_SUITES

QUIET ?= 1

include $(RIOTBASE)/Makefile.include

test:
./tests/01-run.py
Loading

0 comments on commit b6f6ee1

Please sign in to comment.