[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20150122170115.6a75520e@holzheu>
Date: Thu, 22 Jan 2015 17:01:15 +0100
From: Michael Holzheu <holzheu@...ux.vnet.ibm.com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] samples/bpf: Fix test_maps/bpf_get_next_key() test
Looks like the "test_maps" test case expects to get the keys in
the wrong order when iterating over the elements:
test_maps: samples/bpf/test_maps.c:79: test_hashmap_sanity: Assertion
`bpf_get_next_key(map_fd, &key, &next_key) == 0 && next_key == 2' failed.
Aborted
Fix this and test for the correct order.
Signed-off-by: Michael Holzheu <holzheu@...ux.vnet.ibm.com>
---
samples/bpf/test_maps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/samples/bpf/test_maps.c
+++ b/samples/bpf/test_maps.c
@@ -69,9 +69,9 @@ static void test_hashmap_sanity(int i, v
/* iterate over two elements */
assert(bpf_get_next_key(map_fd, &key, &next_key) == 0 &&
- next_key == 2);
- assert(bpf_get_next_key(map_fd, &next_key, &next_key) == 0 &&
next_key == 1);
+ assert(bpf_get_next_key(map_fd, &next_key, &next_key) == 0 &&
+ next_key == 2);
assert(bpf_get_next_key(map_fd, &next_key, &next_key) == -1 &&
errno == ENOENT);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists