Re: [PATCH bpf v2 2/2] bpf/selftests: test that kernel rejects a TCP CC with an invalid license
From: Toke Høiland-Jørgensen <hidden>
Date: 2021-03-26 18:26:49
Also in:
bpf
From: Toke Høiland-Jørgensen <hidden>
Date: 2021-03-26 18:26:49
Also in:
bpf
Andrii Nakryiko [off-list ref] writes:
quoted
Ah, thanks! I always get confused about CHECK() as well! Maybe it should be renamed to ASSERT()? But that would require flipping all the if() statements around them as well :/Exactly, it's the opposite of assert (ASSERT_NOT %-), that CHECK(!found) is "assert not not found", right?) and it throws me off every. single. time.
Yup, me too, I have to basically infer the right meaning from the surrounding if statements (i.e., whether it triggers an error path or not).
Ideally we complete the set of ASSERT_XXX() macros and convert as much as possible to that. We can also have just generic ASSERT() for all other complicated cases.
Totally on board with that! I'll try to remember to fix any selftests I fiddle with (and not introduce any new uses of CHECK() of course). -Toke