Module Name:    src
Committed By:   bouyer
Date:           Sun Feb  5 11:44:17 UTC 2017

Modified Files:
        src/tests/net/can [bouyer-socketcan]: h_canutils.c t_can.c

Log Message:
Decrease timeout from 2 to 1 second. Speeds up the tests where timeout is
the expected case, and it should still be enough to get the looped back
packet.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/tests/net/can/h_canutils.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/tests/net/can/t_can.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/net/can/h_canutils.c
diff -u src/tests/net/can/h_canutils.c:1.1.2.1 src/tests/net/can/h_canutils.c:1.1.2.2
--- src/tests/net/can/h_canutils.c:1.1.2.1	Sat Feb  4 22:26:16 2017
+++ src/tests/net/can/h_canutils.c	Sun Feb  5 11:44:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_canutils.c,v 1.1.2.1 2017/02/04 22:26:16 bouyer Exp $	*/
+/*	$NetBSD: h_canutils.c,v 1.1.2.2 2017/02/05 11:44:17 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.1 2017/02/04 22:26:16 bouyer Exp $");
+__RCSID("$NetBSD: h_canutils.c,v 1.1.2.2 2017/02/05 11:44:17 bouyer Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -100,8 +100,8 @@ can_recvfrom(int s, struct can_frame *cf
 	memset(cf,  0, sizeof(struct can_frame));
 	FD_ZERO(&rfds);
 	FD_SET(s, &rfds);
-	/* we should receive no message; wait for 2 seconds */
-	tmout.tv_sec = 2;
+	/* wait 1 second for the message (in some tests we expect no message) */
+	tmout.tv_sec = 1;
 	tmout.tv_usec = 0;
 	rv = rump_sys_select(s + 1, &rfds, NULL, NULL, &tmout);
 	switch(rv) {
@@ -138,8 +138,8 @@ can_read(int s, struct can_frame *cf, in
 	memset(cf,  0, sizeof(struct can_frame));
 	FD_ZERO(&rfds);
 	FD_SET(s, &rfds);
-	/* we should receive no message; wait for 2 seconds */
-	tmout.tv_sec = 2;
+	/* wait 1 second for the message (in some tests we expect no message) */
+	tmout.tv_sec = 1;
 	tmout.tv_usec = 0;
 	rv = rump_sys_select(s + 1, &rfds, NULL, NULL, &tmout);
 	switch(rv) {

Index: src/tests/net/can/t_can.c
diff -u src/tests/net/can/t_can.c:1.1.2.3 src/tests/net/can/t_can.c:1.1.2.4
--- src/tests/net/can/t_can.c:1.1.2.3	Sat Feb  4 22:26:16 2017
+++ src/tests/net/can/t_can.c	Sun Feb  5 11:44:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_can.c,v 1.1.2.3 2017/02/04 22:26:16 bouyer Exp $	*/
+/*	$NetBSD: t_can.c,v 1.1.2.4 2017/02/05 11:44:17 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.3 2017/02/04 22:26:16 bouyer Exp $");
+__RCSID("$NetBSD: t_can.c,v 1.1.2.4 2017/02/05 11:44:17 bouyer Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -835,8 +835,8 @@ ATF_TC_BODY(cannoloop, tc)
 	FD_ZERO(&rfds);
 	FD_SET(s1, &rfds);
 	FD_SET(s2, &rfds);
-	/* we should receive no message; wait for 2 seconds */
-	tmout.tv_sec = 2;
+	/* we should receive no message; wait for 1 seconds */
+	tmout.tv_sec = 1;
 	tmout.tv_usec = 0;
 	rv1 = rump_sys_select(MAX(s1,s2) + 1, &rfds, NULL, NULL, &tmout);
 	switch(rv1) {

Reply via email to