test: Add testcase for #1111
Refs: #1111 Change-Id: Ifdf25a9ce98ef495200daf1c24d7ac2c81b3ef17
This commit is contained in:
committed by
Masamichi Takagi
parent
04e54ead5d
commit
c6cc0bf07a
47
test/issues/1111/CT_003.c
Normal file
47
test/issues/1111/CT_003.c
Normal file
@ -0,0 +1,47 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include "./test_chk.h"
|
||||
|
||||
#define TEST_NAME "CT_003"
|
||||
|
||||
int handled_cnt;
|
||||
|
||||
void test_handler(int sig)
|
||||
{
|
||||
handled_cnt++;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int rc = 0;
|
||||
int status;
|
||||
int tmp_flag = 0;
|
||||
struct sigaction sa, old_act;
|
||||
|
||||
printf("*** %s start *******************************\n", TEST_NAME);
|
||||
handled_cnt = 0;
|
||||
|
||||
rc = sigaction(0, &sa, NULL);
|
||||
OKNG(rc != -1, "sigaction 0 failed");
|
||||
|
||||
rc = sigaction(_NSIG, &sa, NULL);
|
||||
OKNG(rc != -1, "sigaction _NSIG failed");
|
||||
|
||||
rc = sigaction(SIGKILL, &sa, NULL);
|
||||
OKNG(rc != -1, "sigaction SIGKILL failed");
|
||||
|
||||
rc = sigaction(SIGSTOP, &sa, NULL);
|
||||
OKNG(rc != -1, "sigaction SIGSTOP failed");
|
||||
|
||||
printf("*** %s PASSED\n\n", TEST_NAME);
|
||||
|
||||
return 0;
|
||||
|
||||
fn_fail:
|
||||
printf("*** %s FAILED\n\n", TEST_NAME);
|
||||
|
||||
return -1;
|
||||
}
|
||||
Reference in New Issue
Block a user