fix:删除冗余的函数

代码扫描工具发现代码中有被注释的多余函数,现删除。

Signed-off-by: yinjiaming <yinjiaming@huawei.com>
Change-Id: I26980061390924d53c77e467b2cab2f56b192a82
This commit is contained in:
yinjiaming
2023-02-07 15:10:12 +08:00
parent be50721826
commit d17bc9d4ea
11 changed files with 9 additions and 90 deletions

View File

@@ -37,7 +37,6 @@ static UINT32 testcase(VOID)
time_t currtime;
struct tm *timer = {nullptr};
char buffer[80];
//locale_t loc = malloc(sizeof(locale_t);
time(&currtime);
timer = localtime(&currtime);
@@ -46,17 +45,17 @@ static UINT32 testcase(VOID)
printf("getenv MUSL_LOCPATH=%s\n", getenv("MUSL_LOCPATH"));
printf("Locale is: %s\n", setlocale(LC_TIME, "en_US.UTF-8"));
strftime(buffer, 80, "%c", timer);
(void)strftime(buffer, sizeof(buffer), "%c", timer);
printf("Date is: %s\n", buffer);
ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1);
printf("Locale is: %s\n", setlocale(LC_TIME, "zh_CN.UTF-8"));
strftime(buffer, 80, "%c", timer);
(void)strftime(buffer, sizeof(buffer), "%c", timer);
printf("Date is: %s\n", buffer);
ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1);
printf("Locale is: %s\n", setlocale(LC_TIME, ""));
strftime(buffer, 80, "%c", timer);
(void)strftime(buffer, sizeof(buffer), "%c", timer);
printf("Date is: %s\n", buffer);
ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1);
setlocale(LC_ALL, "C");

View File

@@ -145,26 +145,6 @@ HWTEST_F(MiscTest, ItTestMisc009, TestSize.Level0)
ItTestMisc009();
}
/* *
* @tc.name: IT_TEST_MISC_010
* @tc.desc: function for MiscTest
* @tc.type: FUNC
*/
/*HWTEST_F(MiscTest, ItTestMisc010, TestSize.Level0)
{
ItTestMisc010();
}*/
/* *
* @tc.name: IT_TEST_MISC_011
* @tc.desc: function for MiscTest
* @tc.type: FUNC
*/
/*HWTEST_F(MiscTest, ItTestMisc011, TestSize.Level0)
{
ItTestMisc011();
}*/
/* *
* @tc.name: IT_TEST_MISC_012
* @tc.desc: function for MiscTest
@@ -174,16 +154,6 @@ HWTEST_F(MiscTest, ItTestMisc012, TestSize.Level0)
{
ItTestMisc012();
}
/* *
* @tc.name: IT_TEST_MISC_013
* @tc.desc: function for MiscTest
* @tc.type: FUNC
*/
/*HWTEST_F(MiscTest, ItTestMisc013, TestSize.Level0)
{
ItTestMisc013();
}*/
#endif
} // namespace OHOS

View File

@@ -34,7 +34,6 @@ static void *pthread_f01(void *tmp)
{
int rc = 0;
g_testCount++;
// printf("www\n");
/* acquire the mutex */
rc = pthread_mutex_lock(&g_pthreadMutexTest1);
@@ -69,7 +68,7 @@ static UINT32 Testcase(VOID)
/* Let the other thread run */
LosTaskDelay(2);
ICUNIT_ASSERT_EQUAL(g_testCount, 2, g_testCount);
ICUNIT_ASSERT_EQUAL(g_testCount, 2, g_testCount); // 2: expected value of g_testCount
/* Try to destroy the cond var. This should return an error */
rc = pthread_cond_destroy(&g_pthreadCondTest1);
@@ -79,7 +78,7 @@ static UINT32 Testcase(VOID)
ICUNIT_ASSERT_EQUAL(rc, 0, rc);
LosTaskDelay(2);
ICUNIT_ASSERT_EQUAL(g_testCount, 4, g_testCount);
ICUNIT_ASSERT_EQUAL(g_testCount, 4, g_testCount); // 4: expected value of g_testCount
rc = pthread_cond_destroy(&g_pthreadCondTest1);
ICUNIT_ASSERT_EQUAL(rc, 0, rc);

View File

@@ -51,10 +51,6 @@ static UINT32 Testcase(VOID)
tmp = pthread_equal(a, b);
// pthread_join(a, NULL);
// pthread_detach(a);
pthread_attr_init(&aa);
pthread_attr_getdetachstate(&aa, &detachstate);
@@ -63,19 +59,6 @@ static UINT32 Testcase(VOID)
pthread_attr_destroy(&aa);
// pthread_mutex_init(&c, NULL);
// pthread_mutex_destroy(&c);
// pthread_mutex_lock(&c);
// pthread_mutex_trylock(&c);
// pthread_mutex_unlock(&c);
// pthread_mutexattr_init(&c);
// pthread_mutexattr_destroy(&c);
ret = pthread_join(aThread, NULL);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);

View File

@@ -36,8 +36,6 @@ static void *ThreadF01(void *arg)
/* Shouldn't reach here. If we do, then the pthread_cancel()
* function did not succeed. */
// uart_printf_func("Could not send cancel request correctly\n");
// ICUNIT_TRACK_EQUAL(1, 0, errno);
pthread_exit(nullptr);
return NULL;
}
@@ -62,7 +60,6 @@ static UINT32 Testcase(VOID)
ret = pthread_join(newTh, (void **)&temp);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
// ICUNIT_ASSERT_EQUAL(temp, (UINTPTR)PTHREAD_CANCELED, temp);
return PTHREAD_NO_ERROR;
}

View File

@@ -34,7 +34,6 @@ static void *ThreadF01(void *arg)
{
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
// while (1)
sleep(1);
pthread_exit(nullptr);
@@ -48,7 +47,6 @@ static UINT32 Testcase(VOID)
pthread_t a;
/* SIGALRM will be sent in 5 seconds. */
// alarm(5);//alarm NOT SUPPORT
/* Create a new thread. */
if (pthread_create(&a, NULL, ThreadF01, NULL) != 0) {
@@ -61,7 +59,6 @@ static UINT32 Testcase(VOID)
/* If 'main' has reached here, then the test passed because it means
* that the thread is truly asynchronise, and main isn't waiting for
* it to return in order to move on. */
// printf("Test PASSED\n");
ret = pthread_join(a, &temp);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);