BPF List
 help / color / mirror / Atom feed
From: Dmitrii Dolgov <9erthalion6@gmail.com>
To: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	andrii@kernel.org, yhs@fb.com, songliubraving@fb.com
Cc: Dmitrii Dolgov <9erthalion6@gmail.com>
Subject: [PATCH bpf-next v2 2/4] selftests/bpf: Fix result check for test_bpf_hash_map
Date: Tue, 10 May 2022 17:52:31 +0200	[thread overview]
Message-ID: <20220510155233.9815-3-9erthalion6@gmail.com> (raw)
In-Reply-To: <20220510155233.9815-1-9erthalion6@gmail.com>

The original condition looks like a typo, verify the skeleton loading
result instead.

Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com>
---
 tools/testing/selftests/bpf/prog_tests/bpf_iter.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_iter.c b/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
index 2c403ddc8076..6943209b7457 100644
--- a/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
@@ -629,8 +629,7 @@ static void test_bpf_hash_map(void)
 	skel->bss->in_test_mode = true;
 
 	err = bpf_iter_bpf_hash_map__load(skel);
-	if (CHECK(!skel, "bpf_iter_bpf_hash_map__load",
-		  "skeleton load failed\n"))
+	if (!ASSERT_OK(err, "bpf_iter_bpf_hash_map__load"))
 		goto out;
 
 	/* iterator with hashmap2 and hashmap3 should fail */
-- 
2.32.0


  parent reply	other threads:[~2022-05-10 15:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 15:52 [PATCH bpf-next v2 0/4] bpf: bpf link iterator Dmitrii Dolgov
2022-05-10 15:52 ` [PATCH bpf-next v2 1/4] bpf: Add bpf_link iterator Dmitrii Dolgov
2022-05-10 15:52 ` Dmitrii Dolgov [this message]
2022-05-10 15:52 ` [PATCH bpf-next v2 3/4] selftests/bpf: Use ASSERT_* instead of CHECK Dmitrii Dolgov
2022-05-10 15:52 ` [PATCH bpf-next v2 4/4] selftests/bpf: Add bpf link iter test Dmitrii Dolgov
2022-05-10 18:30 ` [PATCH bpf-next v2 0/4] bpf: bpf link iterator patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220510155233.9815-3-9erthalion6@gmail.com \
    --to=9erthalion6@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox