Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3] Rewrite process_vm_readv02.c test with new LTP API
Date: Wed, 26 Jan 2022 15:40:25 +0100	[thread overview]
Message-ID: <YfFdWaqX1kWGmGyz@yuki> (raw)
In-Reply-To: <20220126091435.16022-1-andrea.cervesato@suse.de>

Hi!
Pushed with three minor fixes, thanks.

* Fixed the munmap() size
* Fixed the documentation comment header
* Made use of tst_strstatus()

Full diff:

diff --git a/testcases/kernel/syscalls/cma/process_vm_readv02.c b/testcases/kernel/syscalls/cma/process_vm_readv02.c
index ed905a735..2bd66a49f 100644
--- a/testcases/kernel/syscalls/cma/process_vm_readv02.c
+++ b/testcases/kernel/syscalls/cma/process_vm_readv02.c
@@ -5,7 +5,7 @@
  * Copyright (C) 2021 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com>
  */

-/* \
+/*\
  * [Description]
  *
  * Fork two children, one child allocates memory and initializes it;
@@ -73,7 +73,7 @@ static void setup(void)
 static void cleanup(void)
 {
        if (data_ptr)
-               SAFE_MUNMAP(data_ptr, BUFSIZ);
+               SAFE_MUNMAP(data_ptr, sizeof(uintptr_t));
 }

 static void run(void)
@@ -104,14 +104,14 @@ static void run(void)
        /* wait until child_invoke reads from child_alloc's VM */
        SAFE_WAITPID(pid_invoke, &status, 0);
        if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
-               tst_res(TFAIL, "child 1: returns %d", status);
+               tst_res(TFAIL, "child 1: %s", tst_strstatus(status));

        /* child_alloc is free to exit now */
        TST_CHECKPOINT_WAKE(0);

        SAFE_WAITPID(pid_alloc, &status, 0);
        if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
-               tst_res(TFAIL, "child 0: returns %d", status);
+               tst_res(TFAIL, "child 0: %s", tst_strstatus(status));
 }


-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2022-01-26 14:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26  9:14 [LTP] [PATCH v3] Rewrite process_vm_readv02.c test with new LTP API Andrea Cervesato
2022-01-26 14:40 ` Cyril Hrubis [this message]

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=YfFdWaqX1kWGmGyz@yuki \
    --to=chrubis@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --cc=ltp@lists.linux.it \
    /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