From eeb2efd538bf03d26999a10ddf9160889bf72218 Mon Sep 17 00:00:00 2001 From: Neil Chen Date: Thu, 11 Aug 2022 21:04:05 +0800 Subject: [PATCH] fix: drop unused variable for testsuites/unittest Signed-off-by: Neil Chen Change-Id: Ifde1a3b7de7946283f561efba4c0624e2998fa04 --- testsuites/unittest/basic/exc/smoke/it_test_exc_002.cpp | 2 -- testsuites/unittest/basic/exc/smoke/it_test_exc_003.cpp | 5 ++--- testsuites/unittest/basic/exc/smoke/it_test_exc_004.cpp | 2 -- testsuites/unittest/basic/mem/shm/full/shm_test_001.cpp | 5 ++--- testsuites/unittest/basic/mem/shm/full/shm_test_005.cpp | 4 +--- testsuites/unittest/basic/mem/vm/smoke/mmap_test_008.cpp | 3 --- testsuites/unittest/basic/mem/vm/smoke/mmap_test_009.cpp | 2 +- .../unittest/drivers/storage/smoke/storage_test_001.cpp | 3 +-- .../unittest/extended/signal/full/pipe_test_001.cpp | 3 +++ .../unittest/extended/signal/full/pipe_test_003.cpp | 6 ++++-- .../unittest/extended/signal/full/pipe_test_005.cpp | 3 +-- .../unittest/extended/signal/full/signal_test_001.cpp | 5 +++-- .../unittest/extended/signal/full/signal_test_007.cpp | 3 +-- .../unittest/extended/signal/full/signal_test_011.cpp | 2 +- .../unittest/extended/signal/full/signal_test_016.cpp | 5 +---- .../unittest/extended/signal/full/signal_test_017.cpp | 3 --- .../unittest/extended/signal/full/signal_test_018.cpp | 2 +- .../unittest/extended/signal/full/signal_test_019.cpp | 2 +- .../unittest/extended/signal/full/signal_test_025.cpp | 3 +-- .../unittest/extended/signal/full/signal_test_026.cpp | 5 ++--- .../unittest/extended/signal/full/signal_test_028.cpp | 1 - .../unittest/extended/signal/full/signal_test_040.cpp | 9 ++++----- .../unittest/extended/signal/full/signal_test_041.cpp | 3 ++- .../unittest/extended/signal/smoke/mkfifo_test_002.cpp | 8 ++------ .../unittest/extended/signal/smoke/pipe_test_004.cpp | 7 ++----- .../unittest/extended/signal/smoke/signal_test_009.cpp | 1 - .../unittest/extended/signal/smoke/signal_test_013.cpp | 1 - .../unittest/extended/signal/smoke/signal_test_035.cpp | 4 ++-- testsuites/unittest/libc/io/full/IO_test_epoll_001.cpp | 3 --- testsuites/unittest/libc/io/full/IO_test_epoll_002.cpp | 2 -- testsuites/unittest/libc/io/full/IO_test_pselect_001.cpp | 2 -- testsuites/unittest/libc/io/full/IO_test_pselect_002.cpp | 3 --- testsuites/unittest/libc/io/full/It_stdio_putwc_001.cpp | 2 +- testsuites/unittest/libc/io/full/It_stdlib_poll_003.cpp | 2 +- testsuites/unittest/libc/io/smoke/IO_test_013.cpp | 2 +- testsuites/unittest/libc/misc/smoke/misc_test_014.cpp | 1 - .../libc/posix/mqueue/full/It_posix_queue_020.cpp | 2 -- .../libc/posix/mqueue/full/It_posix_queue_032.cpp | 1 - .../libc/posix/mqueue/full/It_posix_queue_040.cpp | 4 +--- .../libc/posix/mqueue/full/It_posix_queue_046.cpp | 2 +- .../libc/posix/mqueue/full/It_posix_queue_056.cpp | 2 +- .../libc/posix/mqueue/full/It_posix_queue_058.cpp | 2 +- .../libc/posix/mqueue/full/It_posix_queue_061.cpp | 1 - .../libc/posix/mqueue/full/It_posix_queue_063.cpp | 1 - .../libc/posix/mqueue/full/It_posix_queue_066.cpp | 1 - .../libc/posix/mqueue/full/It_posix_queue_080.cpp | 3 +-- .../libc/posix/mqueue/full/It_posix_queue_081.cpp | 3 +-- .../libc/posix/mqueue/full/It_posix_queue_083.cpp | 2 +- .../libc/posix/mqueue/full/It_posix_queue_084.cpp | 2 +- .../libc/posix/mqueue/full/It_posix_queue_093.cpp | 3 --- .../libc/posix/mqueue/full/It_posix_queue_108.cpp | 2 +- .../libc/posix/mqueue/full/It_posix_queue_119.cpp | 1 - .../libc/posix/mqueue/full/It_posix_queue_134.cpp | 1 - .../libc/posix/mqueue/full/It_posix_queue_136.cpp | 3 --- .../libc/posix/mqueue/full/It_posix_queue_144.cpp | 2 +- .../libc/posix/mqueue/full/It_posix_queue_151.cpp | 1 - .../libc/posix/mqueue/full/It_posix_queue_160.cpp | 2 +- .../libc/posix/mqueue/full/It_posix_queue_161.cpp | 2 +- .../libc/posix/mqueue/full/It_posix_queue_168.cpp | 1 - .../libc/posix/mqueue/full/It_posix_queue_169.cpp | 1 - .../libc/posix/mqueue/full/It_posix_queue_173.cpp | 3 --- .../libc/posix/mqueue/full/It_posix_queue_175.cpp | 1 - .../libc/posix/mqueue/full/It_posix_queue_176.cpp | 2 -- .../libc/posix/mqueue/full/It_posix_queue_177.cpp | 1 - .../libc/posix/mqueue/full/It_posix_queue_201.cpp | 1 - .../libc/posix/mqueue/full/It_posix_queue_202.cpp | 1 - .../libc/posix/mqueue/full/It_posix_queue_203.cpp | 3 +-- .../libc/posix/mqueue/full/It_posix_queue_204.cpp | 4 +--- .../libc/posix/mqueue/full/It_posix_queue_209.cpp | 1 - .../unittest/libc/time/clock/full/clock_test_002.cpp | 1 - .../unittest/libc/time/clock/full/clock_test_003.cpp | 1 - .../unittest/libc/time/clock/full/clock_test_004.cpp | 2 -- .../unittest/libc/time/clock/full/clock_test_005.cpp | 1 - .../unittest/libc/time/timer/smoke/timer_test_005.cpp | 4 +--- testsuites/unittest/libc/util/smoke/util_test_001.cpp | 1 - testsuites/unittest/libc/util/smoke/util_test_002.cpp | 1 - .../unittest/net/resolv/smoke/net_resolv_test_002.cpp | 2 +- .../unittest/net/resolv/smoke/net_resolv_test_003.cpp | 2 +- .../unittest/net/socket/smoke/net_socket_test_002.cpp | 2 +- .../unittest/net/socket/smoke/net_socket_test_003.cpp | 5 ++--- .../process/basic/process/full/process_test_007.cpp | 6 +----- .../process/basic/process/full/process_test_036.cpp | 3 +-- .../process/basic/process/full/process_test_037.cpp | 3 +-- .../process/basic/process/full/process_test_040.cpp | 7 ++----- .../process/basic/process/full/process_test_041.cpp | 6 ++---- .../process/basic/process/full/process_test_042.cpp | 4 +--- .../process/basic/process/full/process_test_055.cpp | 1 - .../process/basic/process/full/process_test_060.cpp | 2 -- .../process/basic/process/full/process_test_063.cpp | 1 - .../process/basic/process/full/process_test_064.cpp | 3 --- .../process/basic/process/full/process_test_065.cpp | 2 -- .../process/basic/process/smoke/process_test_001.cpp | 4 +--- .../process/basic/process/smoke/process_test_005.cpp | 1 - .../process/basic/process/smoke/process_test_006.cpp | 6 +----- .../process/basic/process/smoke/process_test_008.cpp | 6 +----- .../process/basic/process/smoke/process_test_009.cpp | 7 +------ .../process/basic/process/smoke/process_test_010.cpp | 4 +--- .../process/basic/process/smoke/process_test_011.cpp | 1 - .../process/basic/process/smoke/process_test_012.cpp | 1 - .../process/basic/process/smoke/process_test_015.cpp | 2 -- .../process/basic/process/smoke/process_test_016.cpp | 1 - .../process/basic/process/smoke/process_test_017.cpp | 2 -- .../process/basic/process/smoke/process_test_018.cpp | 3 +-- .../process/basic/process/smoke/process_test_019.cpp | 5 +---- .../process/basic/process/smoke/process_test_020.cpp | 2 +- .../process/basic/process/smoke/process_test_021.cpp | 2 +- .../process/basic/process/smoke/process_test_022.cpp | 2 -- .../process/basic/process/smoke/process_test_023.cpp | 3 --- .../process/basic/process/smoke/process_test_024.cpp | 3 +-- .../process/basic/process/smoke/process_test_025.cpp | 3 +-- .../process/basic/process/smoke/process_test_027.cpp | 2 -- .../process/basic/process/smoke/process_test_029.cpp | 2 +- .../process/basic/process/smoke/process_test_030.cpp | 2 +- .../process/basic/process/smoke/process_test_038.cpp | 7 ++----- .../process/basic/process/smoke/process_test_039.cpp | 6 +++--- .../process/basic/process/smoke/process_test_044.cpp | 5 +---- .../process/basic/process/smoke/process_test_054.cpp | 1 - .../process/basic/pthread/full/pthread_test_001.cpp | 9 --------- .../process/basic/pthread/full/pthread_test_002.cpp | 4 ++-- .../process/basic/pthread/full/pthread_test_014.cpp | 2 -- .../basic/pthread/smoke/pthread_atfork_test_001.cpp | 2 +- .../basic/pthread/smoke/pthread_atfork_test_002.cpp | 2 +- .../basic/pthread/smoke/pthread_cond_test_001.cpp | 1 - .../basic/pthread/smoke/pthread_cond_test_002.cpp | 1 - .../process/basic/pthread/smoke/pthread_test_003.cpp | 3 +-- .../process/basic/pthread/smoke/pthread_test_006.cpp | 5 +---- .../process/basic/pthread/smoke/pthread_test_007.cpp | 2 -- .../process/basic/pthread/smoke/pthread_test_008.cpp | 2 -- .../process/basic/pthread/smoke/pthread_test_009.cpp | 3 +-- .../process/basic/pthread/smoke/pthread_test_010.cpp | 3 --- .../process/basic/pthread/smoke/pthread_test_011.cpp | 1 - .../process/basic/pthread/smoke/pthread_test_015.cpp | 2 +- .../process/basic/pthread/smoke/pthread_test_017.cpp | 2 +- .../process/basic/pthread/smoke/pthread_test_018.cpp | 2 -- .../process/basic/pthread/smoke/pthread_test_019.cpp | 2 -- .../process/lock/mutex/full/pthread_mutex_test_018.cpp | 7 ------- .../process/lock/mutex/smoke/pthread_mutex_test_007.cpp | 1 - .../process/lock/mutex/smoke/pthread_mutex_test_019.cpp | 4 +--- .../process/lock/mutex/smoke/pthread_mutex_test_020.cpp | 1 - .../process/lock/mutex/smoke/pthread_mutex_test_021.cpp | 1 - .../process/lock/mutex/smoke/pthread_mutex_test_022.cpp | 1 - .../process/lock/rwlock/full/pthread_rwlock_test_002.cpp | 5 +---- .../lock/rwlock/smoke/pthread_rwlock_test_001.cpp | 5 +---- .../lock/spinlock/smoke/pthread_spinlock_test_001.cpp | 3 --- .../unittest/security/reugid/smoke/reugid_test_001.cpp | 3 +-- 145 files changed, 101 insertions(+), 302 deletions(-) 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 45b941f1..91e4eebc 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 c275cd65..ec1d49b8 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 6ad1462a..8009e347 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 6cb107d3..e45a7252 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 2e0da0ce..87628ff2 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 2d024751..42bceb24 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 57211386..2bfc6e90 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 9e35c78f..58c75bf0 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 fe13fd1d..645837d4 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 6c76e23b..e4311dde 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 9b490529..647a8447 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 71e777bc..e0d30d85 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 1fcb74ee..33445e6f 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 1e84c4da..a54a1b88 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 1e6eebc4..6f53d90c 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 08968aa7..ed650e83 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 cf7d275a..d669cc2f 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 0235fc91..ccf3fc66 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 aef9dd8f..3a104229 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 f555f2fd..153aef18 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 ba48ed17..6a9c332e 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 76654c6a..ba51c26b 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 c8c818a4..24216945 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 ffbf9fff..a75ad1fc 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 87e8243f..1b89726a 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 dc36dde7..eed98cc4 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 6ccd3802..f3a5bced 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 f07e329b..231b82c0 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 ecdca93a..70e25685 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 8b54bdcd..94781d19 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 d6cfa95d..c065fdb4 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 a57c316d..62721fbe 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 a3667385..330f00d0 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 d1a99db8..f0a88328 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 9b2763c4..201bf6df 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 1dffbe51..5189f306 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 e24f1a8d..36665b94 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 9feb1399..2387e11b 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 4442ff61..a58629d4 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 90aacd21..04b30ee8 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 0d8eaf1d..ea2bf63b 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 cd0bb9ae..bd90d7b0 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 1fe6064d..59190079 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 57f77d7b..fa816618 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 03b127e9..c505818e 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 74e72515..8c46179d 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 3ac51ae4..742f30cc 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 55b26c13..9f4ecb23 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 02b6fc18..f4b7dd50 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 4e8596f4..ff1249ca 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 898c252c..236d26f9 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 d93f11d7..b9155f02 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 1293dce1..6134a8c4 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 83f0f82f..7a427b39 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 c9d07ef4..11096a9b 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 4874cdf8..f57663f0 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 c451568b..b7b9dd91 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 ca6949a7..bcff843e 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 48f215f3..a0f7cebb 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 d161ab4f..527149c8 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 d87588d4..af737173 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 0fa63e43..23171491 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 fda61054..1364c647 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 574c1bc1..1cdaa8fb 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 2ecd5038..e2a0f248 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 71e24309..959f2a0d 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 09e36c39..429d981b 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 1f24ce2c..3da07a02 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 8bfe3909..f02dfbec 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 f951d878..5bff0d8e 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 d37ae98b..71db84a1 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 5add0e14..894cceb9 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 8db361ac..249cb5b4 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 4c739f74..5159a6e9 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 06a54451..f6dc71cf 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 fee8059b..9aa1ff1b 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 4e570199..5ecbeddc 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 85929a8b..523a85b6 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 20d2193c..c7bf060a 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 92500214..fb71ea19 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 58587ca9..05e20e23 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 1d8efc76..d4ef6b40 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 29f8c6a4..cd63bb2b 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 cadf457c..6f9c8530 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 d2356961..a3fff21d 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 188cdf79..23f370bc 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 30ce7ed1..c661bbbd 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 6f96f65c..0ed960c9 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 d6895653..85047bf7 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 3b84cbbb..09dd1891 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 15f3fd82..864c7586 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 2900a1e1..af5ceced 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 8a94237b..cc4de024 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 909c4e74..bbfe94c5 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 c7245658..405f9ea7 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 ac38c08f..66155d83 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 d8fc46e5..d699db12 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 2e86789e..9ff5c533 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 ea204195..07eb9443 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 967a68ff..13f904ec 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 32394bdf..f28df843 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 7519aecc..67621312 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 8e92d185..9d575a1b 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 c51b59d8..47204706 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 16701c6e..ab7474e3 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 792996c7..3ee104ac 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 10d9c112..251eb810 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 578b9f18..b4c32d1b 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 ed927868..36c12ae1 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 631ac97d..37e15acc 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 a1d77e38..5ae84dd8 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 71424851..990c9bf6 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 e37b26f8..1cfce825 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 c8cbeba2..37a48845 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 2abc9e68..507d6199 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 08995680..d46eff1e 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 6de1aec0..662a1fc3 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 8c95f11f..36bc868e 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 9df31cc1..a73b956d 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 bdabbaf7..df2b026c 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 9c3a3a3c..593f61d4 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 018d6139..3dddb6db 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 ed5debca..0dd9ab33 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 70a2f02c..05305d7c 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 5698c5bb..bcf218e2 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 3846c74f..355c376e 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 119de51d..b880f14d 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 1dd20f38..0b57ac5f 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 bd1968b4..883788a7 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 45b3fc45..2f4d485e 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 34bc604e..9775a4e0 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 84992367..d592c16e 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 edd54539..4bd3aec1 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 26aed44c..b2ef1b18 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 e219eed4..60054986 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 7980e275..0bb0ed69 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 b3129b80..f6ff75bb 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 05fdb6fa..e2450aca 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 0c1f334e..3a563dcf 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 4a515861..326dd863 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 0ed49774..baf69ede 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 075c2aa8..85b14fad 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 c50dda80..192b347a 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 96c48729..ad963719 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 4dfa6141..06475468 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; -- Gitee