Re: [PATCH bpf-next v2 01/13] selftests/bpf: add a macro to compare raw memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/14, Alexis Lothoré (eBPF Foundation) wrote:
> 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
> [...]
> 
> Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@xxxxxxxxxxx>

Acked-by: Stanislav Fomichev <sdf@xxxxxxxxxxx>




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux