Hi!
> When testcase is killed by unexpected signal, usually it just prints
> signal's value.
>       fcntl30     1  TBROK  :  unexpected signal 2 received (pid = 6714).
>       fcntl30     2  TBROK  :  Remaining cases broken
> 
> Here we also print signal's name to output more informative message.
>       fcntl30     1  TBROK  :  unexpected signal SIGINT(2) received (pid = 
> 9872).
>       fcntl30     2  TBROK  :  Remaining cases broken

Please add a note about the two new tst_ functions here as well,
something as:

This also adds two new tst_ functions to convert errno or signal to its
name.

const char *tst_strsig(int sig) returns signal name given signal number

const char *tst_strerrno(int err) returns errno name given errno number

> +const char *tst_strsig(int sig)
> +{
> +     static const struct pair signal_pairs[] = {
> +             STRPAIR(SIGHUP, "SIGHUP")
> +             STRPAIR(SIGINT, "SIGINT")
> +             STRPAIR(SIGQUIT, "SIGQUIT")
> +             STRPAIR(SIGILL, "SIGILL")
> +     #ifdef SIGTRAP
> +             STRPAIR(SIGTRAP, "SIGTRAP")
> +     #endif
> +
> +     #ifdef SIGIOT
> +             /* SIGIOT same as SIGABRT */
> +             STRPAIR(SIGABRT, "SIGIOT/SIGABRT")
> +     #else
> +             STRPAIR(SIGABRT, "SIGABRT")
> +     #endif
> +
> +     #ifdef SIGEMT
> +             STRPAIR(SIGEMT, "SIGEMT")
> +     #endif
> +     #ifdef SIGBUS
> +             STRPAIR(SIGBUS, "SIGBUS")
> +     #endif
> +             STRPAIR(SIGFPE, "SIGFPE")
> +             STRPAIR(SIGKILL, "SIGKILL")
> +             STRPAIR(SIGUSR1, "SIGUSR1")
> +             STRPAIR(SIGSEGV, "SIGSEGV")
> +             STRPAIR(SIGUSR2, "SIGUSR2")
> +             STRPAIR(SIGPIPE, "SIGPIPE")
> +             STRPAIR(SIGALRM, "SIGALRM")
> +             STRPAIR(SIGTERM, "SIGTERM")

Ah, I wasn't clear enough, I guess, sorry.

What I had in mind was to use STRPAIR() in cases that the string is different
from the symbolic name and use PAIR() in the rest of the cases.

I.e. use STRPAIR(SIGABRT, "SIGIOT/SIGABRT") but PAIR(SIGEMT).

> +#define STRPAIR(key, value)  {.val = (key), .name = (value)},

This would be:

#define STRPAIR(key, value) [key] = {.name = value, .val = key}

Then you can mix PAIR() with STRPAIR() and use PARI_LOOKUP().

-- 
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to