All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kodanev <alexey.kodanev@oracle.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v9 6/8] lib6/getaddrinfo_01.c: Cleanup
Date: Tue, 20 Oct 2015 11:07:48 +0300	[thread overview]
Message-ID: <5625F654.7090602@oracle.com> (raw)
In-Reply-To: <1444810884-32508-6-git-send-email-zenglg.jy@cn.fujitsu.com>

Hi,
On 10/14/2015 11:21 AM, Zeng Linggang wrote:
> * Add 'static' before some functions and global variables.
> * Remove cleanup() function.
> * Remove useless comments.
> * In every test function, using TINFO instead of TPASS
>    marks the success of each inner test.
> * Some cleanup.

Sorry for delay, I was going to push the patch-set but encountered with 
a lot of warnings produced by checkpatch utility. Basically, they are 
all because of either "else is not generally usefull after break or 
return" or "quoted string split across lines". Then I noted that 
test-cases there have wrong structure, comments are below.

Also,
asapi_06.c: "commit description ... possible unwrapped" - you can trim 
commit id a little, it will still be accessable.


>   
> -void gaiv4(void)
> +/* getaddrinfo tests (v4) */
> +static void gaiv4(void)
>   {
>   	struct addrinfo *aires, hints, *pai;
>   	char hostname[MAXHOSTNAMELEN + 1];
> @@ -132,13 +108,18 @@ void gaiv4(void)
>   				 psin ? psin->sin_family : 0,
>   				 psin ? psin->sin_port : 0,
>   				 psin ? htons(psin->sin_port) : 0);
> -		} else
> -			tst_resm(TPASS, "getaddrinfo IPv4 basic lookup");
> -		freeaddrinfo(aires);
> -	} else
> -		tst_resm(TEST_RETURN ? TFAIL : TPASS, "getaddrinfo IPv4 basic "
> +			freeaddrinfo(aires);
> +			return;
> +		} else {
> +			tst_resm(TINFO, "getaddrinfo IPv4 basic lookup");
> +			freeaddrinfo(aires);
> +		}
> +	} else {
> +		tst_resm(TFAIL, "getaddrinfo IPv4 basic "
>   			 "lookup (\"%s\") returns %ld (\"%s\")", hostname,
>   			 TEST_RETURN, gai_strerror(TEST_RETURN));
> +		return;
> +	}
>   

If you write the description of the particular test-case before the 
test, you don't need to repeat the same description in each TPASS/TFAIL 
messages after. Test-case should end with either TPASS or TFAIL, not 
TINFO. Therefore all test-cases below could be something like this:

tst_resm(TINFO, "getaddrinfo IPv4 basic lookup");
TEST(...);
if (!TEST_RETURN) {
     if (error) {
         tst_resm(TFAIL, "");
         return;
     }

     tst_resm(TPASS, "test finished");
} else {
     tst_resm(TFAIL, "...");
}

