mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
r14935@tombo: nickm | 2007-11-22 11:36:54 -0500
Always set test_ok to zero after finishing a test, and before starting one. This turns up some failures we had been missing. svn:r537
This commit is contained in:
parent
1c23e21952
commit
8c3396b0c6
@ -294,7 +294,7 @@ cleanup_test(void)
|
|||||||
fprintf(stdout, "FAILED\n");
|
fprintf(stdout, "FAILED\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
test_ok = 0;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,6 +474,7 @@ test_immediatesignal(void)
|
|||||||
{
|
{
|
||||||
struct event ev;
|
struct event ev;
|
||||||
|
|
||||||
|
test_ok = 0;
|
||||||
printf("Immediate signal: ");
|
printf("Immediate signal: ");
|
||||||
signal_set(&ev, SIGUSR1, signal_cb, &ev);
|
signal_set(&ev, SIGUSR1, signal_cb, &ev);
|
||||||
signal_add(&ev, NULL);
|
signal_add(&ev, NULL);
|
||||||
@ -494,6 +495,8 @@ test_signal_dealloc(void)
|
|||||||
signal_add(&ev, NULL);
|
signal_add(&ev, NULL);
|
||||||
signal_del(&ev);
|
signal_del(&ev);
|
||||||
event_base_free(base);
|
event_base_free(base);
|
||||||
|
/* If we got here without asserting, we're fine. */
|
||||||
|
test_ok = 1;
|
||||||
cleanup_test();
|
cleanup_test();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -503,6 +506,7 @@ test_signal_pipeloss(void)
|
|||||||
/* make sure that the base1 pipe is closed correctly. */
|
/* make sure that the base1 pipe is closed correctly. */
|
||||||
struct event_base *base1, *base2;
|
struct event_base *base1, *base2;
|
||||||
int pipe1;
|
int pipe1;
|
||||||
|
test_ok = 0;
|
||||||
printf("Signal pipeloss: ");
|
printf("Signal pipeloss: ");
|
||||||
base1 = event_init();
|
base1 = event_init();
|
||||||
pipe1 = base1->sig.ev_signal_pair[0];
|
pipe1 = base1->sig.ev_signal_pair[0];
|
||||||
@ -530,6 +534,7 @@ test_signal_switchbase(void)
|
|||||||
{
|
{
|
||||||
struct event ev1, ev2;
|
struct event ev1, ev2;
|
||||||
struct event_base *base1, *base2;
|
struct event_base *base1, *base2;
|
||||||
|
test_ok = 0;
|
||||||
printf("Signal switchbase: ");
|
printf("Signal switchbase: ");
|
||||||
base1 = event_init();
|
base1 = event_init();
|
||||||
base2 = event_init();
|
base2 = event_init();
|
||||||
@ -570,6 +575,7 @@ test_signal_assert()
|
|||||||
{
|
{
|
||||||
struct event ev;
|
struct event ev;
|
||||||
struct event_base *base = event_init();
|
struct event_base *base = event_init();
|
||||||
|
test_ok = 0;
|
||||||
printf("Signal handler assert: ");
|
printf("Signal handler assert: ");
|
||||||
/* use SIGCONT so we don't kill ourselves when we signal to nowhere */
|
/* use SIGCONT so we don't kill ourselves when we signal to nowhere */
|
||||||
signal_set(&ev, SIGCONT, signal_cb, &ev);
|
signal_set(&ev, SIGCONT, signal_cb, &ev);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user