1 /*
2 * Copyright (c) 2021 Huawei Device Co., Ltd.
3 *
4 * HDF is dual licensed: you can use it either under the terms of
5 * the GPL, or the BSD license, at your option.
6 * See the LICENSE file in the root of this repository for complete details.
7 */
8
9 #include <cstdint>
10 #include <cstdio>
11 #include <cstdlib>
12 #include <fcntl.h>
13 #include <string>
14 #include <unistd.h>
15 #include <gtest/gtest.h>
16 #include "hdf_uhdf_test.h"
17 #include "platform_queue_test.h"
18
19 using namespace testing::ext;
20
21 class HdfPlatformQueueTest : public testing::Test {
22 public:
23 static void SetUpTestCase();
24 static void TearDownTestCase();
25 void SetUp();
26 void TearDown();
27 };
28
SetUpTestCase()29 void HdfPlatformQueueTest::SetUpTestCase()
30 {
31 HdfTestOpenService();
32 }
33
TearDownTestCase()34 void HdfPlatformQueueTest::TearDownTestCase()
35 {
36 HdfTestCloseService();
37 }
38
SetUp()39 void HdfPlatformQueueTest::SetUp()
40 {
41 }
42
TearDown()43 void HdfPlatformQueueTest::TearDown()
44 {
45 }
46
47 /**
48 * @tc.name: HdfPlatformQueueTestAddAndWait001
49 * @tc.desc: platform queue function test
50 * @tc.type: FUNC
51 * @tc.require: NA
52 */
53 HWTEST_F(HdfPlatformQueueTest, HdfPlatformQueueTestAddAndWait001, TestSize.Level1)
54 {
55 struct HdfTestMsg msg = {TEST_PAL_QUEUE_TYPE, PLAT_QUEUE_TEST_ADD_AND_WAIT, -1};
56 EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
57 }
58
59 /**
60 * @tc.name: HdfPlatformQueueTestReliability001
61 * @tc.desc: platform queue function test
62 * @tc.type: FUNC
63 * @tc.require: NA
64 */
65 HWTEST_F(HdfPlatformQueueTest, HdfPlatformQueueTestReliability001, TestSize.Level1)
66 {
67 struct HdfTestMsg msg = {TEST_PAL_QUEUE_TYPE, PLAT_QUEUE_TEST_RELIABILITY, -1};
68 EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
69 }
70