Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/bouyer-socketcan]: src/tests/net/can Make it build from build.sh (fix wa...
details: https://anonhg.NetBSD.org/src/rev/dc0eba814499
branches: bouyer-socketcan
changeset: 820875:dc0eba814499
user: bouyer <bouyer%NetBSD.org@localhost>
date: Mon Apr 17 20:41:26 2017 +0000
description:
Make it build from build.sh (fix warnings)
diffstat:
tests/net/can/h_canutils.c | 6 +++---
tests/net/can/h_canutils.h | 3 ++-
tests/net/can/t_can.c | 34 ++++++++++++----------------------
tests/net/can/t_canfilter.c | 15 ++++++---------
4 files changed, 23 insertions(+), 35 deletions(-)
diffs (225 lines):
diff -r 027ffd4abc1d -r dc0eba814499 tests/net/can/h_canutils.c
--- a/tests/net/can/h_canutils.c Mon Apr 17 20:34:59 2017 +0000
+++ b/tests/net/can/h_canutils.c Mon Apr 17 20:41:26 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: h_canutils.c,v 1.1.2.4 2017/02/05 12:18:20 bouyer Exp $ */
+/* $NetBSD: h_canutils.c,v 1.1.2.5 2017/04/17 20:41:26 bouyer Exp $ */
/*-
* Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: h_canutils.c,v 1.1.2.4 2017/02/05 12:18:20 bouyer Exp $");
+__RCSID("$NetBSD: h_canutils.c,v 1.1.2.5 2017/04/17 20:41:26 bouyer Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -124,7 +124,7 @@
ATF_CHECK_MSG(sa->can_family == AF_CAN,
"recvfrom provided wrong %d family", sa->can_family);
ATF_CHECK_MSG(salen == sizeof(struct sockaddr_can),
- "recvfrom provided wrong size %d (!= %d)", salen, sizeof(sa));
+ "recvfrom provided wrong size %d (!= %ld)", salen, sizeof(sa));
return 0;
}
diff -r 027ffd4abc1d -r dc0eba814499 tests/net/can/h_canutils.h
--- a/tests/net/can/h_canutils.h Mon Apr 17 20:34:59 2017 +0000
+++ b/tests/net/can/h_canutils.h Mon Apr 17 20:41:26 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: h_canutils.h,v 1.1.2.2 2017/02/05 12:03:23 bouyer Exp $ */
+/* $NetBSD: h_canutils.h,v 1.1.2.3 2017/04/17 20:41:26 bouyer Exp $ */
/*-
* Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -34,3 +34,4 @@
int can_recvfrom(int, struct can_frame *, int *, struct sockaddr_can *);
int can_read(int, struct can_frame *, int *);
int can_bind(int s, const char *);
+int can_socket_with_own(void);
diff -r 027ffd4abc1d -r dc0eba814499 tests/net/can/t_can.c
--- a/tests/net/can/t_can.c Mon Apr 17 20:34:59 2017 +0000
+++ b/tests/net/can/t_can.c Mon Apr 17 20:41:26 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_can.c,v 1.1.2.6 2017/02/05 12:18:20 bouyer Exp $ */
+/* $NetBSD: t_can.c,v 1.1.2.7 2017/04/17 20:41:26 bouyer Exp $ */
/*-
* Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: t_can.c,v 1.1.2.6 2017/02/05 12:18:20 bouyer Exp $");
+__RCSID("$NetBSD: t_can.c,v 1.1.2.7 2017/04/17 20:41:26 bouyer Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -99,13 +99,11 @@
ATF_TC_BODY(cannoown, tc)
{
const char ifname[] = "canlo0";
- int s, rv, v, vlen;
+ int s, rv, v;
+ socklen_t vlen;
struct sockaddr_can sa;
- socklen_t salen;
int ifindex;
struct can_frame cf_send, cf_receive;
- fd_set rfds;
- struct timeval tmout;
rump_init();
cancfg_rump_createif(ifname);
@@ -175,7 +173,8 @@
ATF_TC_BODY(canwritelo, tc)
{
const char ifname[] = "canlo0";
- int s, rv, v, vlen;
+ int s, rv, v;
+ socklen_t vlen;
struct can_frame cf_send, cf_receive;
rump_init();
@@ -245,7 +244,6 @@
{
const char ifname[] = "canlo0";
int s, rv;
- struct sockaddr_can sa;
struct can_frame cf_send;
rump_init();
@@ -282,7 +280,7 @@
ATF_TC_BODY(cansendtolo, tc)
{
const char ifname[] = "canlo0";
- int s, v, rv;
+ int s, rv;
struct sockaddr_can sa;
struct ifreq ifr;
struct can_frame cf_send, cf_receive;
@@ -345,7 +343,7 @@
ATF_TC_BODY(cansendtowrite, tc)
{
const char ifname[] = "canlo0";
- int s, rv, v;
+ int s, rv;
struct sockaddr_can sa;
struct ifreq ifr;
struct can_frame cf_send, cf_receive;
@@ -411,7 +409,6 @@
const char ifname[] = "canlo0";
int s1, rv1;
int s2, rv2;
- int v;
struct can_frame cf_send, cf_receive1, cf_receive2;
rump_init();
@@ -474,9 +471,7 @@
const char ifname[] = "canlo0";
int s1, rv1;
int s2, rv2;
- int v;
struct can_frame cf_send, cf_receive1, cf_receive2;
- socklen_t salen;
int ifindex;
struct sockaddr_can sa;
@@ -541,14 +536,9 @@
const char ifname2[] = "canlo1";
int s1, rv1;
int s2, rv2;
- int v;
struct sockaddr_can sa;
int ifindex2;
- struct ifreq ifr;
struct can_frame cf_send, cf_receive1, cf_receive2;
- socklen_t salen;
- fd_set rfds;
- struct timeval tmout;
rump_init();
cancfg_rump_createif(ifname);
@@ -613,9 +603,9 @@
const char ifname[] = "canlo0";
int s1, rv1;
int s2, rv2;
- int v, vlen;
+ int v;
+ socklen_t vlen;
struct sockaddr_can sa;
- struct ifreq ifr;
struct can_frame cf_send, cf_receive1, cf_receive2;
socklen_t salen;
int ifindex;
@@ -696,7 +686,7 @@
ATF_CHECK_MSG(sa.can_family == AF_CAN,
"recvfrom provided wrong %d family", sa.can_family);
ATF_CHECK_MSG(salen == sizeof(sa),
- "recvfrom provided wrong size %d (!= %d)",
+ "recvfrom provided wrong size %d (!= %ld)",
salen, sizeof(sa));
ATF_CHECK_MSG(sa.can_ifindex == ifindex,
"recvfrom provided wrong ifindex %d (!= %d)",
@@ -718,7 +708,7 @@
ATF_CHECK_MSG(sa.can_family == AF_CAN,
"recvfrom provided wrong %d family", sa.can_family);
ATF_CHECK_MSG(salen == sizeof(sa),
- "recvfrom provided wrong size %d (!= %d)",
+ "recvfrom provided wrong size %d (!= %ld)",
salen, sizeof(sa));
ATF_CHECK_MSG(sa.can_ifindex == ifindex,
"recvfrom provided wrong ifindex %d (!= %d)",
diff -r 027ffd4abc1d -r dc0eba814499 tests/net/can/t_canfilter.c
--- a/tests/net/can/t_canfilter.c Mon Apr 17 20:34:59 2017 +0000
+++ b/tests/net/can/t_canfilter.c Mon Apr 17 20:41:26 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_canfilter.c,v 1.1.2.3 2017/02/05 12:18:20 bouyer Exp $ */
+/* $NetBSD: t_canfilter.c,v 1.1.2.4 2017/04/17 20:41:26 bouyer Exp $ */
/*-
* Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: t_canfilter.c,v 1.1.2.3 2017/02/05 12:18:20 bouyer Exp $");
+__RCSID("$NetBSD: t_canfilter.c,v 1.1.2.4 2017/04/17 20:41:26 bouyer Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -198,7 +198,7 @@
int s, rv;
struct can_frame cf_send, cf_receive;
struct can_filter cfi[2];
- int cfilen;
+ socklen_t cfilen;
rump_init();
cancfg_rump_createif(ifname);
@@ -396,12 +396,9 @@
ATF_TC_BODY(canfilter_get, tc)
{
const char ifname[] = "canlo0";
- int s, rv;
- struct sockaddr_can sa;
- struct ifreq ifr;
- struct can_frame cf_send, cf_receive;
+ int s;
struct can_filter cfi[2];
- int cfilen;
+ socklen_t cfilen;
rump_init();
cancfg_rump_createif(ifname);
@@ -444,7 +441,7 @@
ATF_CHECK_MSG(cfilen == sizeof(struct can_filter) * 2,
"CAN_RAW_FILTER returns wrong len (%d)", cfilen);
ATF_CHECK_MSG(cfi[0].can_id == MY_ID &&
- cfi[0].can_mask == CAN_SFF_MASK | CAN_EFF_FLAG,
+ cfi[0].can_mask == (CAN_SFF_MASK | CAN_EFF_FLAG),
"CAN_RAW_FILTER returns wrong filter 0 (%d, %d)",
cfi[0].can_id, cfi[0].can_mask);
ATF_CHECK_MSG(cfi[1].can_id == MY_ID + 1 &&
Home |
Main Index |
Thread Index |
Old Index