From f6ac03d3e3c56236adc5734d4c059f1fbcc9e0c1 Mon Sep 17 00:00:00 2001 From: zhushengle Date: Fri, 22 Oct 2021 16:43:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=BF=9B=E7=A8=8B?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E4=B8=8D=E7=A8=B3=E5=AE=9A=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Close #I4F1XL Signed-off-by: zhushengle Change-Id: Ifdde21a2ff4213218a0fa44ad17af0c15a426758 --- testsuites/unittest/process/process/BUILD.gn | 18 +- .../{smoke => full}/process_test_031.cpp | 0 .../{smoke => full}/process_test_032.cpp | 0 .../{smoke => full}/process_test_033.cpp | 0 .../{smoke => full}/process_test_034.cpp | 0 .../{smoke => full}/process_test_035.cpp | 0 .../{smoke => full}/process_test_036.cpp | 0 .../{smoke => full}/process_test_037.cpp | 0 .../{smoke => full}/process_test_042.cpp | 0 .../{smoke => full}/process_test_055.cpp | 0 .../process/process/process_process_test.cpp | 198 +++++++++--------- testsuites/unittest/process/pthread/BUILD.gn | 6 +- .../{smoke => full}/pthread_test_001.cpp | 0 .../{smoke => full}/pthread_test_002.cpp | 0 .../{smoke => full}/pthread_test_014.cpp | 0 .../process/pthread/process_pthread_test.cpp | 74 +++---- .../pthread/smoke/pthread_cond_test_001.cpp | 2 +- .../pthread/smoke/pthread_test_006.cpp | 2 + 18 files changed, 151 insertions(+), 149 deletions(-) rename testsuites/unittest/process/process/{smoke => full}/process_test_031.cpp (100%) rename testsuites/unittest/process/process/{smoke => full}/process_test_032.cpp (100%) rename testsuites/unittest/process/process/{smoke => full}/process_test_033.cpp (100%) rename testsuites/unittest/process/process/{smoke => full}/process_test_034.cpp (100%) rename testsuites/unittest/process/process/{smoke => full}/process_test_035.cpp (100%) rename testsuites/unittest/process/process/{smoke => full}/process_test_036.cpp (100%) rename testsuites/unittest/process/process/{smoke => full}/process_test_037.cpp (100%) rename testsuites/unittest/process/process/{smoke => full}/process_test_042.cpp (100%) rename testsuites/unittest/process/process/{smoke => full}/process_test_055.cpp (100%) rename testsuites/unittest/process/pthread/{smoke => full}/pthread_test_001.cpp (100%) rename testsuites/unittest/process/pthread/{smoke => full}/pthread_test_002.cpp (100%) rename testsuites/unittest/process/pthread/{smoke => full}/pthread_test_014.cpp (100%) diff --git a/testsuites/unittest/process/process/BUILD.gn b/testsuites/unittest/process/process/BUILD.gn index 8263c8cb..05c26d51 100644 --- a/testsuites/unittest/process/process/BUILD.gn +++ b/testsuites/unittest/process/process/BUILD.gn @@ -69,16 +69,8 @@ sources_smoke = [ "smoke/process_test_027.cpp", "smoke/process_test_029.cpp", "smoke/process_test_030.cpp", - "smoke/process_test_031.cpp", - "smoke/process_test_032.cpp", - "smoke/process_test_033.cpp", - "smoke/process_test_034.cpp", - "smoke/process_test_035.cpp", - "smoke/process_test_036.cpp", - "smoke/process_test_037.cpp", "smoke/process_test_038.cpp", "smoke/process_test_039.cpp", - "smoke/process_test_042.cpp", "smoke/process_test_043.cpp", "smoke/process_test_044.cpp", "smoke/process_test_045.cpp", @@ -86,7 +78,6 @@ sources_smoke = [ "smoke/process_test_047.cpp", "smoke/process_test_048.cpp", "smoke/process_test_054.cpp", - "smoke/process_test_055.cpp", "smoke/process_test_061.cpp", "smp/process_test_smp_001.cpp", "smp/process_test_smp_002.cpp", @@ -100,11 +91,20 @@ sources_smoke = [ sources_full = [ "full/process_test_007.cpp", + "full/process_test_031.cpp", + "full/process_test_032.cpp", + "full/process_test_033.cpp", + "full/process_test_034.cpp", + "full/process_test_035.cpp", + "full/process_test_036.cpp", + "full/process_test_037.cpp", "full/process_test_040.cpp", "full/process_test_041.cpp", + "full/process_test_042.cpp", "full/process_test_049.cpp", "full/process_test_050.cpp", "full/process_test_051.cpp", + "full/process_test_055.cpp", "full/process_test_056.cpp", "full/process_test_057.cpp", "full/process_test_058.cpp", diff --git a/testsuites/unittest/process/process/smoke/process_test_031.cpp b/testsuites/unittest/process/process/full/process_test_031.cpp similarity index 100% rename from testsuites/unittest/process/process/smoke/process_test_031.cpp rename to testsuites/unittest/process/process/full/process_test_031.cpp diff --git a/testsuites/unittest/process/process/smoke/process_test_032.cpp b/testsuites/unittest/process/process/full/process_test_032.cpp similarity index 100% rename from testsuites/unittest/process/process/smoke/process_test_032.cpp rename to testsuites/unittest/process/process/full/process_test_032.cpp diff --git a/testsuites/unittest/process/process/smoke/process_test_033.cpp b/testsuites/unittest/process/process/full/process_test_033.cpp similarity index 100% rename from testsuites/unittest/process/process/smoke/process_test_033.cpp rename to testsuites/unittest/process/process/full/process_test_033.cpp diff --git a/testsuites/unittest/process/process/smoke/process_test_034.cpp b/testsuites/unittest/process/process/full/process_test_034.cpp similarity index 100% rename from testsuites/unittest/process/process/smoke/process_test_034.cpp rename to testsuites/unittest/process/process/full/process_test_034.cpp diff --git a/testsuites/unittest/process/process/smoke/process_test_035.cpp b/testsuites/unittest/process/process/full/process_test_035.cpp similarity index 100% rename from testsuites/unittest/process/process/smoke/process_test_035.cpp rename to testsuites/unittest/process/process/full/process_test_035.cpp diff --git a/testsuites/unittest/process/process/smoke/process_test_036.cpp b/testsuites/unittest/process/process/full/process_test_036.cpp similarity index 100% rename from testsuites/unittest/process/process/smoke/process_test_036.cpp rename to testsuites/unittest/process/process/full/process_test_036.cpp diff --git a/testsuites/unittest/process/process/smoke/process_test_037.cpp b/testsuites/unittest/process/process/full/process_test_037.cpp similarity index 100% rename from testsuites/unittest/process/process/smoke/process_test_037.cpp rename to testsuites/unittest/process/process/full/process_test_037.cpp diff --git a/testsuites/unittest/process/process/smoke/process_test_042.cpp b/testsuites/unittest/process/process/full/process_test_042.cpp similarity index 100% rename from testsuites/unittest/process/process/smoke/process_test_042.cpp rename to testsuites/unittest/process/process/full/process_test_042.cpp diff --git a/testsuites/unittest/process/process/smoke/process_test_055.cpp b/testsuites/unittest/process/process/full/process_test_055.cpp similarity index 100% rename from testsuites/unittest/process/process/smoke/process_test_055.cpp rename to testsuites/unittest/process/process/full/process_test_055.cpp diff --git a/testsuites/unittest/process/process/process_process_test.cpp b/testsuites/unittest/process/process/process_process_test.cpp index 73cc347a..d2040487 100644 --- a/testsuites/unittest/process/process/process_process_test.cpp +++ b/testsuites/unittest/process/process/process_process_test.cpp @@ -368,83 +368,6 @@ HWTEST_F(ProcessProcessTest, ItTestProcess030, TestSize.Level0) ItTestProcess030(); } -/* * - * @tc.name: it_test_process_031 - * @tc.desc: function for ProcessProcessTest - * @tc.type: FUNC - * @tc.require: AR000EEMQ9 - */ -HWTEST_F(ProcessProcessTest, ItTestProcess031, TestSize.Level0) -{ - ItTestProcess031(); -} - -/* * - * @tc.name: it_test_process_032 - * @tc.desc: function for ProcessProcessTest - * @tc.type: FUNC - * @tc.require: AR000EEMQ9 - */ -HWTEST_F(ProcessProcessTest, ItTestProcess032, TestSize.Level0) -{ - ItTestProcess032(); -} - -/* * - * @tc.name: it_test_process_033 - * @tc.desc: function for ProcessProcessTest - * @tc.type: FUNC - * @tc.require: AR000EEMQ9 - */ -HWTEST_F(ProcessProcessTest, ItTestProcess033, TestSize.Level0) -{ - ItTestProcess033(); -} - -/* * - * @tc.name: it_test_process_034 - * @tc.desc: function for ProcessProcessTest - * @tc.type: FUNC - * @tc.require: AR000EEMQ9 - */ -HWTEST_F(ProcessProcessTest, ItTestProcess034, TestSize.Level0) -{ - ItTestProcess034(); -} - -/* * - * @tc.name: it_test_process_035 - * @tc.desc: function for ProcessProcessTest - * @tc.type: FUNC - * @tc.require: AR000EEMQ9 - */ -HWTEST_F(ProcessProcessTest, ItTestProcess035, TestSize.Level0) -{ - ItTestProcess035(); -} - -/* * - * @tc.name: it_test_process_036 - * @tc.desc: function for ProcessProcessTest - * @tc.type: FUNC - * @tc.require: AR000EEMQ9 - */ -HWTEST_F(ProcessProcessTest, ItTestProcess036, TestSize.Level0) -{ - ItTestProcess036(); -} - -/* * - * @tc.name: it_test_process_037 - * @tc.desc: function for ProcessProcessTest - * @tc.type: FUNC - * @tc.require: AR000EEMQ9 - */ -HWTEST_F(ProcessProcessTest, ItTestProcess037, TestSize.Level0) -{ - ItTestProcess037(); -} - /* * * @tc.name: it_test_process_038 * @tc.desc: function for ProcessProcessTest @@ -467,17 +390,6 @@ HWTEST_F(ProcessProcessTest, ItTestProcess039, TestSize.Level0) ItTestProcess039(); } -/* * - * @tc.name: it_test_process_042 - * @tc.desc: function for ProcessProcessTest - * @tc.type: FUNC - * @tc.require: AR000EEMQ9 - */ -HWTEST_F(ProcessProcessTest, ItTestProcess042, TestSize.Level0) -{ - ItTestProcess042(); -} - /* * * @tc.name: it_test_process_043 * @tc.desc: function for ProcessProcessTest @@ -555,17 +467,6 @@ HWTEST_F(ProcessProcessTest, ItTestProcess054, TestSize.Level0) ItTestProcess054(); } -/* * - * @tc.name: it_test_process_055 - * @tc.desc: function for waitid:To test the function of transferring different parameters of the waitid. - * @tc.type: FUNC - * @tc.require: AR000E0QAB - */ -HWTEST_F(ProcessProcessTest, ItTestProcess055, TestSize.Level0) -{ - ItTestProcess055(); -} - /* * * @tc.name: it_test_process_061 * @tc.desc: function for killpg: The killpg parameter is incorrect and the error code is verified. @@ -680,6 +581,83 @@ HWTEST_F(ProcessProcessTest, ItTestProcess007, TestSize.Level0) ItTestProcess007(); } +/* * + * @tc.name: it_test_process_031 + * @tc.desc: function for ProcessProcessTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(ProcessProcessTest, ItTestProcess031, TestSize.Level0) +{ + ItTestProcess031(); +} + +/* * + * @tc.name: it_test_process_032 + * @tc.desc: function for ProcessProcessTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(ProcessProcessTest, ItTestProcess032, TestSize.Level0) +{ + ItTestProcess032(); +} + +/* * + * @tc.name: it_test_process_033 + * @tc.desc: function for ProcessProcessTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(ProcessProcessTest, ItTestProcess033, TestSize.Level0) +{ + ItTestProcess033(); +} + +/* * + * @tc.name: it_test_process_034 + * @tc.desc: function for ProcessProcessTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(ProcessProcessTest, ItTestProcess034, TestSize.Level0) +{ + ItTestProcess034(); +} + +/* * + * @tc.name: it_test_process_035 + * @tc.desc: function for ProcessProcessTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(ProcessProcessTest, ItTestProcess035, TestSize.Level0) +{ + ItTestProcess035(); +} + +/* * + * @tc.name: it_test_process_036 + * @tc.desc: function for ProcessProcessTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(ProcessProcessTest, ItTestProcess036, TestSize.Level0) +{ + ItTestProcess036(); +} + +/* * + * @tc.name: it_test_process_037 + * @tc.desc: function for ProcessProcessTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(ProcessProcessTest, ItTestProcess037, TestSize.Level0) +{ + ItTestProcess037(); +} + /* * * @tc.name: it_test_process_040 * @tc.desc: function for ProcessProcessTest @@ -702,6 +680,17 @@ HWTEST_F(ProcessProcessTest, ItTestProcess041, TestSize.Level0) ItTestProcess041(); } +/* * + * @tc.name: it_test_process_042 + * @tc.desc: function for ProcessProcessTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(ProcessProcessTest, ItTestProcess042, TestSize.Level0) +{ + ItTestProcess042(); +} + /* * * @tc.name: it_test_process_053 * @tc.desc: function for killpg:Sends a signal to the process group, @@ -714,6 +703,17 @@ HWTEST_F(ProcessProcessTest, ItTestProcess053, TestSize.Level0) ItTestProcess053(); } +/* * + * @tc.name: it_test_process_055 + * @tc.desc: function for waitid:To test the function of transferring different parameters of the waitid. + * @tc.type: FUNC + * @tc.require: AR000E0QAB + */ +HWTEST_F(ProcessProcessTest, ItTestProcess055, TestSize.Level0) +{ + ItTestProcess055(); +} + /* * * @tc.name: it_test_process_062 * @tc.desc: function for killpg:Fork two processes. The killpg sends a signal to the current process group. diff --git a/testsuites/unittest/process/pthread/BUILD.gn b/testsuites/unittest/process/pthread/BUILD.gn index 309c51c5..728a6fe4 100644 --- a/testsuites/unittest/process/pthread/BUILD.gn +++ b/testsuites/unittest/process/pthread/BUILD.gn @@ -49,8 +49,6 @@ sources_smoke = [ "smoke/pthread_cond_test_003.cpp", "smoke/pthread_cond_test_004.cpp", "smoke/pthread_once_test_001.cpp", - "smoke/pthread_test_001.cpp", - "smoke/pthread_test_002.cpp", "smoke/pthread_test_003.cpp", "smoke/pthread_test_006.cpp", "smoke/pthread_test_007.cpp", @@ -60,7 +58,6 @@ sources_smoke = [ "smoke/pthread_test_011.cpp", "smoke/pthread_test_012.cpp", "smoke/pthread_test_013.cpp", - "smoke/pthread_test_014.cpp", "smoke/pthread_test_015.cpp", "smoke/pthread_test_016.cpp", "smoke/pthread_test_017.cpp", @@ -69,8 +66,11 @@ sources_smoke = [ ] sources_full = [ + "full/pthread_test_001.cpp", + "full/pthread_test_002.cpp", "full/pthread_test_004.cpp", "full/pthread_test_005.cpp", + "full/pthread_test_014.cpp", ] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { diff --git a/testsuites/unittest/process/pthread/smoke/pthread_test_001.cpp b/testsuites/unittest/process/pthread/full/pthread_test_001.cpp similarity index 100% rename from testsuites/unittest/process/pthread/smoke/pthread_test_001.cpp rename to testsuites/unittest/process/pthread/full/pthread_test_001.cpp diff --git a/testsuites/unittest/process/pthread/smoke/pthread_test_002.cpp b/testsuites/unittest/process/pthread/full/pthread_test_002.cpp similarity index 100% rename from testsuites/unittest/process/pthread/smoke/pthread_test_002.cpp rename to testsuites/unittest/process/pthread/full/pthread_test_002.cpp diff --git a/testsuites/unittest/process/pthread/smoke/pthread_test_014.cpp b/testsuites/unittest/process/pthread/full/pthread_test_014.cpp similarity index 100% rename from testsuites/unittest/process/pthread/smoke/pthread_test_014.cpp rename to testsuites/unittest/process/pthread/full/pthread_test_014.cpp diff --git a/testsuites/unittest/process/pthread/process_pthread_test.cpp b/testsuites/unittest/process/pthread/process_pthread_test.cpp index e29aeb8e..cf49b316 100644 --- a/testsuites/unittest/process/pthread/process_pthread_test.cpp +++ b/testsuites/unittest/process/pthread/process_pthread_test.cpp @@ -52,30 +52,6 @@ public: }; #if defined(LOSCFG_USER_TEST_SMOKE) -/* * - * @tc.name: it_test_pthread_001 - * @tc.desc: function for ProcessPthreadTest - * @tc.type: FUNC - * @tc.require: AR000EEMQ9 - */ -HWTEST_F(ProcessPthreadTest, ItTestPthread001, TestSize.Level0) -{ - ItTestPthread001(); -} - -#ifndef LOSCFG_USER_TEST_SMP -/* * - * @tc.name: it_test_pthread_002 - * @tc.desc: function for ProcessPthreadTest - * @tc.type: FUNC - * @tc.require: AR000EEMQ9 - */ -HWTEST_F(ProcessPthreadTest, ItTestPthread002, TestSize.Level0) -{ - ItTestPthread002(); -} - -#endif /* * * @tc.name: it_test_pthread_003 * @tc.desc: function for ProcessPthreadTest @@ -179,19 +155,6 @@ HWTEST_F(ProcessPthreadTest, ItTestPthread013, TestSize.Level0) ItTestPthread013(); } -#ifndef LOSCFG_USER_TEST_SMP -/* * - * @tc.name: it_test_pthread_014 - * @tc.desc: function for ProcessPthreadTest - * @tc.type: FUNC - * @tc.require: AR000EEMQ9 - */ -HWTEST_F(ProcessPthreadTest, ItTestPthread014, TestSize.Level0) -{ - ItTestPthread014(); -} -#endif - /* * * @tc.name: it_test_pthread_015 * @tc.desc: function for ProcessPthreadTest @@ -328,6 +291,29 @@ HWTEST_F(ProcessPthreadTest, ItTestPthreadCond004, TestSize.Level0) #endif #if defined(LOSCFG_USER_TEST_FULL) +/* * + * @tc.name: it_test_pthread_001 + * @tc.desc: function for ProcessPthreadTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(ProcessPthreadTest, ItTestPthread001, TestSize.Level0) +{ + ItTestPthread001(); +} + +#ifndef LOSCFG_USER_TEST_SMP +/* * + * @tc.name: it_test_pthread_002 + * @tc.desc: function for ProcessPthreadTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(ProcessPthreadTest, ItTestPthread002, TestSize.Level0) +{ + ItTestPthread002(); +} +#endif /* * * @tc.name: it_test_pthread_004 * @tc.desc: function for ProcessPthreadTest @@ -349,5 +335,19 @@ HWTEST_F(ProcessPthreadTest, ItTestPthread005, TestSize.Level0) { ItTestPthread005(); } + +#ifndef LOSCFG_USER_TEST_SMP +/* * + * @tc.name: it_test_pthread_014 + * @tc.desc: function for ProcessPthreadTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(ProcessPthreadTest, ItTestPthread014, TestSize.Level0) +{ + ItTestPthread014(); +} +#endif + #endif } // namespace OHOS diff --git a/testsuites/unittest/process/pthread/smoke/pthread_cond_test_001.cpp b/testsuites/unittest/process/pthread/smoke/pthread_cond_test_001.cpp index 42336efc..ed5debca 100644 --- a/testsuites/unittest/process/pthread/smoke/pthread_cond_test_001.cpp +++ b/testsuites/unittest/process/pthread/smoke/pthread_cond_test_001.cpp @@ -41,7 +41,7 @@ static void *PthreadF01(void *t) ICUNIT_GOTO_EQUAL(rc, 0, rc, EXIT); g_testCount++; - LosTaskDelay(1); + LosTaskDelay(100); ICUNIT_GOTO_EQUAL(g_testCount, 2, g_testCount, EXIT); // 2, here assert the result. g_testCount++; diff --git a/testsuites/unittest/process/pthread/smoke/pthread_test_006.cpp b/testsuites/unittest/process/pthread/smoke/pthread_test_006.cpp index 460370e2..3846c74f 100644 --- a/testsuites/unittest/process/pthread/smoke/pthread_test_006.cpp +++ b/testsuites/unittest/process/pthread/smoke/pthread_test_006.cpp @@ -125,6 +125,8 @@ static int Testcase(void) ret = pthread_create(&newPthread[index], &a, ThreadFuncTest2, &threadParam[index]); ICUNIT_ASSERT_EQUAL(ret, 0, ret); + sleep(1); + ICUNIT_ASSERT_EQUAL(g_testToCount001, testCount, g_testToCount001); index = 0;