提交 886f8df1 编写于 作者: L liubb_0516

add ipc gtest case

Signed-off-by: Nliubb_0516 <liubeibei8@huawei.com>
上级 a73b9d4f
...@@ -220,7 +220,7 @@ HWTEST_F(IpcClientTest, IpcClientTest007, TestSize.Level2) // 同步性能测试 ...@@ -220,7 +220,7 @@ HWTEST_F(IpcClientTest, IpcClientTest007, TestSize.Level2) // 同步性能测试
struct timespec end = {0, 0}; struct timespec end = {0, 0};
clock_gettime(CLOCK_REALTIME, &start); clock_gettime(CLOCK_REALTIME, &start);
for (int i = 0; i < 100; i++) { for (int i = 0; i < PERFORMANCE_TEST_TIMES; i++) {
SendRequest(sidServer, SERVER_OP_ADD, &data2, &reply2, g_option, &ptr2); SendRequest(sidServer, SERVER_OP_ADD, &data2, &reply2, g_option, &ptr2);
ReadInt32(&reply2, &res); ReadInt32(&reply2, &res);
FreeBuffer((void *)ptr2); FreeBuffer((void *)ptr2);
...@@ -239,15 +239,13 @@ HWTEST_F(IpcClientTest, IpcClientTest008, TestSize.Level2) // 异步性能测 ...@@ -239,15 +239,13 @@ HWTEST_F(IpcClientTest, IpcClientTest008, TestSize.Level2) // 异步性能测
WriteInt32(&data2, OP_A); WriteInt32(&data2, OP_A);
WriteInt32(&data2, OP_B); WriteInt32(&data2, OP_B);
int res;
struct timespec start = {0, 0}; struct timespec start = {0, 0};
struct timespec end = {0, 0}; struct timespec end = {0, 0};
MessageOption option = TF_OP_ASYNC; MessageOption option = TF_OP_ASYNC;
clock_gettime(CLOCK_REALTIME, &start); clock_gettime(CLOCK_REALTIME, &start);
for (int i = 0; i < 100; i++) { for (int i = 0; i < PERFORMANCE_TEST_TIMES; i++) {
SendRequest(sidServer, SERVER_OP_ADD, &data2, NULL, option, NULL); SendRequest(sidServer, SERVER_OP_ADD, &data2, NULL, option, NULL);
} }
clock_gettime(CLOCK_REALTIME, &end); clock_gettime(CLOCK_REALTIME, &end);
......
...@@ -41,7 +41,9 @@ enum { ...@@ -41,7 +41,9 @@ enum {
SERVER_SA_ID2 = 18, SERVER_SA_ID2 = 18,
}; };
#define IPC_TEST_TIME_INTERVAL 60 #define IPC_TEST_TIME_INTERVAL 120
#define PERFORMANCE_TEST_TIMES 100
#define OP_A 12 #define OP_A 12
#define OP_B 17 #define OP_B 17
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册