Fix tst-strcoll-overflow returning before timeout (BZ #17506)
Modifies the test examination in test-skeleton.c so that a test can be successful if it is interrupted or it returns uninterrupted with the expected status. For this both EXPECTED_SIGNAL and EXPECTED_STATUS have to be set, as is done in tst-strcoll-overflow.c.
This commit is contained in:
parent
fb89b46d1d
commit
fffa1cf8a7
|
@ -1,3 +1,10 @@
|
||||||
|
2014-11-12 Leonhard Holz <leonhard.holz@web.de>
|
||||||
|
|
||||||
|
[BZ #17506]
|
||||||
|
* test-skeleton.c (main): Return successful if one of
|
||||||
|
EXPECTED_SIGNAL or EXPECTED_STATUS is met when both given.
|
||||||
|
* string/tst-strcoll-overflow.c: Define expected status.
|
||||||
|
|
||||||
2014-11-12 Tatiana Udalova <t.udalova@samsung.com>
|
2014-11-12 Tatiana Udalova <t.udalova@samsung.com>
|
||||||
|
|
||||||
[BZ #17475]
|
[BZ #17475]
|
||||||
|
|
3
NEWS
3
NEWS
|
@ -10,7 +10,8 @@ Version 2.21
|
||||||
* The following bugs are resolved with this release:
|
* The following bugs are resolved with this release:
|
||||||
|
|
||||||
6652, 12926, 14132, 14138, 14171, 15215, 15884, 17266, 17344, 17363,
|
6652, 12926, 14132, 14138, 14171, 15215, 15884, 17266, 17344, 17363,
|
||||||
17370, 17371, 17411, 17460, 17475, 17485, 17501, 17508, 17522, 17555.
|
17370, 17371, 17411, 17460, 17475, 17485, 17501, 17506, 17508, 17522,
|
||||||
|
17555.
|
||||||
|
|
||||||
* New locales: tu_IN, bh_IN.
|
* New locales: tu_IN, bh_IN.
|
||||||
|
|
||||||
|
|
|
@ -57,5 +57,6 @@ do_test (void)
|
||||||
|
|
||||||
#define TIMEOUT 300
|
#define TIMEOUT 300
|
||||||
#define EXPECTED_SIGNAL SIGALRM
|
#define EXPECTED_SIGNAL SIGALRM
|
||||||
|
#define EXPECTED_STATUS 0
|
||||||
#define TEST_FUNCTION do_test ()
|
#define TEST_FUNCTION do_test ()
|
||||||
#include "../test-skeleton.c"
|
#include "../test-skeleton.c"
|
||||||
|
|
|
@ -383,39 +383,46 @@ main (int argc, char *argv[])
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef EXPECTED_SIGNAL
|
/* Process terminated normaly without timeout etc. */
|
||||||
/* We don't expect any signal. */
|
if (WIFEXITED (status))
|
||||||
# define EXPECTED_SIGNAL 0
|
|
||||||
#endif
|
|
||||||
if (WTERMSIG (status) != EXPECTED_SIGNAL)
|
|
||||||
{
|
{
|
||||||
if (EXPECTED_SIGNAL != 0)
|
|
||||||
{
|
|
||||||
if (WTERMSIG (status) == 0)
|
|
||||||
printf ("Expected signal '%s' from child, got none\n",
|
|
||||||
strsignal (EXPECTED_SIGNAL));
|
|
||||||
else
|
|
||||||
printf ("Incorrect signal from child: got `%s', need `%s'\n",
|
|
||||||
strsignal (WTERMSIG (status)),
|
|
||||||
strsignal (EXPECTED_SIGNAL));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
printf ("Didn't expect signal from child: got `%s'\n",
|
|
||||||
strsignal (WTERMSIG (status)));
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Simply exit with the return value of the test. */
|
|
||||||
#ifndef EXPECTED_STATUS
|
#ifndef EXPECTED_STATUS
|
||||||
return WEXITSTATUS (status);
|
# ifndef EXPECTED_SIGNAL
|
||||||
#else
|
/* Simply exit with the return value of the test. */
|
||||||
if (WEXITSTATUS (status) != EXPECTED_STATUS)
|
return WEXITSTATUS (status);
|
||||||
{
|
# else
|
||||||
printf ("Expected status %d, got %d\n",
|
printf ("Expected signal '%s' from child, got none\n",
|
||||||
EXPECTED_STATUS, WEXITSTATUS (status));
|
strsignal (EXPECTED_SIGNAL));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
# endif
|
||||||
|
#else
|
||||||
|
if (WEXITSTATUS (status) != EXPECTED_STATUS)
|
||||||
|
{
|
||||||
|
printf ("Expected status %d, got %d\n",
|
||||||
|
EXPECTED_STATUS, WEXITSTATUS (status));
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
/* Process was killed by timer or other signal. */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#ifndef EXPECTED_SIGNAL
|
||||||
|
printf ("Didn't expect signal from child: got `%s'\n",
|
||||||
|
strsignal (WTERMSIG (status)));
|
||||||
|
exit (1);
|
||||||
|
#else
|
||||||
|
if (WTERMSIG (status) != EXPECTED_SIGNAL)
|
||||||
|
{
|
||||||
|
printf ("Incorrect signal from child: got `%s', need `%s'\n",
|
||||||
|
strsignal (WTERMSIG (status)),
|
||||||
|
strsignal (EXPECTED_SIGNAL));
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue