From 470d257fe3a438e26d2c135e57af67d88355175b Mon Sep 17 00:00:00 2001 From: "wangkai399@huawei.com" Date: Tue, 26 Apr 2022 17:10:54 +0800 Subject: [PATCH] =?UTF-8?q?IPC=E7=BB=9F=E4=B8=80=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangkai399@huawei.com --- aafwk_lite/ability_posix/BUILD.gn | 2 +- .../ability_posix/src/AbilityMgrTest.cpp | 22 ++++++++++--------- .../ability_posix/src/AbilityMgrTest2.cpp | 6 ++--- appexecfwk_lite/appexecfwk_posix/BUILD.gn | 2 +- build_lite/BUILD.gn | 16 +++++++------- .../distributed_schedule_posix/BUILD.gn | 2 +- .../system_ability_manager_posix/BUILD.gn | 2 +- 7 files changed, 27 insertions(+), 25 deletions(-) diff --git a/aafwk_lite/ability_posix/BUILD.gn b/aafwk_lite/ability_posix/BUILD.gn index 9f0d1c4e..b9e23582 100755 --- a/aafwk_lite/ability_posix/BUILD.gn +++ b/aafwk_lite/ability_posix/BUILD.gn @@ -26,7 +26,7 @@ hcpptest_suite("ActsAbilityMgrTest") { "${aafwk_lite_path}/frameworks/ability_lite:aafwk_abilitykit_lite", "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle", "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single", "//foundation/distributedschedule/samgr_lite/samgr:samgr", "//utils/native/lite/kv_store:kv_store", ] diff --git a/aafwk_lite/ability_posix/src/AbilityMgrTest.cpp b/aafwk_lite/ability_posix/src/AbilityMgrTest.cpp index 98cc9767..3143961b 100755 --- a/aafwk_lite/ability_posix/src/AbilityMgrTest.cpp +++ b/aafwk_lite/ability_posix/src/AbilityMgrTest.cpp @@ -85,22 +85,24 @@ static void OnAbilityConnectDone(ElementName *elementName, SvcIdentity *serviceS printf("ipc callback success \n"); // push data IpcIo request; - char data[IPC_IO_DATA_MAX]; - IpcIoInit(&request, data, IPC_IO_DATA_MAX, 0); + char data[MAX_IO_SIZE]; + IpcIoInit(&request, data, MAX_IO_SIZE, 0); int32_t data1 = 10; int32_t data2 = 6; - IpcIoPushInt32(&request, data1); - IpcIoPushInt32(&request, data2); + WriteInt32(&request, data1); + WriteInt32(&request, data2); // send and getReply IpcIo reply = {nullptr}; uintptr_t ptr = 0; - Transact(NULL, *serviceSid, 0, &request, &reply, LITEIPC_FLAG_DEFAULT, &ptr); - g_errorCode = IpcIoPopInt32(&reply); + MessageOption option; + MessageOptionInit(&option); + SendRequest(*serviceSid, 0, &request, &reply, option, &ptr); + ReadInt32(&reply, &g_errorCode); if (g_errorCode != 0) { printf("execute add method, result is %d\n", g_errorCode); } if (ptr != 0) { - FreeBuffer(nullptr, reinterpret_cast(ptr)); + FreeBuffer(reinterpret_cast(ptr)); } sem_post(&g_sem); } @@ -654,7 +656,7 @@ HWTEST_F(AbilityMgrTest, testDisConnectAbility, Function | MediumTest | Level1) sem_timedwait(&g_sem, &ts); printf("sem exit \n"); printf("ret of connect is %d \n ", result); - if (g_errorCode == 16) { + if (result == 0) { result = DisconnectAbility(&g_conn); sleep(2); EXPECT_EQ(result, 0); @@ -709,10 +711,10 @@ HWTEST_F(AbilityMgrTest, testDisConnectAbilityIllegal, Function | MediumTest | L ts.tv_sec += WAIT_TIMEOUT; sem_timedwait(&g_sem, &ts); printf("sem exit \n"); - printf("ret is of connect is %d \n ", g_errorCode); + printf("ret of connect is %d \n ", result); EXPECT_EQ(result, 0); g_errorCode = DisconnectAbility(nullptr); - int expect = -10; + int expect = -2; EXPECT_EQ(g_errorCode, expect); printf("ret of disconnect is %d \n ", g_errorCode); ClearElement(&element); diff --git a/aafwk_lite/ability_posix/src/AbilityMgrTest2.cpp b/aafwk_lite/ability_posix/src/AbilityMgrTest2.cpp index be9bcaa0..628105ca 100755 --- a/aafwk_lite/ability_posix/src/AbilityMgrTest2.cpp +++ b/aafwk_lite/ability_posix/src/AbilityMgrTest2.cpp @@ -89,13 +89,13 @@ static void OnAbilityConnectDone(ElementName *elementName, SvcIdentity *serviceS IpcIoInit(&request, data, IPC_IO_DATA_MAX, 0); int32_t data1 = 10; int32_t data2 = 6; - IpcIoPushInt32(&request, data1); - IpcIoPushInt32(&request, data2); + WreitInt32(&request, data1); + WriteInt32(&request, data2); // send and getReply IpcIo reply = {nullptr}; uintptr_t ptr = 0; Transact(NULL, *serviceSid, 0, &request, &reply, LITEIPC_FLAG_DEFAULT, &ptr); - g_errorCode = IpcIoPopInt32(&reply); + ReadInt32(&reply, &g_errorCode); if (g_errorCode != 0) { printf("execute add method, result is %d\n", g_errorCode); } diff --git a/appexecfwk_lite/appexecfwk_posix/BUILD.gn b/appexecfwk_lite/appexecfwk_posix/BUILD.gn index 5066813b..afaa8b26 100755 --- a/appexecfwk_lite/appexecfwk_posix/BUILD.gn +++ b/appexecfwk_lite/appexecfwk_posix/BUILD.gn @@ -36,7 +36,7 @@ hcpptest_suite("ActsBundleMgrTest") { deps = [ "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle", "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single", "//foundation/distributedschedule/samgr_lite/samgr:samgr", ] diff --git a/build_lite/BUILD.gn b/build_lite/BUILD.gn index 1eda1e87..2a736bbf 100644 --- a/build_lite/BUILD.gn +++ b/build_lite/BUILD.gn @@ -75,19 +75,19 @@ lite_component("acts_component") { ] } else if (ohos_kernel_type == "linux") { all_features += [ - #"//test/xts/acts/utils_lite/kv_store_posix:ActsKvStoreTest", - #"//test/xts/acts/startup_lite/syspara_posix:ActsParameterTest", - #"//test/xts/acts/startup_lite/bootstrap_posix:ActsBootstrapTest", - #"//test/xts/acts/communication_lite/lwip_posix:ActsLwipTest", - #"//test/xts/acts/security_lite:securitytest", + "//test/xts/acts/utils_lite/kv_store_posix:ActsKvStoreTest", + "//test/xts/acts/startup_lite/syspara_posix:ActsParameterTest", + "//test/xts/acts/startup_lite/bootstrap_posix:ActsBootstrapTest", + "//test/xts/acts/communication_lite/lwip_posix:ActsLwipTest", + "//test/xts/acts/security_lite:securitytest", #"//test/xts/acts/multimedia_lite/camera_lite_posix/camera_native:ActsMediaCameraTest", #"//test/xts/acts/multimedia_lite/media_lite_posix/player_native:ActsMediaPlayerTest", #"//test/xts/acts/multimedia_lite/media_lite_posix/recorder_native:ActsMediaRecorderTest", "//test/xts/acts/distributed_schedule_lite/system_ability_manager_posix:ActsSamgrTest", - #"//test/xts/acts/appexecfwk_lite/appexecfwk_posix:ActsBundleMgrTest", - #"//test/xts/acts/aafwk_lite/ability_posix:ActsAbilityMgrTest", - #"//test/xts/acts/ai_lite/ai_engine_posix/base:ActsAiEngineTest", + "//test/xts/acts/appexecfwk_lite/appexecfwk_posix:ActsBundleMgrTest", + "//test/xts/acts/aafwk_lite/ability_posix:ActsAbilityMgrTest", + "//test/xts/acts/ai_lite/ai_engine_posix/base:ActsAiEngineTest", ] } } diff --git a/distributed_schedule_lite/distributed_schedule_posix/BUILD.gn b/distributed_schedule_lite/distributed_schedule_posix/BUILD.gn index b274cca8..f02fef17 100755 --- a/distributed_schedule_lite/distributed_schedule_posix/BUILD.gn +++ b/distributed_schedule_lite/distributed_schedule_posix/BUILD.gn @@ -27,7 +27,7 @@ hcpptest_suite("ActsDMSTest") { "src/utils", "//utils/native/lite/include", "//third_party/bounds_checking_function/include", - "//foundation/communication/ipc_lite/interfaces/kits", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc/include", "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", "//foundation/distributedschedule/dmsfwk_lite/include", diff --git a/distributed_schedule_lite/system_ability_manager_posix/BUILD.gn b/distributed_schedule_lite/system_ability_manager_posix/BUILD.gn index af1b6788..348adc56 100755 --- a/distributed_schedule_lite/system_ability_manager_posix/BUILD.gn +++ b/distributed_schedule_lite/system_ability_manager_posix/BUILD.gn @@ -76,7 +76,7 @@ hcpptest_suite("ActsSamgrTest") { ] deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single", "//foundation/distributedschedule/samgr_lite/communication/broadcast:broadcast", "//foundation/distributedschedule/samgr_lite/samgr:samgr", "//third_party/bounds_checking_function:libsec_shared", -- Gitee