• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <gtest/gtest.h>
17 #include "client_msg_handler.h"
18 
19 namespace {
20 using namespace testing::ext;
21 using namespace OHOS::MMI;
22 using namespace OHOS;
23 
24 class DfxSdkTest : public testing::Test {
25 public:
SetUpTestCase(void)26     static void SetUpTestCase(void) {}
TearDownTestCase(void)27     static void TearDownTestCase(void) {}
28 };
29 
30 class DfxClientTest : public ClientMsgHandler {
31 public:
GetMultimodeInputInfoClientTest(const UDSClient & client,NetPacket & pkt)32     int32_t GetMultimodeInputInfoClientTest(const UDSClient& client, NetPacket& pkt)
33     {
34         return GetMultimodeInputInfo(client, pkt);
35     }
36 };
37 
38 #ifdef SDK
39 
40 HWTEST_F(DfxSdkTest, Test_Client_SDK, TestSize.Level1)
41 {
42     Start();
43     DfxTest sdkTest;
44     UDSClient client;
45     NetPacket pkt(static_cast<MmiMessageId>(1));
46     sdkTest.Init();
47     auto ret = clientSdkTest.GetMultimodeInputInfoClientTest(client, pkt);
48     std::this_thread::sleep_for(std::chrono::seconds(1));
49     EXPECT_EQ(ret, RET_OK);
50 }
51 #endif
52 } // namespace
53