Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/net/bpfjit Avoid testing for zero rv in bpfjit_jmp_x_u...
details: https://anonhg.NetBSD.org/src/rev/dda5d91c5938
branches: trunk
changeset: 336152:dda5d91c5938
user: alnsn <alnsn%NetBSD.org@localhost>
date: Sat Feb 14 17:28:19 2015 +0000
description:
Avoid testing for zero rv in bpfjit_jmp_x_uninitialised. Unitialised
X isn't a problem for bpf_validate().
diffstat:
tests/net/bpfjit/t_bpfjit.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diffs (47 lines):
diff -r 548b249ad08a -r dda5d91c5938 tests/net/bpfjit/t_bpfjit.c
--- a/tests/net/bpfjit/t_bpfjit.c Sat Feb 14 16:48:30 2015 +0000
+++ b/tests/net/bpfjit/t_bpfjit.c Sat Feb 14 17:28:19 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_bpfjit.c,v 1.7 2015/02/14 16:48:30 alnsn Exp $ */
+/* $NetBSD: t_bpfjit.c,v 1.8 2015/02/14 17:28:19 alnsn Exp $ */
/*-
* Copyright (c) 2011-2012, 2014 Alexander Nasonov.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_bpfjit.c,v 1.7 2015/02/14 16:48:30 alnsn Exp $");
+__RCSID("$NetBSD: t_bpfjit.c,v 1.8 2015/02/14 17:28:19 alnsn Exp $");
#include <sys/param.h>
#include <sys/mbuf.h>
@@ -2273,8 +2273,8 @@
{
static struct bpf_insn insns[] = {
BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_X, 1, 0, 1),
- BPF_STMT(BPF_RET+BPF_K, 1),
- BPF_STMT(BPF_RET+BPF_K, 0)
+ BPF_STMT(BPF_RET+BPF_K, 11),
+ BPF_STMT(BPF_RET+BPF_K, 10)
};
bpfjit_func_t code;
@@ -2284,15 +2284,14 @@
RZ(rump_init());
- /* X isn't initialised. */
- ATF_CHECK(!prog_validate(insns, insn_count));
+ ATF_CHECK(prog_validate(insns, insn_count));
rump_schedule();
code = rumpns_bpfjit_generate_code(NULL, insns, insn_count);
rump_unschedule();
ATF_REQUIRE(code != NULL);
- ATF_CHECK(jitcall(code, pkt, 1, 1) == 0);
+ ATF_CHECK(jitcall(code, pkt, 1, 1) == 10);
rump_schedule();
rumpns_bpfjit_free_code(code);
Home |
Main Index |
Thread Index |
Old Index