diff options
author | Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com> | 2024-11-20 10:43:11 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-12-02 19:41:15 +0300 |
commit | 2fe34a116c707821c99bb352cb33be277c99d491 (patch) | |
tree | b71719c26fcbff82c6377957507d42de0122cf8d /tools/testing/selftests/bpf/prog_tests | |
parent | e70140ba0d2b1a30467d4af6bcfe761327b9ec95 (diff) | |
download | linux-2fe34a116c707821c99bb352cb33be277c99d491.tar.xz |
selftests/bpf: add a macro to compare raw memory
We sometimes need to compare whole structures in an assert. It is
possible to use the existing macros on each field, but when the whole
structure has to be checked, it is more convenient to simply compare the
whole structure memory
Add a dedicated assert macro, ASSERT_MEMEQ, to allow bare memory
comparision
The output generated by this new macro looks like the following:
[...]
run_tests_skb_less:FAIL:returned flow keys unexpected memory mismatch
actual:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
expected:
0E 00 3E 00 DD 86 01 01 00 06 86 DD 50 00 90 1F
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
01 00 00 00 00 00 00 00
[...]
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Link: https://lore.kernel.org/r/20241120-flow_dissector-v3-1-45b46494f937@bootlin.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests')
0 files changed, 0 insertions, 0 deletions