public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 1/2] remove meaningless TRETR flag
Date: Tue, 15 Jul 2014 11:59:29 +0200	[thread overview]
Message-ID: <20140715095929.GA27102@rei> (raw)
In-Reply-To: <1404985422-6546-1-git-send-email-wangxg.fnst@cn.fujitsu.com>

Hi!
> diff --git a/include/test.h b/include/test.h
> index 011866d..2013a36 100644
> --- a/include/test.h
> +++ b/include/test.h
> @@ -118,16 +118,42 @@ extern int Forker_npids;
>  
>  /* lib/tst_res.c */
>  const char *strttype(int ttype);
> -void tst_res(int ttype, const char *fname, const char *arg_fmt, ...)
> -	__attribute__ ((format (printf, 3, 4)));
> -void tst_resm(int ttype, const char *arg_fmt, ...)
> -	__attribute__ ((format (printf, 2, 3)));
> -void tst_resm_hexd(int ttype, const void *buf, size_t size, const char *arg_fmt, ...)
> -	__attribute__ ((format (printf, 4, 5)));
> -void tst_brk(int ttype, const char *fname, void (*func)(void), const char *arg_fmt, ...)
> +void tst_res_(const char *file, const int lineno, int ttype,
> +	const char *fname, const char *arg_fmt, ...)
> +	__attribute__ ((format (printf, 5, 6)));
> +
> +#define tst_res(ttype, fname, arg_fmt, ...) \
> +	tst_res_(__FILE__, __LINE__, (ttype), (fname), \
> +		 (arg_fmt), ##__VA_ARGS__)
> +
> +void tst_resm_(const char *file, const int lineno, int ttype,
> +	const char *arg_fmt, ...)
>  	__attribute__ ((format (printf, 4, 5)));
> -void tst_brkm(int ttype, void (*func)(void), const char *arg_fmt, ...)
> -	__attribute__ ((format (printf, 3, 4))) LTP_ATTRIBUTE_NORETURN;
> +#define tst_resm(ttype, arg_fmt, ...) \
> +	tst_resm_(__FILE__, __LINE__, (ttype), \
> +		  (arg_fmt), ##__VA_ARGS__)
> +
> +void tst_resm_hexd_(const char *file, const int lineno, int ttype,
> +	const void *buf, size_t size, const char *arg_fmt, ...)
> +	__attribute__ ((format (printf, 6, 7)));
> +#define tst_resm_hexd(ttype, buf, size, arg_fmt, ...) \
> +	tst_resm_hexd_(__FILE__, __LINE__, (ttype), (buf), (size), \
> +		       (arg_fmt), ##__VA_ARGS__)
> +
> +void tst_brk_(const char *file, const int lineno, int ttype,
> +	const char *fname, void (*func)(void), const char *arg_fmt, ...)
> +	__attribute__ ((format (printf, 6, 7)));
> +#define tst_brk(ttype, fname, func, arg_fmt, ...) \
> +	tst_brk_(__FILE__, __LINE__, (ttype), (fname), (func), \
> +		 (arg_fmt), ##__VA_ARGS__)
> +
> +void tst_brkm_(const char *file, const int lineno, int ttype,
> +	void (*func)(void), const char *arg_fmt, ...)
> +	__attribute__ ((format (printf, 5, 6))) LTP_ATTRIBUTE_NORETURN;
> +#define tst_brkm(ttype, func, arg_fmt, ...) \
> +	tst_brkm_(__FILE__, __LINE__, (ttype), (func), \
> +		  (arg_fmt), ##__VA_ARGS__)
> +
>  void tst_require_root(void (*func)(void));
>  int  tst_environ(void);
>  void tst_exit(void) LTP_ATTRIBUTE_NORETURN;

This changes should be part of the next patch.

> diff --git a/include/tst_res_flags.h b/include/tst_res_flags.h
> index 5c5ab4c..bb1bfd6 100644
> --- a/include/tst_res_flags.h
> +++ b/include/tst_res_flags.h
> @@ -12,14 +12,13 @@
>  #define TST_RES_FLAGS_H
>  
>  /* Use low 6 bits to encode test type */
> -#define TTYPE_MASK	0x3f
> +#define TTYPE_MASK	0x1f
>  #define TPASS	0	/* Test passed flag */
>  #define TFAIL	1	/* Test failed flag */
>  #define TBROK	2	/* Test broken flag */
>  #define TWARN	4	/* Test warning flag */
> -#define TRETR	8	/* Test retire flag */
> -#define TINFO	16	/* Test information flag */
> -#define TCONF	32	/* Test not appropriate for configuration flag */
> +#define TINFO	8	/* Test information flag */
> +#define TCONF	16	/* Test not appropriate for configuration flag */
>  #define TTYPE_RESULT(ttype)	((ttype) & TTYPE_MASK)

Hmm, I would avoid renumbering these flags for compatibility reasons. Or
is there a good reason not to have unused bit there?


The rest looks ok.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

      parent reply	other threads:[~2014-07-15  9:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-10  9:43 [LTP] [PATCH 1/2] remove meaningless TRETR flag Xiaoguang Wang
2014-07-10  9:43 ` [LTP] [PATCH 2/2] lib/tst_res.c: make tst_brkm() and tst_resm() output more informative message Xiaoguang Wang
2014-07-10  9:51   ` Xiaoguang Wang
2014-07-15 10:19   ` chrubis
2014-07-15  9:59 ` chrubis [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=20140715095929.GA27102@rei \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=wangxg.fnst@cn.fujitsu.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