提交 9fac7b90 编写于 作者: X XiYuhao

open trace testcase

Signed-off-by: NXiYuhao <xiyuhao@huawei.com>
上级 a944546e
......@@ -69,11 +69,41 @@ ohos_unittest("IPCFileDescOpsTest") {
"//foundation/communication/ipc/test/resource/ipc/ohos_test.xml"
}
ohos_unittest("IPCHiTraceUnitTest") {
module_out_path = MODULE_OUTPUT_PATH
include_dirs = [ "//utils/system/safwk/native/include" ]
sources = [ "ipc_hitrace_unittest.cpp" ]
configs = [
"$SUBSYSTEM_DIR:ipc_util_config",
"$IPC_TEST_ROOT:ipc_test_config",
]
deps = [
"$IPC_TEST_ROOT/auxiliary/native:TestAssistance",
"//third_party/googletest:gtest_main",
"//utils/native/base:utils",
]
external_deps = [
"hitrace_native:libhitrace",
"hiviewdfx_hilog_native:libhilog",
"ipc:ipc_core",
"samgr_standard:samgr_proxy",
]
resource_config_file =
"//foundation/communication/ipc/test/resource/ipc/ohos_test.xml"
}
###############################################################################
group("unittest") {
testonly = true
deps = [
":IPCFileDescOpsTest",
":IPCHiTraceUnitTest",
":IPCNativeUnitTest",
]
}
......
......@@ -37,9 +37,7 @@ public:
int TransOversizedPkt(const std::string &dataStr, std::string &repStr) override;
int ProxyTransRawData(int length) override;
int StubTransRawData(int length) override;
#ifndef CONFIG_STANDARD_SYSTEM
int GetChildId(uint64_t &rep) override;
#endif
sptr<IRemoteObject> GetRemoteObject(int type) override;
int FlushAsyncCommands(int count, int length) override;
int GetRemoteDecTimes() override;
......
......@@ -23,9 +23,7 @@
#include "iremote_proxy.h"
#include "hilog/log.h"
#include "log_tags.h"
#ifndef CONFIG_STANDARD_SYSTEM
#include "hitrace/trace.h"
#endif
namespace OHOS {
class IDBinderTestService : public IRemoteBroker {
......@@ -74,9 +72,7 @@ public:
virtual int TransOversizedPkt(const std::string &dataStr, std::string &repStr) = 0;
virtual int ProxyTransRawData(int lengths) = 0;
virtual int StubTransRawData(int length) = 0;
#ifndef CONFIG_STANDARD_SYSTEM
virtual int GetChildId(uint64_t &rep) = 0;
#endif
virtual int FlushAsyncCommands(int count, int length) = 0;
virtual sptr<IRemoteObject> GetRemoteObject(int type) = 0;
virtual int GetRemoteDecTimes() = 0;
......@@ -108,9 +104,7 @@ private:
int OnReceivedStubObject(MessageParcel &data, MessageParcel &reply);
int OnReceivedOversizedPkt(MessageParcel &data, MessageParcel &reply);
int OnReceivedRawData(MessageParcel &data, MessageParcel &reply);
#ifndef CONFIG_STANDARD_SYSTEM
int OnGetChildId(MessageParcel &data, MessageParcel &reply);
#endif
int OnSentRawData(MessageParcel &data, MessageParcel &reply);
int OnReceivedGetStubObject(MessageParcel &data, MessageParcel &reply);
int OnReceivedGetDecTimes(MessageParcel &data, MessageParcel &reply);
......@@ -137,9 +131,7 @@ public:
int TransOversizedPkt(const std::string &dataStr, std::string &repStr) override;
int ProxyTransRawData(int length) override;
int StubTransRawData(int length) override;
#ifndef CONFIG_STANDARD_SYSTEM
int GetChildId(uint64_t &rep) override;
#endif
sptr<IRemoteObject> GetRemoteObject(int type) override;
int GetRemoteDecTimes() override;
void ClearRemoteDecTimes() override;
......
......@@ -1083,7 +1083,6 @@ HWTEST_F(DbinderTest, DbinderRemoteCall023, TestSize.Level3)
SetCurrentTestCase(DBINDER_TEST_INIT);
}
#ifndef CONFIG_STANDARD_SYSTEM
/*
* @tc.name: DbinderRemoteCall024
* @tc.desc: trace test
......@@ -1117,7 +1116,6 @@ HWTEST_F(DbinderTest, DbinderRemoteCall024, TestSize.Level3)
SetCurrentTestCase(DBINDER_TEST_INIT);
}
#endif
/*
* @tc.name: DbinderRemoteCall025
......
......@@ -156,13 +156,11 @@ int DBinderTestService::StubTransRawData(int length)
return 0;
}
#ifndef CONFIG_STANDARD_SYSTEM
int DBinderTestService::GetChildId(uint64_t &rep)
{
DBINDER_LOGI("enter %{public}s", __func__);
return 0;
}
#endif
int DBinderTestService::FlushAsyncCommands(int count, int length)
{
......
......@@ -60,7 +60,6 @@ int DBinderTestServiceProxy::ReverseInt(int data, int &rep)
return error;
}
#ifndef CONFIG_STANDARD_SYSTEM
int DBinderTestServiceProxy::GetChildId(uint64_t &rep)
{
int error;
......@@ -72,7 +71,6 @@ int DBinderTestServiceProxy::GetChildId(uint64_t &rep)
DBINDER_LOGE("rep = %{public}" PRIu64 ", error = %{public}d", rep, error);
return error;
}
#endif
int DBinderTestServiceProxy::TransProxyObject(int data, sptr<IRemoteObject> &transObject, int operation, int &rep,
int &withdrawRes)
......@@ -461,11 +459,9 @@ int DBinderTestServiceStub::OnRemoteRequest(uint32_t code, MessageParcel &data,
case RECEIVE_RAW_DATA: {
return OnSentRawData(data, reply);
}
#ifndef CONFIG_STANDARD_SYSTEM
case TRANS_TRACE_ID: {
return OnGetChildId(data, reply);
}
#endif
case GET_REMOTE_STUB_OBJECT: {
return OnReceivedGetStubObject(data, reply);
}
......@@ -501,7 +497,6 @@ int DBinderTestServiceStub::OnReverseInt(MessageParcel &data, MessageParcel &rep
return ret;
}
#ifndef CONFIG_STANDARD_SYSTEM
int DBinderTestServiceStub::OnGetChildId(MessageParcel &data, MessageParcel &reply)
{
uint64_t reqData = HiTrace::GetId().GetChainId();
......@@ -527,7 +522,6 @@ int DBinderTestServiceStub::OnGetChildId(MessageParcel &data, MessageParcel &rep
IPCSkeleton::GetLocalDeviceID().c_str(), IPCSkeleton::IsLocalCalling());
return ERR_NONE;
}
#endif
int DBinderTestServiceStub::OnReverseIntDelay(MessageParcel &data, MessageParcel &reply)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册