diff --git a/testsuites/unittest/basic/exc/smoke/it_test_exc_002.cpp b/testsuites/unittest/basic/exc/smoke/it_test_exc_002.cpp index 45b941f115ea318a160c08b60101395118819ea9..91e4eebcf647a3b4a3dbc1237d2e5e902d9c004e 100644 --- a/testsuites/unittest/basic/exc/smoke/it_test_exc_002.cpp +++ b/testsuites/unittest/basic/exc/smoke/it_test_exc_002.cpp @@ -79,8 +79,6 @@ static int TestThread(void) static int TestCase(void) { - int *test = nullptr; - int count = 5; int status = 0; int ret; pid_t pid = fork(); diff --git a/testsuites/unittest/basic/exc/smoke/it_test_exc_003.cpp b/testsuites/unittest/basic/exc/smoke/it_test_exc_003.cpp index c275cd655010d10f7ad108871fc87c7cba786351..ec1d49b83b66dd6ce6de5b5ed8f2f4bf46d623dc 100644 --- a/testsuites/unittest/basic/exc/smoke/it_test_exc_003.cpp +++ b/testsuites/unittest/basic/exc/smoke/it_test_exc_003.cpp @@ -32,11 +32,12 @@ #include "pthread.h" #define TEST_THREAD_COUNT 5 + static volatile int g_testCondFlag; static int g_count[TEST_THREAD_COUNT]; + static void *ThreadFunc2(void *arg) { - int count = *(int *)arg; int *test = nullptr; g_testCondFlag++; @@ -85,8 +86,6 @@ static int TestThread(void) static int TestCase(void) { - int *test = nullptr; - int count = 5; int status = 0; int ret; diff --git a/testsuites/unittest/basic/exc/smoke/it_test_exc_004.cpp b/testsuites/unittest/basic/exc/smoke/it_test_exc_004.cpp index 6ad1462a57daab1f48b374c47fcb2d589bfaccb6..8009e3470ecb21c25b0f2aed47153fb09d5da74f 100644 --- a/testsuites/unittest/basic/exc/smoke/it_test_exc_004.cpp +++ b/testsuites/unittest/basic/exc/smoke/it_test_exc_004.cpp @@ -56,8 +56,6 @@ static int TestThread(void) static int TestCase(void) { - int *test = nullptr; - int count = 5; int status = 0; int ret; diff --git a/testsuites/unittest/basic/mem/shm/full/shm_test_001.cpp b/testsuites/unittest/basic/mem/shm/full/shm_test_001.cpp index 6cb107d3ae7b4fb8f861e4d8dd9db669323d737b..e45a72529e1cd0585e4b64bbaf5aea9988ef0ac0 100644 --- a/testsuites/unittest/basic/mem/shm/full/shm_test_001.cpp +++ b/testsuites/unittest/basic/mem/shm/full/shm_test_001.cpp @@ -127,14 +127,13 @@ VOID *ShmWriteFunc(VOID *ptr) } -static int Testcase(VOID) +static int Testcase(void) { pthread_t newPthread[2]; int curThreadPri, curThreadPolicy; pthread_attr_t a = { 0 }; struct sched_param param = { 0 }; int ret; - int i, j; g_threadCount = 0; @@ -159,7 +158,7 @@ static int Testcase(VOID) ICUNIT_ASSERT_EQUAL(ret, 0, ret); ICUNIT_ASSERT_EQUAL(g_threadCount, 2, g_threadCount); - + return 0; } diff --git a/testsuites/unittest/basic/mem/shm/full/shm_test_005.cpp b/testsuites/unittest/basic/mem/shm/full/shm_test_005.cpp index 2e0da0ceae599d99476e51814647f54e7f5d57fd..87628ff2b561d63740e17709c56ce4b0ab796743 100644 --- a/testsuites/unittest/basic/mem/shm/full/shm_test_005.cpp +++ b/testsuites/unittest/basic/mem/shm/full/shm_test_005.cpp @@ -30,13 +30,11 @@ */ #include "it_test_shm.h" -static int Testcase(VOID) +static int Testcase(void) { int shmid; int ret; void *shm = NULL; - void *vaddrPageAlign = NULL; - void *vaddr = NULL; errno = 0; shmid = shmget(0x111, PAGE_SIZE, 0777 | IPC_EXCL); diff --git a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_008.cpp b/testsuites/unittest/basic/mem/vm/smoke/mmap_test_008.cpp index 2d024751bd7c8df6b43ed39709cc6ee4f7a1e54d..42bceb241b96afea05bc5797c4534c4222ef4a2a 100644 --- a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_008.cpp +++ b/testsuites/unittest/basic/mem/vm/smoke/mmap_test_008.cpp @@ -42,9 +42,6 @@ static int Testcase(void) void *mem = NULL; void *memFix = NULL; void *memNoFix = NULL; - void *pre = NULL; - void *next = NULL; - void *overlay = NULL; int ret; mem = mmap((void *)fixAddr, len, PROT_READ | PROT_WRITE, flags | MAP_FIXED, -1, 0); diff --git a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_009.cpp b/testsuites/unittest/basic/mem/vm/smoke/mmap_test_009.cpp index 57211386e10a1092d88bddf98fd2f0b29d40f712..2bfc6e903833c8012ad21b897910db534ef88899 100644 --- a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_009.cpp +++ b/testsuites/unittest/basic/mem/vm/smoke/mmap_test_009.cpp @@ -38,7 +38,7 @@ /* Test PROT_NONE flag */ static int Testcase(void) { - int ret, param; + int ret; int *ptr = NULL; int status = 0; pid_t pid = fork(); diff --git a/testsuites/unittest/drivers/storage/smoke/storage_test_001.cpp b/testsuites/unittest/drivers/storage/smoke/storage_test_001.cpp index 9e35c78f9288945dd721ada56a86b208cd167077..58c75bf0e544f1589265f19636042d6f688714f9 100644 --- a/testsuites/unittest/drivers/storage/smoke/storage_test_001.cpp +++ b/testsuites/unittest/drivers/storage/smoke/storage_test_001.cpp @@ -37,11 +37,10 @@ #define DIOC_GETPRIV 0x1000 #define INVALID_PTR 0x11111111 -static int Testcase(VOID) +static int Testcase(void) { int ret; int fd = -1; - int i; ssize_t n; char *buf = NULL; void *bch = NULL; diff --git a/testsuites/unittest/extended/signal/full/pipe_test_001.cpp b/testsuites/unittest/extended/signal/full/pipe_test_001.cpp index fe13fd1d01abe1276f0da91d81ddade2f1e59530..645837d44b009bbf09dcb1eda0925fb014e30405 100644 --- a/testsuites/unittest/extended/signal/full/pipe_test_001.cpp +++ b/testsuites/unittest/extended/signal/full/pipe_test_001.cpp @@ -61,6 +61,9 @@ int TestPipeSingleProcess() (void)sprintf_s(a, sizeof(a), "%d", i); strcat(sentence1, a); int ret = write(*writeFd, sentence1, strlen(sentence1) + 1); + if (ret < 0) { + printf("write failed!\n"); + } usleep(100000); // 100000, Used to calculate the delay time. printf("read\n"); diff --git a/testsuites/unittest/extended/signal/full/pipe_test_003.cpp b/testsuites/unittest/extended/signal/full/pipe_test_003.cpp index 6c76e23b460004e24f7e6c1648ab4234493f6e2f..e4311dde7e4de7b068591d716c3ae83f4d58eae2 100644 --- a/testsuites/unittest/extended/signal/full/pipe_test_003.cpp +++ b/testsuites/unittest/extended/signal/full/pipe_test_003.cpp @@ -32,7 +32,7 @@ #include "signal.h" #include "fcntl.h" -int TestPipeSingleProcessFcntl() +int TestPipeSingleProcessFcntl(void) { int pipefd[2]; // 2, array subscript pid_t pid; @@ -61,10 +61,12 @@ int TestPipeSingleProcessFcntl() (void)sprintf_s(a, sizeof(a), "%d", i); strcat(sentence1, a); int ret = write(*writeFd, sentence1, strlen(sentence1) + 1); + if (ret < 0) { + printf("write failed!\n"); + } usleep(100000); // 100000, Used to calculate the delay time. } char sentence1[15] = "Hello World"; - char a[4] = {0}; usleep(10000); // 10000, Used to calculate the delay time. printf("read\n"); memset(readbuffer, 0, sizeof(readbuffer)); diff --git a/testsuites/unittest/extended/signal/full/pipe_test_005.cpp b/testsuites/unittest/extended/signal/full/pipe_test_005.cpp index 9b490529dad9dbf7da2dd0c3e700ceb162ed23b5..647a8447d951a5be0d3778e87f178cb634e3a4f0 100644 --- a/testsuites/unittest/extended/signal/full/pipe_test_005.cpp +++ b/testsuites/unittest/extended/signal/full/pipe_test_005.cpp @@ -37,7 +37,7 @@ static void SigPrint(int signum) printf("Pipe break\n"); } -static int PipecommonWrite() +static int PipecommonWrite(void) { int pipefd[2]; // 2, array subscript pid_t pid; @@ -47,7 +47,6 @@ static int PipecommonWrite() int *readFd = &pipefd[0]; int *writeFd = &pipefd[1]; char sentence[] = "Hello World"; - char readbuffer[100]; int status, ret; retValue = pipe(pipefd); diff --git a/testsuites/unittest/extended/signal/full/signal_test_001.cpp b/testsuites/unittest/extended/signal/full/signal_test_001.cpp index 71e777bcff94f0c795bcd1777d416d4e2701be97..e0d30d856b374bcaec30bddf0db0ecffe7cac201 100644 --- a/testsuites/unittest/extended/signal/full/signal_test_001.cpp +++ b/testsuites/unittest/extended/signal/full/signal_test_001.cpp @@ -34,12 +34,13 @@ static const int SIG_TEST_COUNT = 3; static int g_sigCount = 0; + static void SigPrint(int sig) { g_sigCount++; } -static int TestRaiseMuliti() +static int TestRaiseMuliti(void) { int sig = SIGTERM; int count = 0; @@ -138,7 +139,7 @@ static int TestCase(void) printf("errline = %d\n", __LINE__); exit(-1); } - int status, rt; + signal(SIGALRM, SigPrint); sigset_t sigmask, oldmask, pending; sigemptyset(&sigmask); diff --git a/testsuites/unittest/extended/signal/full/signal_test_007.cpp b/testsuites/unittest/extended/signal/full/signal_test_007.cpp index 1fcb74ee25d38e44774b56481d5db8abd469c657..33445e6f0cc972ce844321d9953808d4b9a40c61 100644 --- a/testsuites/unittest/extended/signal/full/signal_test_007.cpp +++ b/testsuites/unittest/extended/signal/full/signal_test_007.cpp @@ -32,7 +32,6 @@ #include "signal.h" #include "sys/wait.h" -static int g_break = 0; /* Sample : Father process want to free zombine child process */ static void SigChildResponse(int signo) { @@ -41,7 +40,7 @@ static void SigChildResponse(int signo) } /* Register SIGCHLD, through signal to restore the child memery */ -static int TestSigKillResp() +static int TestSigKillResp(void) { void (*ret)(int) = nullptr; int fpid, fpids, status, retValue; diff --git a/testsuites/unittest/extended/signal/full/signal_test_011.cpp b/testsuites/unittest/extended/signal/full/signal_test_011.cpp index 1e84c4da3a5cb77abcbfafa15ee84c51ce2715cd..a54a1b88b82d03b1dae29d4e79041e9d1b25d646 100644 --- a/testsuites/unittest/extended/signal/full/signal_test_011.cpp +++ b/testsuites/unittest/extended/signal/full/signal_test_011.cpp @@ -39,7 +39,7 @@ static void SigPrint(int sig) static int TestSigTimeWait() { sigset_t set; - int sig, fpid, retValue, status; + int fpid, retValue, status; siginfo_t si; struct timespec ts; void (*retSig)(int); diff --git a/testsuites/unittest/extended/signal/full/signal_test_016.cpp b/testsuites/unittest/extended/signal/full/signal_test_016.cpp index 1e6eebc43bad5f6a2b3257cb839a6e3b9f543872..6f53d90ceff81d88716107d05b999e8d23c6e029 100644 --- a/testsuites/unittest/extended/signal/full/signal_test_016.cpp +++ b/testsuites/unittest/extended/signal/full/signal_test_016.cpp @@ -49,7 +49,6 @@ static void *ThreadSetFunc2(void *arg) ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); retValue = sigaddset(&set, SIGUSR1); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); - int count; retValue = sigwait(&set, &sig); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); @@ -67,7 +66,6 @@ static void *ThreadSetDfl(void *arg) ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); retValue = sigaddset(&set, SIGUSR1); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); - int count; retValue = sigwait(&set, &sig); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); @@ -80,7 +78,7 @@ static void *ThreadKill(void *arg) } } -static int TestMultiPthreadKillPendNormal() +static int TestMultiPthreadKillPendNormal(void) { int status, retValue, fpid; pthread_t thread, thread1, thread2; @@ -118,7 +116,6 @@ static int TestMultiPthreadKillPendNormal() if (retValue != 0) { exit(retValue); } - int count; retValue = sigwait(&set, &sig); if (retValue != 0) { diff --git a/testsuites/unittest/extended/signal/full/signal_test_017.cpp b/testsuites/unittest/extended/signal/full/signal_test_017.cpp index 08968aa7cf288b313dabdd20fed4dc415fb32ca2..ed650e83a288ca783257dfc7bc91b8bea7cc251f 100644 --- a/testsuites/unittest/extended/signal/full/signal_test_017.cpp +++ b/testsuites/unittest/extended/signal/full/signal_test_017.cpp @@ -49,7 +49,6 @@ static void *ThreadSetFunc2(void *arg) ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); retValue = sigaddset(&set, SIGUSR1); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); - int count; retValue = sigwait(&set, &sig); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); @@ -67,7 +66,6 @@ static void *ThreadSetDfl(void *arg) ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); retValue = sigaddset(&set, SIGUSR1); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); - int count; retValue = sigwait(&set, &sig); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); @@ -85,7 +83,6 @@ static void *ThreadKill(void *arg) ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); retValue = sigaddset(&set, SIGUSR1); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); - int count; retValue = sigwait(&set, &sig); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); diff --git a/testsuites/unittest/extended/signal/full/signal_test_018.cpp b/testsuites/unittest/extended/signal/full/signal_test_018.cpp index cf7d275a68fda33f4df5c00ec4e279e7c6852d7c..d669cc2f097d8d9786f7bac6af97d95c820e8e18 100644 --- a/testsuites/unittest/extended/signal/full/signal_test_018.cpp +++ b/testsuites/unittest/extended/signal/full/signal_test_018.cpp @@ -40,7 +40,7 @@ static void SigPrint(int sig) static int TestSigTimeWaitKillProcess(void) { sigset_t set; - int sig, fpid, retValue, status; + int fpid, retValue, status; siginfo_t si; struct timespec ts; diff --git a/testsuites/unittest/extended/signal/full/signal_test_019.cpp b/testsuites/unittest/extended/signal/full/signal_test_019.cpp index 0235fc91bf7e8409cc68e40c72128ded4b4d0870..ccf3fc665759bcb85db8ba0587be8cd986d133f6 100644 --- a/testsuites/unittest/extended/signal/full/signal_test_019.cpp +++ b/testsuites/unittest/extended/signal/full/signal_test_019.cpp @@ -40,7 +40,7 @@ static void SigPrint(int sig) static int TestSigTimeWaitDirectKillChild(void) { sigset_t set; - int sig, fpid, retValue, status; + int fpid, retValue, status; siginfo_t si; struct timespec ts; diff --git a/testsuites/unittest/extended/signal/full/signal_test_025.cpp b/testsuites/unittest/extended/signal/full/signal_test_025.cpp index aef9dd8ff11cca4a3bd2f2ec53f574e9e9fb2727..3a1042294b2c8c25eb105ef0dabbce2ba1cec7f7 100644 --- a/testsuites/unittest/extended/signal/full/signal_test_025.cpp +++ b/testsuites/unittest/extended/signal/full/signal_test_025.cpp @@ -36,10 +36,9 @@ static void SigAlrm(int signum) printf("Alert rings.\n"); } -static int TestBlock() +static int TestBlock(void) { int sig = SIGALRM; - void *ret; int retValue, status; int fpid = fork(); diff --git a/testsuites/unittest/extended/signal/full/signal_test_026.cpp b/testsuites/unittest/extended/signal/full/signal_test_026.cpp index f555f2fd13888c826397f2209160fe5d8043ad6b..153aef181b2bd3c1b803b17552f41dccc8e1f030 100644 --- a/testsuites/unittest/extended/signal/full/signal_test_026.cpp +++ b/testsuites/unittest/extended/signal/full/signal_test_026.cpp @@ -37,10 +37,9 @@ static void SigPrint(int signum) printf("Signal Triggered\n"); } -static UINT32 TestCase(VOID) +static UINT32 TestCase(void) { - int ret, sig; - struct itimerval newValue, oldValue; + int ret; siginfo_t info; sigset_t newset; struct timespec timeout; diff --git a/testsuites/unittest/extended/signal/full/signal_test_028.cpp b/testsuites/unittest/extended/signal/full/signal_test_028.cpp index ba48ed1753cd9b57f6c9ec6a9b9d4fcc58462b2f..6a9c332e80fab22b328e74fd86687b92e24a0001 100644 --- a/testsuites/unittest/extended/signal/full/signal_test_028.cpp +++ b/testsuites/unittest/extended/signal/full/signal_test_028.cpp @@ -49,7 +49,6 @@ static int TestSigset() // record mask words sigset_t sigset; - void *ret; int retValue, status; int fpid = fork(); diff --git a/testsuites/unittest/extended/signal/full/signal_test_040.cpp b/testsuites/unittest/extended/signal/full/signal_test_040.cpp index 76654c6a02c579c612ff79b832f04977fef3a522..ba51c26b25a4d560ee82cda772a4752a5ae57448 100644 --- a/testsuites/unittest/extended/signal/full/signal_test_040.cpp +++ b/testsuites/unittest/extended/signal/full/signal_test_040.cpp @@ -32,20 +32,19 @@ #include "signal.h" static int g_sigCount = 0; -static int g_sigCount1 = 0; + static void SigPrint(int sig) { (void)sig; g_sigCount++; - printf("signal receive success\cn"); + printf("signal receive success\n"); } -static UINT32 TestCase(VOID) +static UINT32 TestCase(void) { int pid = 0; int ret = 0; - void *retptr = NULL; - sigset_t newset, oldset; + sigset_t newset; sigemptyset(&newset); sigprocmask(SIG_SETMASK, &newset, NULL); diff --git a/testsuites/unittest/extended/signal/full/signal_test_041.cpp b/testsuites/unittest/extended/signal/full/signal_test_041.cpp index c8c818a42652e08762f19a2c631872a068e75f53..2421694555ad7633024b62e34e047711bc189ee8 100644 --- a/testsuites/unittest/extended/signal/full/signal_test_041.cpp +++ b/testsuites/unittest/extended/signal/full/signal_test_041.cpp @@ -38,6 +38,7 @@ static void Sigprint(int sig) (void)sig; printf("enter sighandle : -------------------------\n"); } + static void Sigprint111(int sig) { (void)sig; @@ -129,7 +130,7 @@ static UINT32 TestCase(VOID) { int ret, retval; void *res = nullptr; - pthread_t newPthread, newPthread1; + pthread_t newPthread1; sigset_t set, oldset; sighandler_t sigret; sigret = signal(SIGUSR2, Sigprint111); diff --git a/testsuites/unittest/extended/signal/smoke/mkfifo_test_002.cpp b/testsuites/unittest/extended/signal/smoke/mkfifo_test_002.cpp index ffbf9fff8e4a92d1fbf98989124610ee7800a990..a75ad1fc2c86a6b16f0f66f014d21c1d3880bfae 100644 --- a/testsuites/unittest/extended/signal/smoke/mkfifo_test_002.cpp +++ b/testsuites/unittest/extended/signal/smoke/mkfifo_test_002.cpp @@ -37,14 +37,10 @@ #include static const int NAME_BUF_SIZE = 500; -static const int FAULT1 = 6; -static const int FAULT2 = 7; -static int TestMkfifoReturn() +static int TestMkfifoReturn(void) { - int retValue, i; - int status = 0; - pid_t pid; + int retValue; char pathname[NAME_BUF_SIZE]; retValue = mkfifo("/dev/fifo0", 0777); // 0777, mkfifo config. diff --git a/testsuites/unittest/extended/signal/smoke/pipe_test_004.cpp b/testsuites/unittest/extended/signal/smoke/pipe_test_004.cpp index 87e8243f3b031796a176cc2b11521ac9574aac55..1b89726afc485a3cc5ee0993ef061d08a21e5fa0 100644 --- a/testsuites/unittest/extended/signal/smoke/pipe_test_004.cpp +++ b/testsuites/unittest/extended/signal/smoke/pipe_test_004.cpp @@ -32,12 +32,9 @@ #include "signal.h" #include "fcntl.h" -#define FAULT1 11 -#define FAULT2 22 -int TestPipeReturn() +int TestPipeReturn(void) { - int pipefd[2]; // 2, array subscript - int retValue, i, status; + int retValue; retValue = pipe(NULL); ICUNIT_ASSERT_EQUAL(retValue, -1, retValue); ICUNIT_ASSERT_EQUAL(errno, EFAULT, errno); diff --git a/testsuites/unittest/extended/signal/smoke/signal_test_009.cpp b/testsuites/unittest/extended/signal/smoke/signal_test_009.cpp index dc36dde77f3114a9baea2f2859e2dbf6dfaca808..eed98cc42df6bb30675adf694e896ceb5855ff86 100644 --- a/testsuites/unittest/extended/signal/smoke/signal_test_009.cpp +++ b/testsuites/unittest/extended/signal/smoke/signal_test_009.cpp @@ -83,7 +83,6 @@ static int TestSigSet(void) ICUNIT_ASSERT_EQUAL(set.__bits[0], 0x10, set.__bits[0]); ICUNIT_ASSERT_EQUAL(retValue, 0, retValue); - int sigs; sigset(1, SigPrint1); retValue = raise(1); diff --git a/testsuites/unittest/extended/signal/smoke/signal_test_013.cpp b/testsuites/unittest/extended/signal/smoke/signal_test_013.cpp index 6ccd38029d7cd9bdfda0b460f4d12ea64cb26110..f3a5bcede339194781b54fcb68f94367ce310739 100644 --- a/testsuites/unittest/extended/signal/smoke/signal_test_013.cpp +++ b/testsuites/unittest/extended/signal/smoke/signal_test_013.cpp @@ -100,7 +100,6 @@ static int TestSigMultiPthread(void) int status; int *status1 = nullptr; int ret; - int count; pthread_t thread, thread1, thread2; fpid = fork(); diff --git a/testsuites/unittest/extended/signal/smoke/signal_test_035.cpp b/testsuites/unittest/extended/signal/smoke/signal_test_035.cpp index f07e329bf24a40d42db4a57009a2c2b9f6185ba0..231b82c0b4de881522d3a912a1a377fe0145daef 100644 --- a/testsuites/unittest/extended/signal/smoke/signal_test_035.cpp +++ b/testsuites/unittest/extended/signal/smoke/signal_test_035.cpp @@ -32,16 +32,16 @@ #include "signal.h" static int g_sigCount = 0; + static void SigPrint(int sig) { (void)sig; g_sigCount++; } -static int TestCase() +static int TestCase(void) { int sig = 100; - int count = 0; int retValue, status; void (*ret)(int); diff --git a/testsuites/unittest/libc/io/full/IO_test_epoll_001.cpp b/testsuites/unittest/libc/io/full/IO_test_epoll_001.cpp index ecdca93a644906b83e712d53ec01547bf2c9f531..70e256857d0694aed65d7ffe1ae6d50a3e5caaae 100644 --- a/testsuites/unittest/libc/io/full/IO_test_epoll_001.cpp +++ b/testsuites/unittest/libc/io/full/IO_test_epoll_001.cpp @@ -43,12 +43,9 @@ static UINT32 testcase(VOID) int retval; pid_t pid; int pipeFd[2]; /* 2, pipe id num */ - char buffer[40]; /* 40, buffer size */ - int i = 0; int status; int epFd; - sigset_t mask; struct epoll_event ev; struct epoll_event evWait[2]; /* 2, evs num */ diff --git a/testsuites/unittest/libc/io/full/IO_test_epoll_002.cpp b/testsuites/unittest/libc/io/full/IO_test_epoll_002.cpp index 8b54bdcd82afe5fb06c53db607907f853b6134f1..94781d1934f0588e2ba5f274afd9aaeff2c0c4da 100644 --- a/testsuites/unittest/libc/io/full/IO_test_epoll_002.cpp +++ b/testsuites/unittest/libc/io/full/IO_test_epoll_002.cpp @@ -49,8 +49,6 @@ static UINT32 testcase(VOID) int retval; pid_t pid; int pipeFd[2]; /* 2, pipe id num */ - char buffer[40]; /* 40, buffer size */ - int i = 0; int status; int epFd; diff --git a/testsuites/unittest/libc/io/full/IO_test_pselect_001.cpp b/testsuites/unittest/libc/io/full/IO_test_pselect_001.cpp index d6cfa95d4a2d451e8ff47831c99b0492aa8cb5ce..c065fdb457faf512690bf70936490a5df926386a 100644 --- a/testsuites/unittest/libc/io/full/IO_test_pselect_001.cpp +++ b/testsuites/unittest/libc/io/full/IO_test_pselect_001.cpp @@ -68,8 +68,6 @@ static UINT32 testcase(VOID) int retval; pid_t pid; int pipeFd[2]; /* 2, pipe id num */ - char buffer[40]; /* 40, buffer size */ - int i = 0; int status; sigset_t mask; diff --git a/testsuites/unittest/libc/io/full/IO_test_pselect_002.cpp b/testsuites/unittest/libc/io/full/IO_test_pselect_002.cpp index a57c316d70330e410e6c7fa4ea65c308276539e1..62721fbe3121bfe5156e2052d43d7eb81f8376db 100644 --- a/testsuites/unittest/libc/io/full/IO_test_pselect_002.cpp +++ b/testsuites/unittest/libc/io/full/IO_test_pselect_002.cpp @@ -49,9 +49,6 @@ static UINT32 testcase(VOID) int retval; pid_t pid; int pipeFd[2]; /* 2, pipe id num */ - char buffer[40]; /* 40, buffer size */ - - int i = 0; int status; void (*retSig)(int); diff --git a/testsuites/unittest/libc/io/full/It_stdio_putwc_001.cpp b/testsuites/unittest/libc/io/full/It_stdio_putwc_001.cpp index a36673857e851f8bdeb9a37e8c02c3b8b76acb88..330f00d0a9ba7cfab186d9b1c937d295702ad33e 100644 --- a/testsuites/unittest/libc/io/full/It_stdio_putwc_001.cpp +++ b/testsuites/unittest/libc/io/full/It_stdio_putwc_001.cpp @@ -36,7 +36,7 @@ static UINT32 Testcase(VOID) wchar_t srcWc = L'H'; int tarWc, nRet; long nPos; - int nType, i; + int nType; FILE *putwcFile = NULL; char pathname[50]; // 50, pathname size strncpy(pathname, g_ioTestPath, 50); // 50, pathname size diff --git a/testsuites/unittest/libc/io/full/It_stdlib_poll_003.cpp b/testsuites/unittest/libc/io/full/It_stdlib_poll_003.cpp index d1a99db88f3f539c166c806d8489ffa52c3161b5..f0a883289f5db87f647ebf4000514184f5c5ee2e 100644 --- a/testsuites/unittest/libc/io/full/It_stdlib_poll_003.cpp +++ b/testsuites/unittest/libc/io/full/It_stdlib_poll_003.cpp @@ -40,7 +40,7 @@ struct PollParam { static UINT32 Testcase(VOID) { const int TEST_STR_LEN = 12; - int pipeFd[2], ret, err; // 2, pipe return 2 file descirpter + int pipeFd[2], ret; // 2, pipe return 2 file descirpter struct pollfd pollFd; struct PollParam pollParam[4] = { /* nfds timeout ret err */ { 0, 100, -1, EINVAL}, diff --git a/testsuites/unittest/libc/io/smoke/IO_test_013.cpp b/testsuites/unittest/libc/io/smoke/IO_test_013.cpp index 9b2763c48cd5a6acc5db14d7e323c8e37c2117e0..201bf6df1e6085ba3f01e3bbcd7735ac884435cf 100644 --- a/testsuites/unittest/libc/io/smoke/IO_test_013.cpp +++ b/testsuites/unittest/libc/io/smoke/IO_test_013.cpp @@ -32,7 +32,7 @@ static UINT32 Testcase(VOID) { - INT32 val, ret, result; + INT32 ret; wchar_t buf[200]; wchar_t *str = L"helloworld"; diff --git a/testsuites/unittest/libc/misc/smoke/misc_test_014.cpp b/testsuites/unittest/libc/misc/smoke/misc_test_014.cpp index 1dffbe51393ecc52d20a0038c2116ddc4b471385..5189f306919246055d2afe1a6f06d1ac56f8bc85 100644 --- a/testsuites/unittest/libc/misc/smoke/misc_test_014.cpp +++ b/testsuites/unittest/libc/misc/smoke/misc_test_014.cpp @@ -34,7 +34,6 @@ static UINT32 TestCase(VOID) { char *name1 = nullptr; char name2[100] = { 0 }; - char name3[100] = "hello"; int ret; name1 = tmpnam(NULL); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_020.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_020.cpp index e24f1a8de1da09070fe4a191291876dd7f7ebd23..36665b941d3c8419493c7bec9dd5d8b979601e0c 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_020.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_020.cpp @@ -35,8 +35,6 @@ static UINT32 Testcase(VOID) INT32 ret; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; mqd_t mqueue; - struct sigevent ev; - struct sigaction act; snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq020_%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_032.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_032.cpp index 9feb13998772d5f665b5271fef179224e35ad1cb..2387e11b5fb08e7adcf8ec0b5878dc66bb62b84b 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_032.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_032.cpp @@ -35,7 +35,6 @@ static UINT32 Testcase(VOID) INT32 ret; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = {0}; mqd_t mqueue; - struct sigevent se; snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq032_%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_040.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_040.cpp index 4442ff61eb5d2ae40e78bda3b171475882e7d767..a58629d4e567c08eaa5c6b874db4f52e91f18bc8 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_040.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_040.cpp @@ -56,7 +56,7 @@ EXIT: static VOID *PthreadF02(VOID *argument) { - INT32 j, ret; + INT32 ret; CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = ""; @@ -83,8 +83,6 @@ static UINT32 Testcase(VOID) { pthread_t newTh1, newTh2; UINT32 ret; - CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = ""; - const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; struct mq_attr attr = { 0 }; pthread_attr_t attr1; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_046.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_046.cpp index 90aacd21e19eb2de7cec77ecbf5f8405aa609f84..04b30ee865bc493655fe3162857e53abd46cda5f 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_046.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_046.cpp @@ -35,7 +35,7 @@ static UINT32 Testcase(VOID) CHAR qname[MQUEUE_STANDARD_NAME_LENGTH] = ""; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; mqd_t queue; - INT32 unresolved = 0, failure = 0, ret = 0; + INT32 ret = 0; snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq046-1_%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_056.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_056.cpp index 0d8eaf1d1b83c5c7750561b3685cc1ce7ecae51b..ea2bf63b8a8911053a052b322a82d3bc7b8c340b 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_056.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_056.cpp @@ -35,7 +35,7 @@ static UINT32 Testcase(VOID) CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH], msgrv[MQUEUE_STANDARD_NAME_LENGTH]; mqd_t mqdes; struct mq_attr attr = { 0 }; - INT32 unresolved = 0, failure = 0, ret = 0; + INT32 failure = 0, ret = 0; snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq056-1-%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_058.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_058.cpp index cd0bb9ae5cfb65261a59aec1961f202ab8436560..bd90d7b06e0dbdbab1326f665b75bd86024b51f1 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_058.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_058.cpp @@ -36,7 +36,7 @@ static UINT32 Testcase(VOID) mqd_t mqdes; CHAR msgrv[MQUEUE_STANDARD_NAME_LENGTH]; struct mq_attr attr = { 0 }; - INT32 unresolved = 0, failure = 0, ret = 0; + INT32 ret = 0; snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq058-2-%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_061.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_061.cpp index 1fe6064ddd7a08910984e55f657d9687ecba6235..59190079ebcb37427062333ab8c1d1a336b16303 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_061.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_061.cpp @@ -35,7 +35,6 @@ static UINT32 Testcase(VOID) CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; mqd_t mqdes; struct mq_attr mqstat; - INT32 unresolved = 0; INT32 failure = 0, ret = 0; snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq061-1_%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_063.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_063.cpp index 57f77d7b029f13c75bf5c1e6ee472587feb9625a..fa8166185aa8990042d69c3282feebf10fb0eff0 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_063.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_063.cpp @@ -35,7 +35,6 @@ static UINT32 Testcase(VOID) CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; mqd_t mqdes; struct mq_attr mqstat, nmqstat; - INT32 unresolved = 0; INT32 failure = 0, ret = 0; snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq063-1_%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_066.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_066.cpp index 03b127e9812654be13bfdb0e01ed4c1ee01fcd8a..c505818ebb4e4c69e6ea6afc8f72bc2b252cc060 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_066.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_066.cpp @@ -36,7 +36,6 @@ static UINT32 Testcase(VOID) mqd_t mqdes; struct mq_attr mqstat = { 0 }; struct mq_attr nmqstat = { 0 }; - INT32 unresolved = 0; INT32 failure = 0, ret = 0; snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq066-1_%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_080.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_080.cpp index 74e7251568a840b0fa251570d2f98a8997487891..8c46179d4b85b9109dd007f1840b0c32fed9c13d 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_080.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_080.cpp @@ -37,8 +37,7 @@ static UINT32 Testcase(VOID) struct timespec ts; struct mq_attr attr = { 0 }; mqd_t queue; - INT32 unresolved = 0, failure = 0, i, maxreached = 0, ret = 0; - unsigned pri; + INT32 unresolved = 0, i, maxreached = 0, ret = 0; snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq080-1_%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_081.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_081.cpp index 3ac51ae4fa18746ebca6d5a035d42854bf7c319c..742f30ccdadff4a756a3b9fac7d849c2ea988cef 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_081.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_081.cpp @@ -37,8 +37,7 @@ static UINT32 Testcase(VOID) struct timespec ts; mqd_t queue; struct mq_attr attr = { 0 }; - INT32 unresolved = 0, ret; - unsigned pri; + INT32 ret; snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq081-1_%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_083.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_083.cpp index 55b26c13f79125308c5ee008c1cd6745e5279d16..9f4ecb23eaba43edc571734d0b303a7596e54075 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_083.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_083.cpp @@ -37,7 +37,7 @@ static UINT32 Testcase(VOID) struct timespec ts; struct mq_attr attr = { 0 }; mqd_t queue; - INT32 unresolved = 0, failure = 0, i, maxreached = 0, ret = 0; + INT32 i, ret = 0; snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq083-1_%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_084.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_084.cpp index 02b6fc18cbe2addf73a54c2afce134755d2908e8..f4b7dd5049c6e02e71c22fe95682db41c8841535 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_084.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_084.cpp @@ -36,7 +36,7 @@ static UINT32 Testcase(VOID) const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; struct timespec ts; mqd_t queue; - INT32 unresolved = 0, failure = 0, ret = 0; + INT32 ret = 0; snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq084-1_%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_093.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_093.cpp index 4e8596f40a079633244fa95b7636fb906147b85d..ff1249ca04ffaf532da779fe184581ec440c6cd2 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_093.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_093.cpp @@ -36,9 +36,6 @@ static UINT32 Testcase(VOID) CHAR *msgptr = MQUEUE_SEND_STRING_TEST; struct timespec ts; struct mq_attr attr = { 0 }; - mqd_t mqueue; - struct sigaction act; - time_t currsec; snprintf(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq093_%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_108.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_108.cpp index 898c252c144c46ee5bf6d671072a910d0a62603c..236d26f94ec5a947ea078423658d52d259345ce5 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_108.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_108.cpp @@ -36,7 +36,7 @@ static UINT32 Testcase(VOID) mqd_t mqdes; struct timespec ts; struct mq_attr attr = { 0 }; - INT32 unresolved = 0, failure = 0, ret = 0; + INT32 ret = 0; snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq108-1_%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_119.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_119.cpp index d93f11d724bd35df84a00ef9f1a6ee0c6cee9f92..b9155f02ee6d9802aaecd4d07b2102011d3c5fe0 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_119.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_119.cpp @@ -63,7 +63,6 @@ EXIT: static VOID *PthreadF02(VOID *arg) { INT32 ret; - UINT32 uret; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; pthread_t pthread1; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_134.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_134.cpp index 1293dce174ec730844da394072e01631154c73c1..6134a8c4ff6ef2ff4573bc5eaa5e34c939dbf143 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_134.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_134.cpp @@ -33,7 +33,6 @@ static UINT32 Testcase(VOID) { INT32 ret; - UINTPTR temp; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; mqd_t mqueue; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_136.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_136.cpp index 83f0f82f7d55c058a38d024e70bf48e6bd69a247..7a427b391e5ee0927e42fac05402f99801946e26 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_136.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_136.cpp @@ -38,9 +38,6 @@ static UINT32 Testcase(VOID) mqd_t queueID[LOSCFG_BASE_IPC_QUEUE_CONFIG + 1]; CHAR qName[LOSCFG_BASE_IPC_QUEUE_CONFIG + 1][MQUEUE_STANDARD_NAME_LENGTH]; - const CHAR *msgPtr = MQUEUE_SEND_STRING_TEST; - CHAR msgRcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; - struct mq_attr msgAttr = { 0 }; msgAttr.mq_msgsize = 20; // 20, mqueue message size. msgAttr.mq_maxmsg = 20; // 20, mqueue message size. diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_144.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_144.cpp index c9d07ef412a96515d3d06b78b3901ebc94e31f11..11096a9bfe659a3647314d88af530df1d9cf4543 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_144.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_144.cpp @@ -88,7 +88,7 @@ static UINT32 Testcase(VOID) INT32 ret; UINT32 uret; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; - struct mq_attr mqstat, attr; + struct mq_attr mqstat; pthread_attr_t attr1; pthread_t newTh, newTh2; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_151.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_151.cpp index 4874cdf88fda46da8ed65c174cb32d9c4862a274..f57663f075dc660823596d1eb40c94353d708d1c 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_151.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_151.cpp @@ -33,7 +33,6 @@ static UINT32 Testcase(VOID) { INT32 ret; - const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; mqd_t mqueue; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_160.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_160.cpp index c451568ba27dd603ccc2dca10c0f566f51991a81..b7b9dd9178bf73b02153782283ed9da774b4f21e 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_160.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_160.cpp @@ -32,7 +32,7 @@ static VOID *PthreadF01(VOID *arg) { - INT32 i, ret; + INT32 i; INT32 count = MQUEUE_MAX_NUM_TEST; struct mq_attr attr = { 0 }; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_161.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_161.cpp index ca6949a7e8600381ad62f543a90da1d4571b525e..bcff843e94aaf9484e1d77afc13361572701d82b 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_161.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_161.cpp @@ -34,7 +34,7 @@ static UINT32 g_index = 0; static VOID *PthreadF01(VOID *arg) { - INT32 i, ret; + INT32 i; UINT32 uret = 0; INT32 count = (INT32)arg; struct mq_attr attr = { 0 }; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_168.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_168.cpp index 48f215f3d49da44382f442b280a10adf0eb8a68e..a0f7cebb4680d3d8022ed27df6e05a7b25836254 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_168.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_168.cpp @@ -33,7 +33,6 @@ static UINT32 Testcase(VOID) { - UINT32 pri; INT32 ret; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = {0}; CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_169.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_169.cpp index d161ab4f461e40ed3ed4a8b31a1cd9b2249525e6..527149c860ff5ec441d0fe6a4447f5a7a6de8e18 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_169.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_169.cpp @@ -33,7 +33,6 @@ static UINT32 Testcase(VOID) { INT32 ret; - UINT32 pri; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = {0}; CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_173.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_173.cpp index d87588d4180d5d19459c5e2f8a33563d748e4e35..af737173c6b780c46a213050b12828296ffd231c 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_173.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_173.cpp @@ -33,10 +33,7 @@ static UINT32 Testcase(VOID) { INT32 ret; - UINT32 rvprio; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = {0}; - CHAR msgrcd1[MQUEUE_STANDARD_NAME_LENGTH] = {0}; - CHAR msgrcd2[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr1 = "test message 1"; const CHAR *msgptr2 = "test message 2"; mqd_t mqueue; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_175.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_175.cpp index 0fa63e43ae941e8ba7a67e7415957600b548da10..23171491d9ba23ddbd8f75f96231b41f7466fd9c 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_175.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_175.cpp @@ -34,7 +34,6 @@ static UINT32 Testcase(VOID) { INT32 ret; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = {0}; - CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; struct timespec ts; struct mq_attr attr = { 0 }; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_176.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_176.cpp index fda61054dfaeb63e8d6bb22781e676f81a939bee..1364c647c2040dd0c8457f8fbae80293f3ac7093 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_176.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_176.cpp @@ -33,9 +33,7 @@ static UINT32 Testcase(VOID) { INT32 ret; - UINT32 pri; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = {0}; - CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; struct timespec ts; mqd_t mqueue; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_177.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_177.cpp index 574c1bc106dbe62e9bc47274dd4fc4c1163cc2ec..1cdaa8fb677465457f7d1adc0f8af5d71069d157 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_177.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_177.cpp @@ -33,7 +33,6 @@ static UINT32 Testcase(VOID) { INT32 ret; - UINT32 pri; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = {0}; CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_201.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_201.cpp index 2ecd50380e89a625e39835c015e00600a0834f90..e2a0f2481389ba40a5c3d3cbe42f5bab8dccdbfc 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_201.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_201.cpp @@ -36,7 +36,6 @@ static UINT32 Testcase(VOID) CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH + 1] = {0}; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; - pthread_t newTh; struct mq_attr attr = { 0 }; struct timespec ts = { 0 }; mqd_t mqueue; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_202.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_202.cpp index 71e2430965755890a1a0c1cc35b81b0236138871..959f2a0d80e0cddf01e6860fbb6e18503163a02a 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_202.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_202.cpp @@ -36,7 +36,6 @@ static UINT32 Testcase(VOID) CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; mqd_t mqueue; - struct timespec ts; struct mq_attr attr = { 0 }; snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq202_%d", LosCurTaskIDGet()); diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_203.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_203.cpp index 09e36c39d04fb90ae3b64e5018cd68cde409f1e1..429d981bc4e3604857231eb60f66c2522f788b75 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_203.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_203.cpp @@ -35,8 +35,7 @@ static UINT32 Testcase(VOID) CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = {0}; CHAR msgrv1[MQUEUE_STANDARD_NAME_LENGTH] = {0}; struct mq_attr attr = { 0 }; - INT32 ret = MQUEUE_NO_ERROR, i; - pthread_t pthread1, pthread2; + INT32 ret = MQUEUE_NO_ERROR; mqd_t mqueue1, mqueue2; struct timespec ts; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_204.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_204.cpp index 1f24ce2cf2b32e3a5b7f5735f4514662cba234e3..3da07a023d9f6c1cbc48e17d0df41db0c0c3a68e 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_204.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_204.cpp @@ -40,7 +40,6 @@ static void *PthreadF01(void *arg) while (g_itSync != 1) { } - struct mqarray *ptrMqcb = (struct mqarray *)NULL; g_mqueue1 = mq_open(g_mqname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR, &g_attr); LosTaskDelay(2); // 2, Set delay time. if (g_mqueue1 != -1) { @@ -54,7 +53,6 @@ static void *PthreadF02(void *arg) { g_itSync = 1; - struct mqarray *ptrMqcb = (struct mqarray *)NULL; g_mqueue2 = mq_open(g_mqname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR, &g_attr); LosTaskDelay(2); // 2, Set delay time. if (g_mqueue2 != -1) { @@ -70,7 +68,7 @@ EXIT: STATIC UINT32 Testcase(VOID) { - INT32 ret = MQUEUE_NO_ERROR, i; + INT32 ret = MQUEUE_NO_ERROR; pthread_t pthread1, pthread2; pthread_attr_t attr1, attr2; diff --git a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_209.cpp b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_209.cpp index 8bfe39091d1161efbcab978f7b4c7e52bd6391f7..f02dfbec42f48993336c5480b5f70446a178638d 100644 --- a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_209.cpp +++ b/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_209.cpp @@ -72,7 +72,6 @@ static void Child(void) struct sigevent sigev = {0}; pthread_t pthread1; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; - CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; struct mq_attr attr = {0}; attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; diff --git a/testsuites/unittest/libc/time/clock/full/clock_test_002.cpp b/testsuites/unittest/libc/time/clock/full/clock_test_002.cpp index f951d87871ad5fb8827a589fc27e3c98d0c45031..5bff0d8ec5428160ee0f7d7a7fa8852d07972423 100644 --- a/testsuites/unittest/libc/time/clock/full/clock_test_002.cpp +++ b/testsuites/unittest/libc/time/clock/full/clock_test_002.cpp @@ -56,7 +56,6 @@ static int ClockTest(void) pthread_t thread; clockid_t clockid; int ret; - struct timespec ts; ret = pthread_create(&thread, NULL, ThreadFuncTest, 0); ICUNIT_ASSERT_EQUAL(ret, 0, ret); diff --git a/testsuites/unittest/libc/time/clock/full/clock_test_003.cpp b/testsuites/unittest/libc/time/clock/full/clock_test_003.cpp index d37ae98bdad8c1b2f41eb26135b8180f4469d0a7..71db84a1ed74d60c9ee82c5417a73a7025881320 100644 --- a/testsuites/unittest/libc/time/clock/full/clock_test_003.cpp +++ b/testsuites/unittest/libc/time/clock/full/clock_test_003.cpp @@ -36,7 +36,6 @@ static int ClockTest(void) struct timespec ts; int ret; pid_t pid = 0; - int passflag = 0; /* get kernel process 1 clockid */ pid = 1; diff --git a/testsuites/unittest/libc/time/clock/full/clock_test_004.cpp b/testsuites/unittest/libc/time/clock/full/clock_test_004.cpp index 5add0e142d74100d55485c6314e5adaab0230f49..894cceb9856e5454357d2a74b3a4f17b49f334c3 100644 --- a/testsuites/unittest/libc/time/clock/full/clock_test_004.cpp +++ b/testsuites/unittest/libc/time/clock/full/clock_test_004.cpp @@ -32,8 +32,6 @@ static int ClockTest(void) { - pthread_t thread; - clockid_t clockid; int ret; struct timespec ts; diff --git a/testsuites/unittest/libc/time/clock/full/clock_test_005.cpp b/testsuites/unittest/libc/time/clock/full/clock_test_005.cpp index 8db361ac68a32f7083735fa66ba610b14bd4eb53..249cb5b43a34dd6e161832fc0a1b55b12a3351b9 100644 --- a/testsuites/unittest/libc/time/clock/full/clock_test_005.cpp +++ b/testsuites/unittest/libc/time/clock/full/clock_test_005.cpp @@ -33,7 +33,6 @@ static int ClockTest(void) { clockid_t clockid; - struct timespec ts; int ret; pid_t pid = 0; diff --git a/testsuites/unittest/libc/time/timer/smoke/timer_test_005.cpp b/testsuites/unittest/libc/time/timer/smoke/timer_test_005.cpp index 4c739f748495810737179f768a82f49669cf0a87..5159a6e954e8b8da079469b8c6f7692e801aae75 100644 --- a/testsuites/unittest/libc/time/timer/smoke/timer_test_005.cpp +++ b/testsuites/unittest/libc/time/timer/smoke/timer_test_005.cpp @@ -39,7 +39,6 @@ static int g_sigHdlCnt01; static int g_sigHdlCnt02; -static int g_sigHdlCnt03; static void TempSigHandler(union sigval v) { @@ -59,11 +58,10 @@ static void TempSigHandler02(void) static int TimerTest(void) { - timer_t timerid01, timerid02, timerid03; + timer_t timerid01, timerid02; struct sigevent sev; struct itimerspec its; int ret; - int i; (void)memset(&sev, 0, sizeof(struct sigevent)); sev.sigev_notify = SIGEV_THREAD; diff --git a/testsuites/unittest/libc/util/smoke/util_test_001.cpp b/testsuites/unittest/libc/util/smoke/util_test_001.cpp index 06a544510ca6ec21d49e436850df62384a9a4370..f6dc71cfbbceecb3bd970899d4d9abd6f7e1f74d 100644 --- a/testsuites/unittest/libc/util/smoke/util_test_001.cpp +++ b/testsuites/unittest/libc/util/smoke/util_test_001.cpp @@ -44,7 +44,6 @@ static UINT32 TestCase(VOID) INT32 ret, i; INT32 argc = ARGC_NUM; CHAR *argv[] = {"test", "-b", "-a", "-c", NULL}; - CHAR *ptr = NULL; CHAR * const shortOptions = "abc"; for (i = 0; (ret = getopt_long(argc, argv, shortOptions, g_longOptions, NULL)) != -1; i++) { diff --git a/testsuites/unittest/libc/util/smoke/util_test_002.cpp b/testsuites/unittest/libc/util/smoke/util_test_002.cpp index fee8059b4696ca77e5a8e5d69850decbac176d68..9aa1ff1bdab8460c50d4af2a668262406e7253bd 100644 --- a/testsuites/unittest/libc/util/smoke/util_test_002.cpp +++ b/testsuites/unittest/libc/util/smoke/util_test_002.cpp @@ -44,7 +44,6 @@ static UINT32 TestCase(VOID) INT32 ret, i; INT32 argc = ARGC_NUM; CHAR *argv[] = {"test", "-b", "-a", "-c", NULL}; - CHAR *ptr = NULL; CHAR * const shortOptions = "abc"; for (i = 0; (ret = getopt_long_only(argc, argv, shortOptions, g_longOptions, NULL)) != -1; i++) { diff --git a/testsuites/unittest/net/resolv/smoke/net_resolv_test_002.cpp b/testsuites/unittest/net/resolv/smoke/net_resolv_test_002.cpp index 4e5701998143fbe31ca32bef07b3a5c2b82c05d1..5ecbeddcb474a8ff6202b510cfbd31c175fda98e 100644 --- a/testsuites/unittest/net/resolv/smoke/net_resolv_test_002.cpp +++ b/testsuites/unittest/net/resolv/smoke/net_resolv_test_002.cpp @@ -40,7 +40,7 @@ static int EtherAtonTest(void) ICUNIT_ASSERT_EQUAL(eaddr, NULL, -1); - char mac_addr[buffer_size], *tmp = mac_addr; + char mac_addr[buffer_size]; int r[ETH_ALEN]; srand(time(NULL)); for (int i = 0; i < ETH_ALEN; i++) { diff --git a/testsuites/unittest/net/resolv/smoke/net_resolv_test_003.cpp b/testsuites/unittest/net/resolv/smoke/net_resolv_test_003.cpp index 85929a8bde61dc32285f1b0826c8ff3c0a37a88a..523a85b63efd32f3ddd6214b6fc2e1588e094eee 100644 --- a/testsuites/unittest/net/resolv/smoke/net_resolv_test_003.cpp +++ b/testsuites/unittest/net/resolv/smoke/net_resolv_test_003.cpp @@ -41,7 +41,7 @@ static int EtherAtonrTest(void) ICUNIT_ASSERT_EQUAL(eaddr, NULL, -1); - char mac_addr[buffer_size], *tmp = mac_addr; + char mac_addr[buffer_size]; int r[ETH_ALEN]; srand(time(NULL)); for (int i = 0; i < ETH_ALEN; i++) { diff --git a/testsuites/unittest/net/socket/smoke/net_socket_test_002.cpp b/testsuites/unittest/net/socket/smoke/net_socket_test_002.cpp index 20d2193c8a15896f9f375916e4a49644e1706b6e..c7bf060a73dea956a65cd7ce858219c102b613da 100644 --- a/testsuites/unittest/net/socket/smoke/net_socket_test_002.cpp +++ b/testsuites/unittest/net/socket/smoke/net_socket_test_002.cpp @@ -53,7 +53,7 @@ static int UdpTest(void) struct sockaddr_in srvAddr = { 0 }; struct sockaddr_in clnAddr = { 0 }; socklen_t clnAddrLen = sizeof(clnAddr); - int ret = 0, i = 0; + int ret = 0; struct msghdr msg = { 0 }; struct iovec iov[2] = { }; diff --git a/testsuites/unittest/net/socket/smoke/net_socket_test_003.cpp b/testsuites/unittest/net/socket/smoke/net_socket_test_003.cpp index 925002140819471b28721677d8d594d9276fcb0c..fb71ea1910cf5b5e0792d0c58247467e992064cf 100644 --- a/testsuites/unittest/net/socket/smoke/net_socket_test_003.cpp +++ b/testsuites/unittest/net/socket/smoke/net_socket_test_003.cpp @@ -58,7 +58,7 @@ static int SampleTcpServer() socklen_t clnAddrLen = sizeof(clnAddr); struct msghdr msg = { 0 }; struct iovec iov[2] = { }; - int ret = 0, i = 0; + int ret = 0; /* tcp server */ lsfd = socket(AF_INET, SOCK_STREAM, 0); @@ -158,8 +158,7 @@ static int SampleTcpClient() int sfd = -1; struct sockaddr_in srvAddr = { 0 }; struct sockaddr_in clnAddr = { 0 }; - socklen_t clnAddrLen = sizeof(clnAddr); - int ret = 0, i = 0; + int ret = 0; struct msghdr msg = { 0 }; struct iovec iov[2] = { }; struct sockaddr addr; diff --git a/testsuites/unittest/process/basic/process/full/process_test_007.cpp b/testsuites/unittest/process/basic/process/full/process_test_007.cpp index 58587ca98f5d5d49509aaeda7696e75186ed2d02..05e20e231f20c6ffa1af3296d0e6a8d9d67c9c78 100644 --- a/testsuites/unittest/process/basic/process/full/process_test_007.cpp +++ b/testsuites/unittest/process/basic/process/full/process_test_007.cpp @@ -40,12 +40,8 @@ static void *ThreadFunc2(void *arg) static int ProcessTest001(void) { int ret; - int status; - int pid; int data; - int pri; - pthread_t newPthread, newPthread1; - int count = 4; + pthread_t newPthread; int currProcessPri = getpriority(PRIO_PROCESS, getpid()); ICUNIT_ASSERT_WITHIN_EQUAL(currProcessPri, 0, 31, currProcessPri); // 31, assert that function Result is equal to this. diff --git a/testsuites/unittest/process/basic/process/full/process_test_036.cpp b/testsuites/unittest/process/basic/process/full/process_test_036.cpp index 1d8efc7628a6aa1b5bbf2aa0cb7954a554a54fca..d4ef6b40e4d8e875027a41ab250621aeebedc5ef 100644 --- a/testsuites/unittest/process/basic/process/full/process_test_036.cpp +++ b/testsuites/unittest/process/basic/process/full/process_test_036.cpp @@ -119,8 +119,7 @@ static int TestCase(void) { int ret; int status = 0; - pid_t pid, pid1; - int currGid = getpgrp(); + pid_t pid; pid = fork(); ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. diff --git a/testsuites/unittest/process/basic/process/full/process_test_037.cpp b/testsuites/unittest/process/basic/process/full/process_test_037.cpp index 29f8c6a49d248fb04c67e88d1226fe043acb280e..cd63bb2b99ee3bd0f52939b6c4fe7f6440099959 100644 --- a/testsuites/unittest/process/basic/process/full/process_test_037.cpp +++ b/testsuites/unittest/process/basic/process/full/process_test_037.cpp @@ -117,8 +117,7 @@ static int TestCase(void) { int ret; int status = 0; - pid_t pid, pid1; - int currGid = getpgrp(); + pid_t pid; pid = fork(); ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. diff --git a/testsuites/unittest/process/basic/process/full/process_test_040.cpp b/testsuites/unittest/process/basic/process/full/process_test_040.cpp index cadf457c122d7776064a9a1a3982753942e11661..6f9c8530a544a4e1841c4ee5e0584d0984583cb9 100644 --- a/testsuites/unittest/process/basic/process/full/process_test_040.cpp +++ b/testsuites/unittest/process/basic/process/full/process_test_040.cpp @@ -34,11 +34,9 @@ static int GroupProcess(void) { int ret; int status = 0; - pid_t pid, pid1; + pid_t pid; int count = 1000; - int waitProcess = 0; int testPid; - bool thread = false; int processCount = 0; for (int i = 0; i < count; i++) { @@ -81,8 +79,7 @@ static int TestCase(void) { int ret; int status = 0; - pid_t pid, pid1; - int currGid = getpgrp(); + pid_t pid; pid = fork(); ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. diff --git a/testsuites/unittest/process/basic/process/full/process_test_041.cpp b/testsuites/unittest/process/basic/process/full/process_test_041.cpp index d2356961583bdb479639145083aa71651ba1301e..a3fff21dcef09dbe8c2e0eae7a6cfabee3c64328 100644 --- a/testsuites/unittest/process/basic/process/full/process_test_041.cpp +++ b/testsuites/unittest/process/basic/process/full/process_test_041.cpp @@ -41,13 +41,11 @@ static int GroupProcess(void) int testPid; int ret; int status = 0; - pid_t pid, pid1; + pid_t pid; int count = 500; - int waitProcess = 0; pthread_attr_t a = { 0 }; pthread_t pthread[1000] = { 0 }; struct sched_param param = { 0 }; - bool thread = false; int processCount = 0; @@ -105,7 +103,7 @@ static int TestCase(void) { int ret; int status = 0; - pid_t pid, pid1; + pid_t pid; pid = fork(); ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. diff --git a/testsuites/unittest/process/basic/process/full/process_test_042.cpp b/testsuites/unittest/process/basic/process/full/process_test_042.cpp index 188cdf79d920be42ff56a4fb0959052de3fd2678..23f370bc315299f3a9c0ccc5b2664e351ffb59a6 100644 --- a/testsuites/unittest/process/basic/process/full/process_test_042.cpp +++ b/testsuites/unittest/process/basic/process/full/process_test_042.cpp @@ -31,7 +31,6 @@ #include "it_test_process.h" #include "sys/shm.h" -static const int TEST_THREAD = 40; static const int TEST_LOOP = 3000; static void Child2(int shmid) @@ -72,7 +71,6 @@ static void Child1(int shmid) static int GroupProcess(void) { - int testPid; int ret; int policy = 0; struct sched_param param = { 0 }; @@ -148,7 +146,7 @@ static int TestCase(void) { int ret; int status = 0; - pid_t pid, pid1; + pid_t pid; int temp = GetCpuCount(); if (temp != 1) { diff --git a/testsuites/unittest/process/basic/process/full/process_test_055.cpp b/testsuites/unittest/process/basic/process/full/process_test_055.cpp index 30ce7ed182f7c5fc799b5d21bfee7297d01fdf97..c661bbbd2666e6c9965e5df3da0364f94f16d3e2 100644 --- a/testsuites/unittest/process/basic/process/full/process_test_055.cpp +++ b/testsuites/unittest/process/basic/process/full/process_test_055.cpp @@ -56,7 +56,6 @@ EXIT: static int TestCase(void) { pid_t pid; - int status; int ret; pid = fork(); diff --git a/testsuites/unittest/process/basic/process/full/process_test_060.cpp b/testsuites/unittest/process/basic/process/full/process_test_060.cpp index 6f96f65c077478989b0d7e6cfcd54a62fb207ab0..0ed960c995c207cf2445124f9db88cc6732a4085 100644 --- a/testsuites/unittest/process/basic/process/full/process_test_060.cpp +++ b/testsuites/unittest/process/basic/process/full/process_test_060.cpp @@ -88,9 +88,7 @@ static int TestPrioError(void) } static int TestCase(void) { - pid_t pid; posix_spawnattr_t attr; - int status = 1; int ret; posix_spawnattr_init(&attr); diff --git a/testsuites/unittest/process/basic/process/full/process_test_063.cpp b/testsuites/unittest/process/basic/process/full/process_test_063.cpp index d68956531f7a127385d4753391fd91c03df9e6ac..85047bf75368552ae51c3ce00920d8bc3605ca34 100644 --- a/testsuites/unittest/process/basic/process/full/process_test_063.cpp +++ b/testsuites/unittest/process/basic/process/full/process_test_063.cpp @@ -63,7 +63,6 @@ static void GetRandomData(char **buf, int bufSize) static int TestCase(VOID) { int ret; - int err; pid_t pid; char *fileName = NULL; char *childFileName = NULL; diff --git a/testsuites/unittest/process/basic/process/full/process_test_064.cpp b/testsuites/unittest/process/basic/process/full/process_test_064.cpp index 3b84cbbb1828e20f0974ed6a24cee8a4ab57829a..09dd18911bbc4e23c19434b98de53f42a2856606 100644 --- a/testsuites/unittest/process/basic/process/full/process_test_064.cpp +++ b/testsuites/unittest/process/basic/process/full/process_test_064.cpp @@ -34,7 +34,6 @@ static const int FILE_NAME_BYTES = 200; // 200, set test name len. static const int LONG_FILE_NAME_BYTES = 500; // 500, set test name len. static const int RANDOM_MAX = 127; // 127, set random max. -static const unsigned int INVALID_USER_VADDR = 0x1200000; static int GetRandomNumber(int max) { @@ -63,10 +62,8 @@ static void GetRandomData(char **buf, int bufSize) static int TestCase(VOID) { int ret; - int err; pid_t pid; char *fileName = NULL; - char *childFileName = NULL; char **childArgv = NULL; char **childEnvp = NULL; diff --git a/testsuites/unittest/process/basic/process/full/process_test_065.cpp b/testsuites/unittest/process/basic/process/full/process_test_065.cpp index 15f3fd82ee182e7cecfadfbbb74b5cfec9e03f07..864c75869f7b6a1107efe7ec40ec5f5ab79caf2f 100644 --- a/testsuites/unittest/process/basic/process/full/process_test_065.cpp +++ b/testsuites/unittest/process/basic/process/full/process_test_065.cpp @@ -86,9 +86,7 @@ static int TestPrioError(void) } static int TestCase(void) { - pid_t pid; posix_spawnattr_t attr; - int status = 1; int ret; posix_spawnattr_init(&attr); diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_001.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_001.cpp index 2900a1e10d9da966025d9c12889d16e73f1be5a6..af5ceced73d7dd6ef049210e3f5d5c295768f94a 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_001.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_001.cpp @@ -30,16 +30,14 @@ */ #include "it_test_process.h" - + static const int PROCESS_PRIORITY_MAX = 10; static const int PROCESS_PRIORITY_MIN = 31; -static const int PROCESS_SCHED_RR_INTERVAL = 20000000; static int Testcase(VOID) { int ret; struct sched_param param = { 0 }; - struct timespec ts = { 0 }; int err; ret = sched_getparam(getpid(), NULL); err = errno; diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_005.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_005.cpp index 8a94237b4666a66fb182c90446c149f86bfbe83a..cc4de024be3fdbd66e6b42f5c11105d5b2f6fb6c 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_005.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_005.cpp @@ -120,7 +120,6 @@ static int ProcessTest002(void) static int ProcessTest001(int *id) { int ret; - int status; int pid; pid = fork(); diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_006.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_006.cpp index 909c4e7433f5b1f9844a1e87a5530fe86b741794..bbfe94c5ed48e353e9ee14e8bf63c84c0319be15 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_006.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_006.cpp @@ -49,11 +49,7 @@ static int ProcessTest001(void) int status = 0; int pid, pid1; int data; - int pri; - pthread_t newPthread, newPthread1; - int count = 4; - pthread_attr_t a = { 0 }; - struct sched_param param = { 0 }; + pthread_t newPthread; int currProcessPri = getpriority(PRIO_PROCESS, getpid()); ICUNIT_ASSERT_WITHIN_EQUAL(currProcessPri, 0, 31, currProcessPri); // 31, assert that function Result is equal to this. diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_008.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_008.cpp index c7245658dd1224322f1a359b428b96b3cfd53fa5..405f9ea7a06050b8a8ce823b2e77196e70064531 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_008.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_008.cpp @@ -46,13 +46,9 @@ static void *ThreadFunc3(void *arg) static int ProcessTest001(void) { int ret; - int status; - int pid; int policy = 0; int data; - int pri; - pthread_t newPthread, newPthread1; - int count = 4; + pthread_t newPthread; pthread_attr_t a = { 0 }; struct sched_param param = { 0 }; int currProcessPri = getpriority(PRIO_PROCESS, getpid()); diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_009.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_009.cpp index ac38c08f735ceebab8b530ecab293ece4c1fb606..66155d834b2332513fdaa993a70238542ccec4ea 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_009.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_009.cpp @@ -41,12 +41,7 @@ static int ProcessTest001(void) int ret; int status = 0; int pid; - int data; - int pri; - pthread_t newPthread, newPthread1; - int count = 4; - pthread_attr_t a = { 0 }; - struct sched_param param = { 0 }; + pthread_t newPthread; int currProcessPri = getpriority(PRIO_PROCESS, getpid()); ICUNIT_ASSERT_WITHIN_EQUAL(currProcessPri, 0, 31, currProcessPri); // 31, assert that function Result is equal to this. diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_010.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_010.cpp index d8fc46e552fef53d9ba56f1fa87e09b69b7a63ad..d699db122567382ae226807eacc100d198e7a997 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_010.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_010.cpp @@ -37,10 +37,8 @@ static void *ThreadFunc2(void *arg) {} static int ProcessTest001(void) { int ret; - int status; - int pid; int data; - pthread_t newPthread, newPthread1; + pthread_t newPthread; int currProcessPri = getpriority(PRIO_PROCESS, getpid()); ICUNIT_ASSERT_WITHIN_EQUAL(currProcessPri, 0, 31, currProcessPri); // 31, assert currProcessPri equal to this. diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_011.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_011.cpp index 2e86789e17973dcd43b88e899983758eacae2e63..9ff5c53308d122625c63f699e93abeed658be093 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_011.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_011.cpp @@ -74,7 +74,6 @@ EXIT: static int TestCase(void) { int ret; - int status = 100; pthread_t newPthread; g_testThreadExit = 0; diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_012.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_012.cpp index ea2041951d93dbb1148061a38e6684a22f5b82de..07eb9443bc95d7254b98cfdb98175ce194a56e80 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_012.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_012.cpp @@ -105,7 +105,6 @@ EXIT: static int TestCase(void) { int ret; - int status = 100; pthread_t newPthread; g_testThreadExit = 0; diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_015.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_015.cpp index 967a68ff08b5a1ee24a29511eb9017d6e1e77bc5..13f904ec67f2e6cad981fd926fc8e0e3f05c5d92 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_015.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_015.cpp @@ -33,7 +33,6 @@ static int g_testThreadExit = 0; static int g_testExit = 0; static int g_waitPid; -static int g_backPid; static void *ThreadFunc(void *arg) { @@ -54,7 +53,6 @@ static int ProcessTest(void) int status = 100; pthread_t newPthread; pid_t pid; - int count = 0; g_testThreadExit = 0; g_testExit = 0; g_waitPid = 0; diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_016.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_016.cpp index 32394bdfd2d262016568e858a2f1cc653d1d8685..f28df843fc1c8f59404030138e0593a3298abffc 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_016.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_016.cpp @@ -33,7 +33,6 @@ static int g_testThreadExit = 0; static int g_testExit = 0; static int g_waitPid; -static int g_backPid; static void *ThreadFunc(void *arg) { diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_017.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_017.cpp index 7519aeccfe25fcb07e596db068b7df13e3559622..676213122939a30978a7eb02f07a9e6999947f06 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_017.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_017.cpp @@ -33,7 +33,6 @@ static int g_testThreadExit = 0; static int g_testExit = 0; static int g_waitPid; -static int g_backPid; static void *ThreadFunc(void *arg) { @@ -56,7 +55,6 @@ static int ProcessTest(void) int status = 100; pthread_t newPthread; pid_t pid; - int count = 0; g_testThreadExit = 0; g_testExit = 0; diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_018.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_018.cpp index 8e92d18581dafaac95600512c7a652ded39b8dc6..9d575a1b90a4d2ce1a7cb0b1fb6202387c7d876a 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_018.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_018.cpp @@ -33,7 +33,6 @@ static int g_testThreadExit = 0; static int g_testExit = 0; static int g_waitPid; -static int g_backPid; static void *ThreadFunc(void *arg) { @@ -53,7 +52,7 @@ static int ProcessTest(void) int ret; int status = 100; pthread_t newPthread; - pid_t pid, pid1, pid2; + pid_t pid, pid1; int count = 0; g_testThreadExit = 0; g_testExit = 0; diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_019.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_019.cpp index c51b59d8a648bc9ed42ce268ba2ae3a82803981f..47204706ae8e21844836c2d1420315bc303a9a61 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_019.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_019.cpp @@ -30,10 +30,7 @@ */ #include "it_test_process.h" -static int g_testThreadExit = 0; -static int g_testExit = 0; static int g_waitPid; -static int g_backPid; static void *ThreadFunc(void *arg) { @@ -53,7 +50,7 @@ static int ProcessTest(void) int ret; int status = 100; pthread_t newPthread; - pid_t pid, pid1, pid2; + pid_t pid, pid1; int count = 0; pid = fork(); diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_020.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_020.cpp index 16701c6e346313651e39039ecd34dbdc5ce67826..ab7474e39468aa9e93eb4921e2d0d75c2929a90e 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_020.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_020.cpp @@ -60,7 +60,7 @@ static int ProcessTest(void) int ret; int status = 100; pthread_t newPthread; - pid_t pid, pid1, pid2; + pid_t pid, pid1; int count = 0; g_waitPid = 0; diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_021.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_021.cpp index 792996c786c5fcad8cf84e4e368bea00c378f2f6..3ee104ac123de78113983aa8af0315ff73ddcd17 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_021.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_021.cpp @@ -89,7 +89,7 @@ static int ProcessTest(void) int ret; int status = 100; pthread_t newPthread, newPthread1; - pid_t pid, pid1, pid2; + pid_t pid, pid1; int count = 0; g_errorFalg = 0; diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_022.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_022.cpp index 10d9c11205a170767db37a54f368d4d53c4f227f..251eb810116730a5f23c8525ed85433cf32ef19c 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_022.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_022.cpp @@ -30,7 +30,6 @@ */ #include "it_test_process.h" -static int g_waitPid; static int g_backPid; static int g_backPid1; @@ -70,7 +69,6 @@ static int ProcessTest(void) int status = 100; pthread_t newPthread, newPthread1; pid_t pid, pid1, pid2; - int count = 0; ret = setpgrp(); ICUNIT_ASSERT_EQUAL(ret, 0, ret); diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_023.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_023.cpp index 578b9f183d0ede1fe1a1e65c9f29a8a77e52454e..b4c32d1b8b81961bb8ddf52d40ff74ec4364697d 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_023.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_023.cpp @@ -30,7 +30,6 @@ */ #include "it_test_process.h" -static int g_waitPid; static int g_backPid; static int g_backPid1; @@ -69,11 +68,9 @@ EXIT: static int ProcessTest(void) { int ret; - int *error = nullptr; int status = 100; pthread_t newPthread, newPthread1; pid_t pid, pid1, pid2; - int count = 0; g_thread001 = 0; g_thread002 = 0; diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_024.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_024.cpp index ed92786862173522ce050bcc77b130724c2dec20..36c12ae10456f502dd9429a9a81dbb8be85bc5bc 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_024.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_024.cpp @@ -30,12 +30,12 @@ */ #include "it_test_process.h" -static int g_waitPid; static int g_backPid; static int g_backPid1; static int g_thread001; static int g_thread002; + static void *ThreadFunc(void *arg) { int status = 0; @@ -68,7 +68,6 @@ static int ProcessTest(void) int status = 100; pthread_t newPthread, newPthread1; pid_t pid, pid1, pid2; - int count = 0; g_thread001 = 0; g_thread002 = 0; diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_025.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_025.cpp index 631ac97d3429686f3708e1ec66c45a2fbf733a2e..37e15acc64306d80f30e462407cfa41dea961093 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_025.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_025.cpp @@ -30,12 +30,12 @@ */ #include "it_test_process.h" -static int g_waitPid; static int g_backPid; static int g_backPid1; static int g_thread001; static int g_thread002; + static void *ThreadFunc(void *arg) { int status = 0; @@ -73,7 +73,6 @@ static int ProcessTest(void) int status = 100; pthread_t newPthread, newPthread1; pid_t pid, pid1, pid2; - int count = 0; g_thread001 = 0; g_thread002 = 0; diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_027.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_027.cpp index a1d77e38ceee1823f1b8394dcafe51ce4bef495f..5ae84dd870c98efd02dfa00c8f260c6ec83e86a5 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_027.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_027.cpp @@ -34,9 +34,7 @@ static int ProcessTest(void) { int ret; int status = 100; - pthread_t newPthread; pid_t pid; - int count = 0; pid = fork(); ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_029.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_029.cpp index 71424851dfe7e30002954dffad75636470116ed6..990c9bf6cc808f80d0f9b63a64525bc3bdeceb79 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_029.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_029.cpp @@ -45,7 +45,7 @@ static int TestCase(void) { int ret; int status = 0; - pid_t pid, pid1; + pid_t pid; int currGid = getpgrp(); pid = fork(); ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_030.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_030.cpp index e37b26f8e2cc89818c7f5a8451ad21424d887ac8..1cfce825cd86b7552e22efec44535f4ceae7fdf4 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_030.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_030.cpp @@ -48,7 +48,7 @@ static int TestCase(void) { int ret; int status = 0; - pid_t pid, pid1; + pid_t pid; int currGid = getpgrp(); pid = fork(); ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_038.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_038.cpp index c8cbeba29ed48fcb770bc0757b8077897981202f..37a48845239d516ff75dbb7494bdd6954c426c3a 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_038.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_038.cpp @@ -47,7 +47,6 @@ static int Child2(int currGid, int gid) static int ProcessGroup(void) { int ret; - int status = 0; pid_t pid, pid1; int currGid = getpgrp(); @@ -84,8 +83,7 @@ static int GroupProcess(void) { int ret; int status = 0; - pid_t pid, pid1; - int currGid = getpgrp(); + pid_t pid; int count = 30; while (count > 0) { @@ -116,8 +114,7 @@ static int TestCase(void) { int ret; int status = 0; - pid_t pid, pid1; - int currGid = getpgrp(); + pid_t pid; pid = fork(); ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_039.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_039.cpp index 2abc9e68d9430db8d7b670d4d5453234c7ea6659..507d61998609e2c405a6d18d82e8d91720634efe 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_039.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_039.cpp @@ -34,7 +34,7 @@ static int GroupProcess(void) { int ret; int status = 0; - pid_t pid, pid1; + pid_t pid; int count = 1000; for (int i = 0; i < count; i++) { @@ -58,8 +58,8 @@ static int TestCase(void) { int ret; int status = 0; - pid_t pid, pid1; - int currGid = getpgrp(); + pid_t pid; + pid = fork(); ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_044.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_044.cpp index 08995680b67b825187ec5e10e518adb460af2745..d46eff1e7b494cac424b92c3b3a662078ed66d2c 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_044.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_044.cpp @@ -43,8 +43,6 @@ static void *ThreadFuncTest3(void *arg) static int GroupProcess(void) { int ret; - int status = 0; - pid_t pid, pid1; pthread_t newPthread; struct timespec ts = { 0 }; @@ -74,8 +72,7 @@ static int TestCase(void) { int ret; int status = 0; - pid_t pid, pid1; - int currGid = getpgrp(); + pid_t pid; pid = fork(); ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. diff --git a/testsuites/unittest/process/basic/process/smoke/process_test_054.cpp b/testsuites/unittest/process/basic/process/smoke/process_test_054.cpp index 6de1aec023896680388f93a308c8f1c75b625e2b..662a1fc32d4163fde1611d787598c3304f4a9ccd 100644 --- a/testsuites/unittest/process/basic/process/smoke/process_test_054.cpp +++ b/testsuites/unittest/process/basic/process/smoke/process_test_054.cpp @@ -33,7 +33,6 @@ static int TestCase(void) { int ret; - int pid = 3; siginfo_t info = { 0 }; ret = waitid((idtype_t)3, getpgrp(), &info, WEXITED); // 3, set tid. diff --git a/testsuites/unittest/process/basic/pthread/full/pthread_test_001.cpp b/testsuites/unittest/process/basic/pthread/full/pthread_test_001.cpp index 8c95f11f13684558a81edfeaaf15254665b6631e..36bc868e79a5f4cb5cd7e6bc9e6203b51dda4f35 100644 --- a/testsuites/unittest/process/basic/pthread/full/pthread_test_001.cpp +++ b/testsuites/unittest/process/basic/pthread/full/pthread_test_001.cpp @@ -36,7 +36,6 @@ static int g_threadTestCount1 = 0; static void *ThreadFunc5(void *ptr) { - pid_t pid = getpid(); int ret; ICUNIT_GOTO_EQUAL(g_threadTestCount1, 2, g_threadTestCount1, EXIT); // 2, here assert the result. @@ -54,7 +53,6 @@ static void *ThreadFunc4(void *arg) pthread_t pthread = pthread_self(); int i = 0; unsigned int ret; - pid_t pid = getpid(); ICUNIT_GOTO_EQUAL(g_pthreadTestCount, 9, g_pthreadTestCount, EXIT); // 9, here assert the result. g_pthreadTestCount++; // 10 @@ -82,7 +80,6 @@ static void *ThreadFunc3(void *arg) pthread_t pthread = pthread_self(); int i = 0; unsigned int ret; - pid_t pid = getpid(); g_pthreadTestCount++; // 7 @@ -107,8 +104,6 @@ EXIT: static void *ThreadFunc2(void *arg) { - pthread_t pthread = pthread_self(); - pid_t pid = getpid(); unsigned int ret; ICUNIT_GOTO_EQUAL(g_pthreadTestCount, 3, g_pthreadTestCount, EXIT); // 3, here assert the result. @@ -127,8 +122,6 @@ EXIT: static void *ThreadFunc6(void *arg) { - pid_t pid = getpid(); - ICUNIT_GOTO_EQUAL(g_pthreadTestCount, 12, g_pthreadTestCount, EXIT); // 12, here assert the result. g_pthreadTestCount++; // 13 @@ -145,7 +138,6 @@ static void *ThreadFunc(void *arg) pthread_attr_t a = { 0 }; pthread_t newPthread; struct sched_param param = { 0 }; - pid_t pid = getpid(); int curThreadPri, curThreadPolicy; ICUNIT_GOTO_EQUAL(g_pthreadTestCount, 2, g_pthreadTestCount, EXIT); // 2, here assert the result. @@ -213,7 +205,6 @@ int PthreadTest001() void *res = NULL; pthread_attr_t a = { 0 }; pthread_t newPthread, newPthread1; - int count = 0xf0000; g_threadTestCount1 = 0; g_pthreadTestCount = 0; diff --git a/testsuites/unittest/process/basic/pthread/full/pthread_test_002.cpp b/testsuites/unittest/process/basic/pthread/full/pthread_test_002.cpp index 9df31cc1395262e7ae6877a432591cdf4608e966..a73b956d6cc4ff29ddba0adf2f21221ed054bcdd 100644 --- a/testsuites/unittest/process/basic/pthread/full/pthread_test_002.cpp +++ b/testsuites/unittest/process/basic/pthread/full/pthread_test_002.cpp @@ -52,7 +52,7 @@ static void *ThreadFuncTest2(void *arg) (void)arg; int ret; struct sched_param param = { 0 }; - int threadPolicy, threadPri; + int threadPolicy; int old; const int waitCount1 = 20; const int waitCount2 = 50; @@ -113,7 +113,7 @@ static void *ThreadFuncTest3(void *arg) { (void)arg; struct sched_param param = { 0 }; - int threadPolicy, threadPri; + int threadPolicy; int ret; int old = 0; const int waitCount1 = 20; diff --git a/testsuites/unittest/process/basic/pthread/full/pthread_test_014.cpp b/testsuites/unittest/process/basic/pthread/full/pthread_test_014.cpp index bdabbaf727792341cf43aac667524cf70d3343d9..df2b026c7079264b33587aa3295c29aa4216bbaa 100644 --- a/testsuites/unittest/process/basic/pthread/full/pthread_test_014.cpp +++ b/testsuites/unittest/process/basic/pthread/full/pthread_test_014.cpp @@ -102,8 +102,6 @@ static int TestCase(void) { int ret; pthread_t tid, tid1, tid2, tid3; - pthread_attr_t attr = { 0 }; - int scope = 0; int threadPolicy = 0; struct sched_param param = { 0 }; diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_001.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_001.cpp index 9c3a3a3c6eee582d3a12752880bc09106f538ab3..593f61d4487edbdc3f8f26fcd638a0b5d7da8446 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_001.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_001.cpp @@ -113,7 +113,7 @@ static void *PthreadAtforkTest(void *arg) if (pid == 0) { ICUNIT_GOTO_EQUAL(g_testAtforkChild, 1, g_testAtforkChild, EXIT); - int status; + while (g_count < 5) { // 5, wait until g_count == 5. err = pthread_mutex_lock(&g_lock); ICUNIT_GOTO_EQUAL(err, 0, err, EXIT); diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_002.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_002.cpp index 018d6139c25c129b4b281ac514fd8005258fcacf..3dddb6dbc204613b65e3d469899184c097b59768 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_002.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_002.cpp @@ -92,7 +92,7 @@ static void Parent(void) static void *PthreadAtforkTest(void *arg) { - int err, ret; + int err; int pid; int status = 0; struct timespec ts = { 1, 0 }; diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_001.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_001.cpp index ed5debcaf2fc937fcfb7bb05d024622f1eada304..0dd9ab33fe34c82c21e9aec57aacdf510a620de9 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_001.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_001.cpp @@ -58,7 +58,6 @@ EXIT: static void *PthreadF02(void *t) { - int i; int rc; ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT); diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_002.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_002.cpp index 70a2f02c84a277c48772340c3f0ca346adf1e2d6..05305d7c2430dab86637b8a8a866247da451f320 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_002.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_002.cpp @@ -58,7 +58,6 @@ EXIT: static void *PthreadF02(void *t) { - int i; int rc; while (g_pthreadExit != 1) { diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_003.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_003.cpp index 5698c5bb6d39795a1b8f689d857f2381a7934085..bcf218e23cccc3e91719072299e957c955d84b5a 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_003.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_003.cpp @@ -82,8 +82,7 @@ static int Testcase() struct sched_param param = { 0 }; int ret; void *res = NULL; - pthread_attr_t a = { 0 }; - pthread_t newPthread, newPthread1; + pthread_t newPthread; g_testPthredCount = 0; diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_006.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_006.cpp index 3846c74f2959171e73877643c59b7783b01e4bab..355c376ebe1cf7f42178e45a50d0afaf7001ed46 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_006.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_006.cpp @@ -82,11 +82,8 @@ static int Testcase(void) { struct sched_param param = { 0 }; int ret; - void *res = NULL; pthread_attr_t a = { 0 }; - pthread_t thread; - pthread_t newPthread[10], newPthread1; - pthread_mutexattr_t mutex; + pthread_t newPthread[10]; int index = 0; int currThreadPri, currThreadPolicy; int threadParam[10]; diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_007.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_007.cpp index 119de51deaea55426a214bc65318e37eae720a3b..b880f14dc286eaf310f98d1454fcf1fe76cbaac2 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_007.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_007.cpp @@ -84,8 +84,6 @@ EXIT: static UINT32 Testcase(VOID) { - int rc; - int ret = 0; pthread_t th1; pthread_t th2; diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_008.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_008.cpp index 1dd20f384fd4d9a27d57030b00c01d7ad624d7ed..0b57ac5f0878998492f985f31f40b78718356fe3 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_008.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_008.cpp @@ -84,8 +84,6 @@ EXIT: static UINT32 Testcase(VOID) { - int rc; - int ret = 0; pthread_t th1; pthread_t th2; diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_009.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_009.cpp index bd1968b4a48aae0fe9ae44723d469c149b05af93..883788a761280aaf367df2621615e04ba73ce6f8 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_009.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_009.cpp @@ -42,9 +42,8 @@ EXIT: return NULL; } -static UINT32 Testcase(VOID) +static UINT32 Testcase(void) { - int ret; pthread_attr_t attr; g_testCount = 0; pthread_attr_init(&attr); diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_010.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_010.cpp index 45b3fc457ca5e16e3c38c485e74d32ac54aafc48..2f4d485ef5ca7493a40c052070b23be5be6d5793 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_010.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_010.cpp @@ -30,9 +30,7 @@ */ #include "it_pthread_test.h" -static pthread_barrier_t g_barrier; static int g_testToCount001 = 0; -static int g_threadTest[30]; static void *ThreadFuncTest0(void *a) { @@ -41,7 +39,6 @@ static void *ThreadFuncTest0(void *a) int currThreadPolicy; ret = pthread_getschedparam(pthread_self(), &currThreadPolicy, ¶m); ICUNIT_ASSERT_EQUAL_NULL(ret, 0, (void *)(uintptr_t)ret); - int currThreadPri = param.sched_priority; g_testToCount001++; diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_011.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_011.cpp index 34bc604e8aaa96d83e82a73038799a99b5b7e8cc..9775a4e0aea9c6393e5ebf2a0f149107fe2e8563 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_011.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_011.cpp @@ -37,7 +37,6 @@ void child1(void) int policy, pri, newPolicy; struct sched_param param = { 0 }; pthread_t pthread = pthread_self(); - int tid = Syscall(SYS_gettid, 0, 0, 0, 0); int ret = pthread_getschedparam(pthread, &policy, ¶m); diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_015.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_015.cpp index 84992367324ec1209cae66d35bc14c2a2361b7ea..d592c16e776599cf1c98e840a98c8dbe4ffae0dc 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_015.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_015.cpp @@ -70,7 +70,7 @@ static int TestCase(void) { int ret; int status = 0; - pid_t pid, pid1; + pid_t pid; pid = fork(); ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, The pid will never exceed 100000. diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_017.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_017.cpp index edd54539fe9fd7e1e6cdb7cdefc50fb5d8aa2a05..4bd3aec1354f6fff202cb56ae67f2eee0b63076a 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_017.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_017.cpp @@ -70,7 +70,7 @@ static int TestCase(void) { int ret; int status = 0; - pid_t pid, pid1; + pid_t pid; pid = fork(); ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, The pid will never exceed 100000. diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_018.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_018.cpp index 26aed44c800bad8da33149b4e06a23c2e53c0f97..b2ef1b182dcaaea330bd4a0550bd796043350d23 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_018.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_018.cpp @@ -59,10 +59,8 @@ static int GroupProcess(void) pthread_t th1; pthread_attr_t attr; pthread_attr_init(&attr); - int policy = 0; unsigned int *getStack = NULL; size_t getSize; - struct sched_param param = { 0 }; int stackSize = 0x3000; g_testCnt = 0; diff --git a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_019.cpp b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_019.cpp index e219eed46bbbfa764dd744d86d3a16e256a8ac6b..600549862449c46b4d573acb70fa72a746496a03 100644 --- a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_019.cpp +++ b/testsuites/unittest/process/basic/pthread/smoke/pthread_test_019.cpp @@ -59,10 +59,8 @@ static int GroupProcess(void) pthread_t th1; pthread_attr_t attr; pthread_attr_init(&attr); - int policy = 0; unsigned int *getStack = NULL; size_t getSize; - struct sched_param param = { 0 }; int stackSize = 2047; void *stack = (void *)&getSize; diff --git a/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_018.cpp b/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_018.cpp index 7980e275b2dd85ee2f08fbdae6187f6e4bdfa0a0..0bb0ed699a4062f99bf541be05d1daf20a50a69e 100644 --- a/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_018.cpp +++ b/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_018.cpp @@ -31,20 +31,16 @@ #include "it_mutex_test.h" static pthread_mutex_t g_muxLock001; -static pthread_mutex_t g_muxLock002; static pthread_mutex_t g_muxLock003; static const unsigned int TEST_COUNT = 10; static volatile int g_testToCount001 = 0; static volatile int g_testToCount002 = 0; -static volatile int g_testToCount003 = 0; static void *ThreadFuncTest2(void *a) { int ret; pthread_t thread = pthread_self(); - struct timespec time; - struct timeval timeVal = { 0 }; ret = pthread_detach(thread); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); @@ -67,7 +63,6 @@ EXIT: static void *ThreadFuncTest1(void *a) { int ret; - pthread_t thread = pthread_self(); struct timespec time; struct timeval timeVal = { 0 }; @@ -98,9 +93,7 @@ static int Testcase(void) { struct sched_param param = { 0 }; int ret; - void *res = nullptr; pthread_attr_t a = { 0 }; - pthread_t thread = pthread_self(); pthread_t newPthread, newPthread1; pthread_mutexattr_t mutex; int index = TEST_COUNT; diff --git a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_007.cpp b/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_007.cpp index b3129b807197ae506c66b6b0dbd17d6d8086809c..f6ff75bba2e29e78c786552ff3f253305493e2d7 100644 --- a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_007.cpp +++ b/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_007.cpp @@ -43,7 +43,6 @@ static void *ThreadFuncTest3(void *a) { int ret; pthread_t thread = pthread_self(); - struct sched_param param = { 0 }; struct timespec time; struct timeval timeVal = { 0 }; diff --git a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_019.cpp b/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_019.cpp index 05fdb6fa4f3fd2f34d5eb375ae38f89e14506019..e2450aca7d69c5b49bafab44c0a20a09f6d0a488 100644 --- a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_019.cpp +++ b/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_019.cpp @@ -31,7 +31,6 @@ #include "it_mutex_test.h" static pthread_mutex_t g_muxLock001; -static pthread_mutex_t g_muxLock002; static pthread_mutex_t g_muxLock003; static const unsigned int TEST_COUNT = 10; @@ -39,7 +38,6 @@ static const unsigned int NEW_THREAD_COUNT = 10; static volatile int g_testToCount001 = 0; static volatile int g_testToCount002 = 0; -static volatile int g_testToCount003 = 0; static void *ThreadFuncTest2(void *a) { @@ -73,7 +71,7 @@ static void *ThreadFuncTest1(void *a) gettimeofday(&timeVal, nullptr); if(timeVal.tv_usec + 100000 >= 1000000) { // 100000us, delay time; 1000000us, compare - time.tv_sec = timeVal.tv_sec + 1; + time.tv_sec = timeVal.tv_sec + 1; time.tv_nsec = (timeVal.tv_usec + 100000 - 1000000) * 1000; // 100000, delaytime; 1000, us to ns; 1000000us=1s; } else { time.tv_sec = timeVal.tv_sec + 0; diff --git a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_020.cpp b/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_020.cpp index 0c1f334ecf40d8a9fbf3393e9365d7ec5fa320c6..3a563dcf1459a22acff3fbe3013c70e05f4937bf 100644 --- a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_020.cpp +++ b/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_020.cpp @@ -31,7 +31,6 @@ #include "it_mutex_test.h" static pthread_mutex_t g_muxLock001; -static pthread_mutex_t g_muxLock002; static pthread_mutex_t g_muxLock003; static const unsigned int TEST_COUNT = 10; diff --git a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_021.cpp b/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_021.cpp index 4a5158613744f3f17a624859ab30a738d5ce1841..326dd8630e224363273171a0cb6e26824891fec1 100644 --- a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_021.cpp +++ b/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_021.cpp @@ -31,7 +31,6 @@ #include "it_mutex_test.h" static pthread_mutex_t g_muxLock001; -static pthread_mutex_t g_muxLock002; static pthread_mutex_t g_muxLock003; static const unsigned int TEST_COUNT = 10; diff --git a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_022.cpp b/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_022.cpp index 0ed49774be15b1abbac67900f93f7ab8356645d3..baf69ede379d1b3e71642ba5bef6fda4a96124ae 100644 --- a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_022.cpp +++ b/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_022.cpp @@ -31,7 +31,6 @@ #include "it_mutex_test.h" static pthread_mutex_t g_muxLock001; -static pthread_mutex_t g_muxLock002; static pthread_mutex_t g_muxLock003; static const unsigned int TEST_COUNT = 10; diff --git a/testsuites/unittest/process/lock/rwlock/full/pthread_rwlock_test_002.cpp b/testsuites/unittest/process/lock/rwlock/full/pthread_rwlock_test_002.cpp index 075c2aa8f131e5e6f47a483a6503d0f00faea281..85b14fadec02551a5a4507f4341d2b76f8e83b80 100644 --- a/testsuites/unittest/process/lock/rwlock/full/pthread_rwlock_test_002.cpp +++ b/testsuites/unittest/process/lock/rwlock/full/pthread_rwlock_test_002.cpp @@ -49,8 +49,8 @@ static int g_readPar[READ_THREAD_COUNT]; static void RwlockWait() { int count; - int count1; for (count = 0xFFFFFFF; count != 0; count--) { + ; } } @@ -178,7 +178,6 @@ static void *ThreadWriteFunc(void *a) int ret; int count = 0; int oldRwlockMask; - pthread_t thread = pthread_self(); int threadCount = *((int *)a); while (CheckReadThreadExit() || CheckWriteThreadExit()) { @@ -221,9 +220,7 @@ static int PthreadRwlockTest(void) void *res = nullptr; int count = 0; pthread_attr_t a = { 0 }; - pthread_t thread = pthread_self(); pthread_t newPthread, newPthread1; - pthread_rwlockattr_t rwlock; int index = 0; int curThreadPri, curThreadPolicy; diff --git a/testsuites/unittest/process/lock/rwlock/smoke/pthread_rwlock_test_001.cpp b/testsuites/unittest/process/lock/rwlock/smoke/pthread_rwlock_test_001.cpp index c50dda80324f1322260b20850faffe56bb053d85..192b347ae7c55a8d4c4956cadfbd0c6aa7cfe5fa 100644 --- a/testsuites/unittest/process/lock/rwlock/smoke/pthread_rwlock_test_001.cpp +++ b/testsuites/unittest/process/lock/rwlock/smoke/pthread_rwlock_test_001.cpp @@ -50,8 +50,8 @@ static int g_readPar[READ_THREAD_COUNT]; static void RwlockWait() { int count; - int count1; for (count = 0xFFFFFFF; count != 0; count--) { + ; } } @@ -179,7 +179,6 @@ static void *ThreadWriteFunc(void *a) int ret; int count = 0; int oldRwlockMask; - pthread_t thread = pthread_self(); int threadCount = *((int *)a); while (CheckReadThreadExit() || CheckWriteThreadExit()) { @@ -221,9 +220,7 @@ static int Testcase(void) void *res = nullptr; int count = 0; pthread_attr_t a = { 0 }; - pthread_t thread = pthread_self(); pthread_t newPthread, newPthread1; - pthread_rwlockattr_t rwlock; int index = 0; int curThreadPri, curThreadPolicy; diff --git a/testsuites/unittest/process/lock/spinlock/smoke/pthread_spinlock_test_001.cpp b/testsuites/unittest/process/lock/spinlock/smoke/pthread_spinlock_test_001.cpp index 96c48729818f56fc0778268903ad16fc08842aff..ad963719640ec2cb928513fc72779f038cce52a5 100644 --- a/testsuites/unittest/process/lock/spinlock/smoke/pthread_spinlock_test_001.cpp +++ b/testsuites/unittest/process/lock/spinlock/smoke/pthread_spinlock_test_001.cpp @@ -90,7 +90,6 @@ static void *ThreadWriteFunc(void *a) int ret; int testCount = TEST_LOOP_COUNT; int oldRwlockMask; - pthread_t thread = pthread_self(); int threadCount = *((int *)a); int count; @@ -128,9 +127,7 @@ static int Testcase(void) int ret; void *res = nullptr; pthread_attr_t a = { 0 }; - pthread_t thread = pthread_self(); pthread_t newPthread, newPthread1; - pthread_rwlockattr_t rwlock; int index = 0; int curThreadPri, curThreadPolicy; diff --git a/testsuites/unittest/security/reugid/smoke/reugid_test_001.cpp b/testsuites/unittest/security/reugid/smoke/reugid_test_001.cpp index 4dfa614135ebc18cda046b03a98fd71125e9773e..064754681b76b8d79bf87d0669bc1ffadf982df0 100644 --- a/testsuites/unittest/security/reugid/smoke/reugid_test_001.cpp +++ b/testsuites/unittest/security/reugid/smoke/reugid_test_001.cpp @@ -43,7 +43,6 @@ static int Child1(int *list, int listSize) int suid = 100; int rgid = 0; int egid = 0; - int sgid = 100; int ret; rgid = getgid(); @@ -406,7 +405,7 @@ EXIT: return 1; } -static int TestCase(VOID) +static int TestCase(void) { int ret; int status = 0;