Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libbpfjit Rename bpfjit tests to libbpfjit, don't ...
details: https://anonhg.NetBSD.org/src/rev/7e589827b4a2
branches: trunk
changeset: 330438:7e589827b4a2
user: alnsn <alnsn%NetBSD.org@localhost>
date: Tue Jul 08 21:07:52 2014 +0000
description:
Rename bpfjit tests to libbpfjit, don't test zero buflen and a couple of
cosmetic changes.
diffstat:
tests/lib/libbpfjit/t_bpfjit.c | 720 ++++++++++++++++++++--------------------
1 files changed, 362 insertions(+), 358 deletions(-)
diffs (truncated from 1831 to 300 lines):
diff -r cae22d242aa7 -r 7e589827b4a2 tests/lib/libbpfjit/t_bpfjit.c
--- a/tests/lib/libbpfjit/t_bpfjit.c Tue Jul 08 19:35:36 2014 +0000
+++ b/tests/lib/libbpfjit/t_bpfjit.c Tue Jul 08 21:07:52 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_bpfjit.c,v 1.5 2014/06/24 10:53:30 alnsn Exp $ */
+/* $NetBSD: t_bpfjit.c,v 1.6 2014/07/08 21:07:52 alnsn Exp $ */
/*-
* Copyright (c) 2011-2012, 2014 Alexander Nasonov.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_bpfjit.c,v 1.5 2014/06/24 10:53:30 alnsn Exp $");
+__RCSID("$NetBSD: t_bpfjit.c,v 1.6 2014/07/08 21:07:52 alnsn Exp $");
#include <atf-c.h>
#include <stdint.h>
@@ -56,28 +56,28 @@
return fn(NULL, &args);
}
-ATF_TC(bpfjit_empty);
-ATF_TC_HEAD(bpfjit_empty, tc)
+ATF_TC(libbpfjit_empty);
+ATF_TC_HEAD(libbpfjit_empty, tc)
{
atf_tc_set_md_var(tc, "descr",
- "Test that JIT compilation for an empty bpf program fails");
+ "Test that JIT compilation of an empty bpf program fails");
}
-ATF_TC_BODY(bpfjit_empty, tc)
+ATF_TC_BODY(libbpfjit_empty, tc)
{
struct bpf_insn dummy;
ATF_CHECK(bpfjit_generate_code(NULL, &dummy, 0) == NULL);
}
-ATF_TC(bpfjit_alu_add_k);
-ATF_TC_HEAD(bpfjit_alu_add_k, tc)
+ATF_TC(libbpfjit_alu_add_k);
+ATF_TC_HEAD(libbpfjit_alu_add_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_ADD+BPF_K");
}
-ATF_TC_BODY(bpfjit_alu_add_k, tc)
+ATF_TC_BODY(libbpfjit_alu_add_k, tc)
{
static struct bpf_insn insns[] = {
BPF_STMT(BPF_LD+BPF_IMM, 3),
@@ -100,14 +100,14 @@
bpfjit_free_code(code);
}
-ATF_TC(bpfjit_alu_sub_k);
-ATF_TC_HEAD(bpfjit_alu_sub_k, tc)
+ATF_TC(libbpfjit_alu_sub_k);
+ATF_TC_HEAD(libbpfjit_alu_sub_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_SUB+BPF_K");
}
-ATF_TC_BODY(bpfjit_alu_sub_k, tc)
+ATF_TC_BODY(libbpfjit_alu_sub_k, tc)
{
static struct bpf_insn insns[] = {
BPF_STMT(BPF_LD+BPF_IMM, 1),
@@ -130,14 +130,14 @@
bpfjit_free_code(code);
}
-ATF_TC(bpfjit_alu_mul_k);
-ATF_TC_HEAD(bpfjit_alu_mul_k, tc)
+ATF_TC(libbpfjit_alu_mul_k);
+ATF_TC_HEAD(libbpfjit_alu_mul_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_MUL+BPF_K");
}
-ATF_TC_BODY(bpfjit_alu_mul_k, tc)
+ATF_TC_BODY(libbpfjit_alu_mul_k, tc)
{
static struct bpf_insn insns[] = {
BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0xffffffff)),
@@ -160,14 +160,14 @@
bpfjit_free_code(code);
}
-ATF_TC(bpfjit_alu_div0_k);
-ATF_TC_HEAD(bpfjit_alu_div0_k, tc)
+ATF_TC(libbpfjit_alu_div0_k);
+ATF_TC_HEAD(libbpfjit_alu_div0_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=0");
}
-ATF_TC_BODY(bpfjit_alu_div0_k, tc)
+ATF_TC_BODY(libbpfjit_alu_div0_k, tc)
{
static struct bpf_insn insns[] = {
BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 0),
@@ -189,14 +189,14 @@
bpfjit_free_code(code);
}
-ATF_TC(bpfjit_alu_div1_k);
-ATF_TC_HEAD(bpfjit_alu_div1_k, tc)
+ATF_TC(libbpfjit_alu_div1_k);
+ATF_TC_HEAD(libbpfjit_alu_div1_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=1");
}
-ATF_TC_BODY(bpfjit_alu_div1_k, tc)
+ATF_TC_BODY(libbpfjit_alu_div1_k, tc)
{
static struct bpf_insn insns[] = {
BPF_STMT(BPF_LD+BPF_IMM, 7),
@@ -219,14 +219,14 @@
bpfjit_free_code(code);
}
-ATF_TC(bpfjit_alu_div2_k);
-ATF_TC_HEAD(bpfjit_alu_div2_k, tc)
+ATF_TC(libbpfjit_alu_div2_k);
+ATF_TC_HEAD(libbpfjit_alu_div2_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=2");
}
-ATF_TC_BODY(bpfjit_alu_div2_k, tc)
+ATF_TC_BODY(libbpfjit_alu_div2_k, tc)
{
static struct bpf_insn insns[] = {
BPF_STMT(BPF_LD+BPF_IMM, 7),
@@ -249,14 +249,14 @@
bpfjit_free_code(code);
}
-ATF_TC(bpfjit_alu_div4_k);
-ATF_TC_HEAD(bpfjit_alu_div4_k, tc)
+ATF_TC(libbpfjit_alu_div4_k);
+ATF_TC_HEAD(libbpfjit_alu_div4_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=4");
}
-ATF_TC_BODY(bpfjit_alu_div4_k, tc)
+ATF_TC_BODY(libbpfjit_alu_div4_k, tc)
{
static struct bpf_insn insns[] = {
BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0xffffffff)),
@@ -279,14 +279,14 @@
bpfjit_free_code(code);
}
-ATF_TC(bpfjit_alu_div10_k);
-ATF_TC_HEAD(bpfjit_alu_div10_k, tc)
+ATF_TC(libbpfjit_alu_div10_k);
+ATF_TC_HEAD(libbpfjit_alu_div10_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=10");
}
-ATF_TC_BODY(bpfjit_alu_div10_k, tc)
+ATF_TC_BODY(libbpfjit_alu_div10_k, tc)
{
static struct bpf_insn insns[] = {
BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294843849)),
@@ -309,14 +309,14 @@
bpfjit_free_code(code);
}
-ATF_TC(bpfjit_alu_div10000_k);
-ATF_TC_HEAD(bpfjit_alu_div10000_k, tc)
+ATF_TC(libbpfjit_alu_div10000_k);
+ATF_TC_HEAD(libbpfjit_alu_div10000_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=10000");
}
-ATF_TC_BODY(bpfjit_alu_div10000_k, tc)
+ATF_TC_BODY(libbpfjit_alu_div10000_k, tc)
{
static struct bpf_insn insns[] = {
BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294843849)),
@@ -339,14 +339,14 @@
bpfjit_free_code(code);
}
-ATF_TC(bpfjit_alu_div7609801_k);
-ATF_TC_HEAD(bpfjit_alu_div7609801_k, tc)
+ATF_TC(libbpfjit_alu_div7609801_k);
+ATF_TC_HEAD(libbpfjit_alu_div7609801_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=7609801");
}
-ATF_TC_BODY(bpfjit_alu_div7609801_k, tc)
+ATF_TC_BODY(libbpfjit_alu_div7609801_k, tc)
{
static struct bpf_insn insns[] = {
BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(4294967295)),
@@ -369,14 +369,14 @@
bpfjit_free_code(code);
}
-ATF_TC(bpfjit_alu_div80000000_k);
-ATF_TC_HEAD(bpfjit_alu_div80000000_k, tc)
+ATF_TC(libbpfjit_alu_div80000000_k);
+ATF_TC_HEAD(libbpfjit_alu_div80000000_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_DIV+BPF_K with k=0x80000000");
}
-ATF_TC_BODY(bpfjit_alu_div80000000_k, tc)
+ATF_TC_BODY(libbpfjit_alu_div80000000_k, tc)
{
static struct bpf_insn insns[] = {
BPF_STMT(BPF_LD+BPF_IMM, UINT32_C(0xffffffde)),
@@ -399,14 +399,14 @@
bpfjit_free_code(code);
}
-ATF_TC(bpfjit_alu_and_k);
-ATF_TC_HEAD(bpfjit_alu_and_k, tc)
+ATF_TC(libbpfjit_alu_and_k);
+ATF_TC_HEAD(libbpfjit_alu_and_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_AND+BPF_K");
}
-ATF_TC_BODY(bpfjit_alu_and_k, tc)
+ATF_TC_BODY(libbpfjit_alu_and_k, tc)
{
static struct bpf_insn insns[] = {
BPF_STMT(BPF_LD+BPF_IMM, 0xdead),
@@ -429,14 +429,14 @@
bpfjit_free_code(code);
}
-ATF_TC(bpfjit_alu_or_k);
-ATF_TC_HEAD(bpfjit_alu_or_k, tc)
+ATF_TC(libbpfjit_alu_or_k);
+ATF_TC_HEAD(libbpfjit_alu_or_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_OR+BPF_K");
}
-ATF_TC_BODY(bpfjit_alu_or_k, tc)
+ATF_TC_BODY(libbpfjit_alu_or_k, tc)
{
static struct bpf_insn insns[] = {
BPF_STMT(BPF_LD+BPF_IMM, 0xdead0000),
@@ -459,14 +459,14 @@
bpfjit_free_code(code);
}
-ATF_TC(bpfjit_alu_lsh_k);
-ATF_TC_HEAD(bpfjit_alu_lsh_k, tc)
+ATF_TC(libbpfjit_alu_lsh_k);
+ATF_TC_HEAD(libbpfjit_alu_lsh_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_LSH+BPF_K");
}
-ATF_TC_BODY(bpfjit_alu_lsh_k, tc)
+ATF_TC_BODY(libbpfjit_alu_lsh_k, tc)
{
static struct bpf_insn insns[] = {
BPF_STMT(BPF_LD+BPF_IMM, 0xdeadbeef),
@@ -489,14 +489,14 @@
bpfjit_free_code(code);
}
-ATF_TC(bpfjit_alu_lsh0_k);
-ATF_TC_HEAD(bpfjit_alu_lsh0_k, tc)
+ATF_TC(libbpfjit_alu_lsh0_k);
+ATF_TC_HEAD(libbpfjit_alu_lsh0_k, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test JIT compilation of BPF_ALU+BPF_LSH+BPF_K with k=0");
}
Home |
Main Index |
Thread Index |
Old Index