Skip to content

Commit

Permalink
Apply comment suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Dave Thaler <[email protected]>
  • Loading branch information
gtrevi and dthaler authored Dec 11, 2023
1 parent 05d3c30 commit 262bf60
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/unit/libbpf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2775,14 +2775,16 @@ TEST_CASE("BPF_MAP_GET_NEXT_KEY etc.", "[libbpf]")
attr.value = (uintptr_t)&value;
REQUIRE(bpf(BPF_MAP_UPDATE_ELEM, &attr, sizeof(attr)) == 0);
}
// Lookup the first key in the map, so to check it's returned later.

// Look up the first key in the map, so we can check that it's returned later.
memset(&attr, 0, sizeof(attr));
attr.map_fd = map_fd;
attr.key = NULL;
attr.next_key = (uintptr_t)&next_key;
REQUIRE(bpf(BPF_MAP_GET_NEXT_KEY, &attr, sizeof(attr)) == 0);
uint64_t first_key = next_key;
// Lookup a key that is not present in the map, and check that the first key is returned.

// Look up a key that is not present in the map, and check that the first key is returned.
key = 123;
memset(&attr, 0, sizeof(attr));
attr.map_fd = map_fd;
Expand Down

0 comments on commit 262bf60

Please sign in to comment.