Best regards,
Alexey


  reply	other threads:[~2015-10-20  8:07 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-07 10:47 [LTP] [PATCH v7 1/7] lib6: Remove runcc.* and the testcases that use it Zeng Linggang
2015-10-07 10:47 ` [LTP] [PATCH v7 2/7] SAFE_MACROS: Add socket(), bind(), listen(), connect() and getsockname() Zeng Linggang
2015-10-07 13:07   ` Cyril Hrubis
2015-10-08  1:34     ` Zeng Linggang
2015-10-07 13:28   ` Cyril Hrubis
2015-10-08 11:29     ` [LTP] [PATCH v8 1/7] lib6: Remove runcc.* and the testcases that use it Zeng Linggang
2015-10-08 11:29       ` [LTP] [PATCH v8 2/7] SAFE_MACROS: Add socket(), bind(), listen(), connect() and getsockname() Zeng Linggang
2015-10-13 10:45         ` Alexey Kodanev
2015-10-14  6:27           ` Zeng Linggang
2015-10-14  8:21           ` [LTP] [PATCH v9 1/8] lib6: Remove runcc.* and the testcases that use it Zeng Linggang
2015-10-14  8:21             ` [LTP] [PATCH v9 2/8] SAFE_MACROS: Add socket(), bind(), listen(), connect() and getsockname() Zeng Linggang
2015-10-14  8:21             ` [LTP] [PATCH v9 3/8] lib6/asapi_04.c: Cleanup Zeng Linggang
2015-10-14  8:21             ` [LTP] [PATCH v9 4/8] lib6/asapi_05.c: Cleanup Zeng Linggang
2015-10-14  8:21             ` [LTP] [PATCH v9 5/8] lib6/asapi_06.c: Cleanup Zeng Linggang
2015-10-14  8:21             ` [LTP] [PATCH v9 6/8] lib6/getaddrinfo_01.c: Cleanup Zeng Linggang
2015-10-20  8:07               ` Alexey Kodanev [this message]
2015-10-21  2:47                 ` Zeng Linggang
2015-10-21  3:15                 ` [LTP] [PATCH v10 1/8] lib6: Remove runcc.* and the testcases that use it Zeng Linggang
2015-10-21  3:15                   ` [LTP] [PATCH v10 2/8] SAFE_MACROS: Add socket(), bind(), listen(), connect() and getsockname() Zeng Linggang
2015-10-21  3:15                   ` [LTP] [PATCH v10 3/8] lib6/asapi_04.c: Cleanup Zeng Linggang
2015-10-21  3:15                   ` [LTP] [PATCH v10 4/8] lib6/asapi_05.c: Cleanup Zeng Linggang
2015-10-21  3:15                   ` [LTP] [PATCH v10 5/8] lib6/asapi_06.c: Cleanup Zeng Linggang
2015-10-21  3:15                   ` [LTP] [PATCH v10 6/8] lib6/getaddrinfo_01.c: Cleanup Zeng Linggang
2015-10-21  3:15                   ` [LTP] [PATCH v10 7/8] lib6: Rename Zeng Linggang
2015-10-21  3:15                   ` [LTP] [PATCH v10 8/8] ipv6_lib: Add it into default Zeng Linggang
2015-10-22 11:12                   ` [LTP] [PATCH v10 1/8] lib6: Remove runcc.* and the testcases that use it Alexey Kodanev
2015-10-14  8:21             ` [LTP] [PATCH v9 7/8] lib6: Rename Zeng Linggang
2015-10-14  8:21             ` [LTP] [PATCH v9 8/8] ipv6_lib: Add it into default Zeng Linggang
2015-10-08 11:29       ` [LTP] [PATCH v8 3/7] lib6/asapi_04.c: Cleanup Zeng Linggang
2015-10-08 11:29       ` [LTP] [PATCH v8 4/7] lib6/asapi_05.c: Cleanup Zeng Linggang
2015-10-08 11:29       ` [LTP] [PATCH v8 5/7] lib6/asapi_06.c: Cleanup Zeng Linggang
2015-10-08 11:29       ` [LTP] [PATCH v8 6/7] lib6/getaddrinfo_01.c: Cleanup Zeng Linggang
2015-10-08 11:29       ` [LTP] [PATCH v8 7/7] ipv6_lib: Add it into default Zeng Linggang
2015-10-07 10:47 ` [LTP] [PATCH v7 3/7] lib6/asapi_04.c: Cleanup Zeng Linggang
2015-10-07 10:47 ` [LTP] [PATCH v7 4/7] lib6/asapi_05.c: Cleanup Zeng Linggang
2015-10-07 10:47 ` [LTP] [PATCH v7 5/7] lib6/asapi_06.c: Cleanup Zeng Linggang
2015-10-07 10:47 ` [LTP] [PATCH v7 6/7] lib6/getaddrinfo_01.c: Cleanup Zeng Linggang
2015-10-07 10:47 ` [LTP] [PATCH v7 7/7] ipv6_lib: Add it into default Zeng Linggang

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=5625F654.7090602@oracle.com \
    --to=alexey.kodanev@oracle.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.