Hi,

On 07/15/2014 06:19 PM, [email protected] wrote:
> Hi!
>> If testcase calls tst_brkm(...) to terminate test, usually we need
>> to serch the message outputted by tst_brkm() to locate it in test
>> program, it is inefficient, especially we have multiple same messages,
>> so here we choose to make tst_brkm output extra information about
>> source files and line number. Also make similar change to tst_resm().
>>
>> E.g.:
>> We execute getxattr01 before this patch:
>> [root@localhost getxattr]# ./getxattr01
>> getxattr01    1  TCONF  :  No xattr support in fs or mount without 
>> user_xattr option
>> getxattr01    2  TCONF  :  Remaining cases not appropriate for configuration
>>
>> After this patch:
>> [root@localhost getxattr]# ./getxattr01
>> getxattr01    1  TCONF  :  getxattr01.c:158: No xattr support in fs or mount 
>> without user_xattr option
>> getxattr01    2  TCONF  :  Remaining cases not appropriate for configuration
>>
>> Signed-off-by: Xiaoguang Wang <[email protected]>
>> ---
>>  lib/tst_res.c | 121 
>> ++++++++++++++++++++++++++++------------------------------
>>  1 file changed, 58 insertions(+), 63 deletions(-)
>>
>> diff --git a/lib/tst_res.c b/lib/tst_res.c
>> index 0383c98..d27fdd0 100644
>> --- a/lib/tst_res.c
>> +++ b/lib/tst_res.c
>> @@ -36,12 +36,12 @@
>>   *    OS Testing - Silicon Graphics, Inc.
>>   *
>>   *    FUNCTION NAME     :
>> - *      tst_res() -       Print result message (include file contents)
>> - *      tst_resm() -      Print result message
>> - *      tst_resm_hexd() - Print result message (add buffer contents in hex)
>> - *      tst_brk() -       Print result message (include file contents)
>> + *      tst_res_() -       Print result message (include file contents)
>> + *      tst_resm_() -      Print result message
>> + *      tst_resm_hexd_() - Print result message (add buffer contents in hex)
>> + *      tst_brk_() -       Print result message (include file contents)
>>   *                        and break remaining test cases
>> - *      tst_brkm() -      Print result message and break remaining test
>> + *      tst_brkm_() -      Print result message and break remaining test
>>   *                        cases
>>   *      tst_flush() -     Print any messages pending in the output stream
>>   *      tst_exit() -      Exit test with a meaningful exit value.
>> @@ -49,35 +49,6 @@
>>   *
>>   *    FUNCTION TITLE    : Standard automated test result reporting mechanism
>>   *
>> - *    SYNOPSIS:
>> - *      #include "test.h"
>> - *
>> - *      void tst_res(ttype, fname, tmesg [,arg]...)
>> - *      int  ttype;
>> - *      char *fname;
>> - *      char *tmesg;
>> - *
>> - *      void tst_resm(ttype, tmesg [,arg]...)
>> - *      int  ttype;
>> - *      char *tmesg;
>> - *
>> - *      void tst_brk(ttype, fname, cleanup, tmesg, [,argv]...)
>> - *      int  ttype;
>> - *      char *fname;
>> - *      void (*cleanup)();
>> - *      char *tmesg;
>> - *
>> - *      void tst_brkm(ttype, cleanup, tmesg [,arg]...)
>> - *      int  ttype;
>> +    EXPAND_VAR_ARGS(tmesg + len, arg_fmt, USERMESG);
>                                                ^
>                                              technically this should
>                                              be (USERMESG - len)
> 
> Moreover why do we add the file and line to the buffer here when we can
> pass it to the tst_res_ below and keep only one copy of the code?

Ah, you are right! I'll remove this code redundancy, thanks!

Regards,
Xiaoguang Wang


------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to