• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020-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 <gtest/gtest.h>
14 #include <string>
15 #include <unistd.h>
16 #include "hdf_uhdf_test.h"
17 #include "hdf_io_service_if.h"
18 
19 using namespace testing::ext;
20 
21 namespace ConfigTest {
22 const int8_t HDF_MSG_RESULT_DEFAULT = 3;
23 
24 // hcs config test case number
25 enum HdfTestCaseCmd {
26     HDF_CREATE_DM_HSL_TO_TREE_001,
27     HDF_GET_NODE_BY_ATTR_VALUE_001,
28     HDF_GET_NODE_BY_ATTR_VALUE_002,
29     HDF_GET_BOOL_ATTR_VALUE_001,
30     HDF_GET_BOOL_ATTR_VALUE_002,
31     HDF_GET_UINT8_ATTR_VALUE_001,
32     HDF_GET_UINT8_ATTR_VALUE_002,
33     HDF_GET_UINT8_ARRAY_ELEM_ATTR_VALUE_001,
34     HDF_GET_UINT8_ARRAY_ELEM_ATTR_VALUE_002,
35     HDF_GET_UINT8_ARRAY_ATTR_VALUE_001,
36     HDF_GET_UINT8_ARRAY_ATTR_VALUE_002,
37     HDF_GET_UINT16_ATTR_VALUE_001,
38     HDF_GET_UINT16_ATTR_VALUE_002,
39     HDF_GET_UINT16_ARRAY_ELEM_ATTR_VALUE_001,
40     HDF_GET_UINT16_ARRAY_ELEM_ATTR_VALUE_002,
41     HDF_GET_UINT16_ARRAY_ATTR_VALUE_001,
42     HDF_GET_UINT16_ARRAY_ATTR_VALUE_002,
43     HDF_GET_UINT32_ATTR_VALUE_001,
44     HDF_GET_UINT32_ATTR_VALUE_002,
45     HDF_GET_UINT32_ARRAY_ELEM_ATTR_VALUE_001,
46     HDF_GET_UINT32_ARRAY_ELEM_ATTR_VALUE_002,
47     HDF_GET_UINT32_ARRAY_ATTR_VALUE_001,
48     HDF_GET_UINT32_ARRAY_ATTR_VALUE_002,
49     HDF_GET_UINT64_ATTR_VALUE_001,
50     HDF_GET_UINT64_ATTR_VALUE_002,
51     HDF_GET_UINT64_ARRAY_ELEM_ATTR_VALUE_001,
52     HDF_GET_UINT64_ARRAY_ELEM_ATTR_VALUE_002,
53     HDF_GET_UINT64_ARRAY_ATTR_VALUE_001,
54     HDF_GET_UINT64_ARRAY_ATTR_VALUE_002,
55     HDF_GET_ELEM_NUM_VALUE_001,
56     HDF_GET_ELEM_NUM_VALUE_002,
57     HDF_GET_CHILD_NODE_001,
58     HDF_GET_CHILD_NODE_002,
59     HDF_TRAVERSE_ATTR_IN_NODE_001,
60     HDF_TRAVERSE_ATTR_IN_NODE_002,
61     HDF_GET_STRING_ATTR_VALUE_001,
62     HDF_GET_STRING_ATTR_VALUE_002,
63     HDF_GET_STRING_ARRAY_ELEM_ATTR_VALUE_001,
64     HDF_GET_STRING_ARRAY_ELEM_ATTR_VALUE_002,
65     HDF_GET_NODE_BY_ATTR_REF_001,
66     HDF_GET_NODE_BY_ATTR_REF_002,
67     HDF_MACRO_GET_ONE_NODE,
68     HDF_MACRO_CHECK_NODE_EXISTS,
69     HDF_MACRO_CHECK_NODE_NOT_EXISTS,
70     HDF_MACRO_GET_ONE_NODE_PROP,
71     HDF_MACRO_CHECK_NODE_PROP_EXISTS,
72     HDF_MACRO_CHECK_NODE_PROP_NOT_EXISTS,
73     HDF_MACRO_TRAVERSAL_ONE_NODE,
74     HDF_MACRO_GET_ARRAY_SIZE,
75     HDF_MACRO_GET_ONE_ARRAY_ELEMENT,
76     HDF_MACRO_TRAVERSAL_ONE_ARRAY,
77     HDF_MACRO_TRAVERSAL_ALL_ARRAY,
78     HDF_MACRO_TRAVERSAL_NODE_CHILD,
79     HDF_MACRO_TRAVERSAL_NODE_CHILD_VARGS,
80     HDF_MACRO_GET_ONE_FILE,
81 };
82 
83 class HdfConfigTest : public testing::Test {
84 public:
85     static void SetUpTestCase();
86     static void TearDownTestCase();
87     void SetUp();
88     void TearDown();
89 };
90 
SetUpTestCase()91 void HdfConfigTest::SetUpTestCase()
92 {
93     HdfTestOpenService();
94 }
95 
TearDownTestCase()96 void HdfConfigTest::TearDownTestCase()
97 {
98     HdfTestCloseService();
99 }
100 
SetUp()101 void HdfConfigTest::SetUp() {}
102 
TearDown()103 void HdfConfigTest::TearDown() {}
104 
105 /**
106  * @tc.name: HslTestCreateDMHslToTree001
107  * @tc.desc: Create a configuration tree and start configuration test
108  * @tc.type: FUNC
109  * @tc.require: AR000DQ0TB
110  */
111 HWTEST_F(HdfConfigTest, HslTestCreateDMHslToTree001, TestSize.Level1)
112 {
113     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_CREATE_DM_HSL_TO_TREE_001, HDF_MSG_RESULT_DEFAULT};
114     printf("HdfConfigTest enter\n\r");
115     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
116 }
117 
118 /**
119  * @tc.name: HslTestGetNodeByMatchAttrSuccess001
120  * @tc.desc: Obtains the root node of the configuration tree
121  * @tc.type: FUNC
122  * @tc.require: AR000DQ0TB
123  */
124 HWTEST_F(HdfConfigTest, HslTestGetNodeByMatchAttrSuccess001, TestSize.Level1)
125 {
126     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_NODE_BY_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
127     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
128 }
129 
130 /**
131  * @tc.name: HslTestGetNodeByMatchAttrFail001
132  * @tc.desc: Failed to obtain the root node of the configuration tree
133  * @tc.type: FUNC
134  * @tc.require: AR000DQ0TB
135  */
136 HWTEST_F(HdfConfigTest, HslTestGetNodeByMatchAttrFail001, TestSize.Level1)
137 {
138     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_NODE_BY_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
139     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
140 }
141 
142 /**
143  * @tc.name: HslTestGetBoolAttrValueSuccess001
144  * @tc.desc: Obtains the value of a <b>BOOL</b> attribute of a configuration tree node
145  * @tc.type: FUNC
146  * @tc.require: AR000DQ0TB
147  */
148 HWTEST_F(HdfConfigTest, HslTestGetBoolAttrValueSuccess001, TestSize.Level1)
149 {
150     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_BOOL_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
151     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
152 }
153 
154 /**
155  * @tc.name: HslTestGetBoolAttrValueFail001
156  * @tc.desc: Failed to obtain the value of a <b>BOOL</b> attribute of a configuration tree node
157  * @tc.type: FUNC
158  * @tc.require: AR000DQ0TB
159  */
160 HWTEST_F(HdfConfigTest, HslTestGetBoolAttrValueFail001, TestSize.Level1)
161 {
162     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_BOOL_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
163     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
164 }
165 
166 /**
167  * @tc.name: HslTestGetUint8AttrValueSuccess001
168  * @tc.desc: Obtains the value of a <b>Uint8</b> attribute of a configuration tree node
169  * @tc.type: FUNC
170  * @tc.require: AR000DQ0TB
171  */
172 HWTEST_F(HdfConfigTest, HslTestGetUint8AttrValueSuccess001, TestSize.Level1)
173 {
174     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT8_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
175     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
176 }
177 
178 /**
179  * @tc.name: HslTestGetUint8AttrValueFail001
180  * @tc.desc: Failed to obtain the value of a <b>Uint8</b> attribute of a configuration tree node
181  * @tc.type: FUNC
182  * @tc.require: AR000DQ0TB
183  */
184 HWTEST_F(HdfConfigTest, HslTestGetUint8AttrValueFail001, TestSize.Level1)
185 {
186     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT8_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
187     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
188 }
189 
190 /**
191  * @tc.name: HslTestGetUint8ArrayElemSuccess001
192  * @tc.desc: Obtains the value of a <b>Unit8</b> array attribute numbered of a configuration tree node
193  * @tc.type: FUNC
194  * @tc.require: AR000DQ0TB
195  */
196 HWTEST_F(HdfConfigTest, HslTestGetUint8ArrayElemSuccess001, TestSize.Level1)
197 {
198     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT8_ARRAY_ELEM_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
199     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
200 }
201 
202 /**
203  * @tc.name: HslTestGetUint8ArrayElemFail001
204  * @tc.desc: Failed to obtain the value of a <b>Unit8</b> array attribute numbered of a configuration tree node
205  * @tc.type: FUNC
206  * @tc.require: AR000DQ0TB
207  */
208 HWTEST_F(HdfConfigTest, HslTestGetUint8ArrayElemFail001, TestSize.Level1)
209 {
210     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT8_ARRAY_ELEM_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
211     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
212 }
213 
214 /**
215  * @tc.name: HslTestGetUint8ArraySuccess001
216  * @tc.desc: Obtains the values of a <b>Uint8</b> array attribute of a configuration tree node
217  * @tc.type: FUNC
218  * @tc.require: AR000DQ0TB
219  */
220 HWTEST_F(HdfConfigTest, HslTestGetUint8ArraySuccess001, TestSize.Level1)
221 {
222     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT8_ARRAY_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
223     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
224 }
225 
226 /**
227  * @tc.name: HslTestGetUint8ArrayFail001
228  * @tc.desc: Failed to obtain the values of a <b>Uint8</b> array attribute of a configuration tree node
229  * @tc.type: FUNC
230  * @tc.require: AR000DQ0TB
231  */
232 HWTEST_F(HdfConfigTest, HslTestGetUint8ArrayFail001, TestSize.Level1)
233 {
234     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT8_ARRAY_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
235     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
236 }
237 
238 /**
239  * @tc.name: HslTestGetUint16AttrValueSuccess001
240  * @tc.desc: Obtains the value of a <b>Uint16</b> attribute of a configuration tree node
241  * @tc.type: FUNC
242  * @tc.require: AR000DQ0TB
243  */
244 HWTEST_F(HdfConfigTest, HslTestGetUint16AttrValueSuccess001, TestSize.Level1)
245 {
246     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT16_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
247     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
248 }
249 
250 /**
251  * @tc.name: HslTestGetUint16AttrValueFail001
252  * @tc.desc: Failed to obtain the value of a <b>Uint16</b> attribute of a configuration tree node
253  * @tc.type: FUNC
254  * @tc.require: AR000DQ0TB
255  */
256 HWTEST_F(HdfConfigTest, HslTestGetUint16AttrValueFail001, TestSize.Level1)
257 {
258     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT16_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
259     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
260 }
261 
262 /**
263  * @tc.name: HslTestGetUint16ArrayElemSuccess001
264  * @tc.desc: Obtains the value of a <b>Uint16</b> array attribute numbered <b>index</b> of a configuration tree node
265  * @tc.type: FUNC
266  * @tc.require: AR000DQ0TB
267  */
268 HWTEST_F(HdfConfigTest, HslTestGetUint16ArrayElemSuccess001, TestSize.Level1)
269 {
270     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT16_ARRAY_ELEM_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
271     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
272 }
273 
274 /**
275  * @tc.name: HslTestGetUint16ArrayElemFail001
276  * @tc.desc: Failed to obtain the value of a <b>Uint16</b> array attribute numbered <b>index</b> of a
277  * configuration tree node
278  * @tc.type: FUNC
279  * @tc.require: AR000DQ0TB
280  */
281 HWTEST_F(HdfConfigTest, HslTestGetUint16ArrayElemFail001, TestSize.Level1)
282 {
283     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT16_ARRAY_ELEM_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
284     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
285 }
286 
287 /**
288  * @tc.name: HslTestGetUint16ArraySuccess001
289  * @tc.desc: Obtains the values of a <b>Uint16</b> array attribute of a configuration tree node
290  * @tc.type: FUNC
291  * @tc.require: AR000DQ0TB
292  */
293 HWTEST_F(HdfConfigTest, HslTestGetUint16ArraySuccess001, TestSize.Level1)
294 {
295     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT16_ARRAY_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
296     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
297 }
298 
299 /**
300  * @tc.name: HslTestGetUint16ArrayFail001
301  * @tc.desc: Failed to obtain the values of a <b>Uint16</b> array attribute of a configuration tree node
302  * @tc.type: FUNC
303  * @tc.require: AR000DQ0TB
304  */
305 HWTEST_F(HdfConfigTest, HslTestGetUint16ArrayFail001, TestSize.Level1)
306 {
307     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT16_ARRAY_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
308     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
309 }
310 
311 /**
312  * @tc.name: HslTestGetUint32AttrValueSuccess001
313  * @tc.desc: Obtains the value of a <b>Uint32</b> attribute of a configuration tree node
314  * @tc.type: FUNC
315  * @tc.require: AR000DQ0TB
316  */
317 HWTEST_F(HdfConfigTest, HslTestGetUint32AttrValueSuccess001, TestSize.Level1)
318 {
319     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT32_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
320     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
321 }
322 
323 /**
324  * @tc.name: HslTestGetUint32AttrValueFail001
325  * @tc.desc: Failed to obtain the value of a <b>Uint32</b> attribute of a configuration tree node
326  * @tc.type: FUNC
327  * @tc.require: AR000DQ0TB
328  */
329 HWTEST_F(HdfConfigTest, HslTestGetUint32AttrValueFail001, TestSize.Level1)
330 {
331     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT32_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
332     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
333 }
334 
335 /**
336  * @tc.name: HslTestGetUint32ArrayElemSuccess001
337  * @tc.desc: Obtains the value of a <b>Uint32</b> array attribute numbered <b>index</b> of a configuration tree node
338  * @tc.type: FUNC
339  * @tc.require: AR000DQ0TB
340  */
341 HWTEST_F(HdfConfigTest, HslTestGetUint32ArrayElemSuccess001, TestSize.Level1)
342 {
343     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT32_ARRAY_ELEM_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
344     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
345 }
346 
347 /**
348  * @tc.name: HslTestGetUint32ArrayElemFail001
349  * @tc.desc: Failed to obtain the value of a <b>Uint32</b> array attribute numbered <b>index</b> of a
350  * configuration tree node
351  * @tc.type: FUNC
352  * @tc.require: AR000DQ0TB
353  */
354 HWTEST_F(HdfConfigTest, HslTestGetUint32ArrayElemFail001, TestSize.Level1)
355 {
356     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT32_ARRAY_ELEM_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
357     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
358 }
359 
360 /**
361  * @tc.name: HslTestGetUint32ArraySuccess001
362  * @tc.desc: Obtains the values of a <b>Uint32</b> array attribute of a configuration tree node
363  * @tc.type: FUNC
364  * @tc.require: AR000DQ0TB
365  */
366 HWTEST_F(HdfConfigTest, HslTestGetUint32ArraySuccess001, TestSize.Level1)
367 {
368     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT32_ARRAY_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
369     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
370 }
371 
372 /**
373  * @tc.name: HslTestGetUint32ArrayFail001
374  * @tc.desc: Failed to obtain the values of a <b>Uint32</b> array attribute of a configuration tree node
375  * @tc.type: FUNC
376  * @tc.require: AR000DQ0TB
377  */
378 HWTEST_F(HdfConfigTest, HslTestGetUint32ArrayFail001, TestSize.Level1)
379 {
380     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT32_ARRAY_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
381     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
382 }
383 
384 /**
385  * @tc.name: HslTestGetUint64AttrValueSuccess001
386  * @tc.desc: Obtains the value of a <b>Uint64</b> attribute of a configuration tree node
387  * @tc.type: FUNC
388  * @tc.require: AR000DQ0TB
389  */
390 HWTEST_F(HdfConfigTest, HslTestGetUint64AttrValueSuccess001, TestSize.Level1)
391 {
392     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT64_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
393     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
394 }
395 
396 /**
397  * @tc.name: HslTestGetUint64AttrValueFail001
398  * @tc.desc: Failed to obtain the value of a <b>Uint64</b> attribute of a configuration tree node
399  * @tc.type: FUNC
400  * @tc.require: AR000DQ0TB
401  */
402 HWTEST_F(HdfConfigTest, HslTestGetUint64AttrValueFail001, TestSize.Level1)
403 {
404     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT64_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
405     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
406 }
407 
408 /**
409  * @tc.name: HslTestGetUint64ArrayElemSuccess001
410  * @tc.desc: Obtains the value of a <b>Uint64</b> array attribute numbered <b>index</b> of a configuration tree node
411  * @tc.type: FUNC
412  * @tc.require: AR000DQ0TB
413  */
414 HWTEST_F(HdfConfigTest, HslTestGetUint64ArrayElemSuccess001, TestSize.Level1)
415 {
416     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT64_ARRAY_ELEM_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
417     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
418 }
419 
420 /**
421  * @tc.name: HslTestGetUint64ArrayElemFail001
422  * @tc.desc: Failed to obtain the value of a <b>Uint64</b> array attribute numbered <b>index</b> of a
423  * configuration tree node
424  * @tc.type: FUNC
425  * @tc.require: AR000DQ0TB
426  */
427 HWTEST_F(HdfConfigTest, HslTestGetUint64ArrayElemFail001, TestSize.Level1)
428 {
429     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT64_ARRAY_ELEM_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
430     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
431 }
432 
433 /**
434  * @tc.name: HslTestGetUint64ArraySuccess001
435  * @tc.desc: Obtains the values of a <b>Uint64</b> array attribute of a configuration tree node
436  * @tc.type: FUNC
437  * @tc.require: AR000DQ0TB
438  */
439 HWTEST_F(HdfConfigTest, HslTestGetUint64ArraySuccess001, TestSize.Level1)
440 {
441     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT64_ARRAY_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
442     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
443 }
444 
445 /**
446  * @tc.name: HslTestGetUint64ArrayFail001
447  * @tc.desc: Failed to obtain the values of a <b>Uint64</b> array attribute of a configuration tree node
448  * @tc.type: FUNC
449  * @tc.require: AR000DQ0TB
450  */
451 HWTEST_F(HdfConfigTest, HslTestGetUint64ArrayFail001, TestSize.Level1)
452 {
453     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_UINT64_ARRAY_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
454     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
455 }
456 
457 /**
458  * @tc.name: HslTestGetElemNumSuccess001
459  * @tc.desc: Obtains the number of values for an array attribute of a configuration tree node
460  * @tc.type: FUNC
461  * @tc.require: AR000DQ0TB
462  */
463 HWTEST_F(HdfConfigTest, HslTestGetElemNumSuccess001, TestSize.Level1)
464 {
465     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_ELEM_NUM_VALUE_001, HDF_MSG_RESULT_DEFAULT};
466     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
467 }
468 
469 /**
470  * @tc.name: HslTestGetElemNumFail001
471  * @tc.desc: Failed to obtain the number of values for an array attribute of a configuration tree node
472  * @tc.type: FUNC
473  * @tc.require: AR000DQ0TB
474  */
475 HWTEST_F(HdfConfigTest, HslTestGetElemNumFail001, TestSize.Level1)
476 {
477     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_ELEM_NUM_VALUE_002, HDF_MSG_RESULT_DEFAULT};
478     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
479 }
480 
481 /**
482  * @tc.name: HslTestGetChildNodeSuccess001
483  * @tc.desc: Obtains the child node with a specified node name from a parent node
484  * @tc.type: FUNC
485  * @tc.require: AR000DQ0TB
486  */
487 HWTEST_F(HdfConfigTest, HslTestGetChildNodeSuccess001, TestSize.Level1)
488 {
489     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_CHILD_NODE_001, HDF_MSG_RESULT_DEFAULT};
490     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
491 }
492 
493 /**
494  * @tc.name: HslTestGetChildNodeFail001
495  * @tc.desc: Failed to obtain the child node with a specified node name from a parent node
496  * @tc.type: FUNC
497  * @tc.require: AR000DQ0TB
498  */
499 HWTEST_F(HdfConfigTest, HslTestGetChildNodeFail001, TestSize.Level1)
500 {
501     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_CHILD_NODE_002, HDF_MSG_RESULT_DEFAULT};
502     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
503 }
504 
505 /**
506  * @tc.name: HslTestTraverseAttrInNodeSuccess001
507  * @tc.desc: Traverses the attributes of the current configuration tree node
508  * @tc.type: FUNC
509  * @tc.require: AR000DQ0TB
510  */
511 HWTEST_F(HdfConfigTest, HslTestTraverseAttrInNodeSuccess001, TestSize.Level1)
512 {
513     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_TRAVERSE_ATTR_IN_NODE_001, HDF_MSG_RESULT_DEFAULT};
514     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
515 }
516 
517 /**
518  * @tc.name: HslTestTraverseAttrInNodeFail001
519  * @tc.desc: Failed to traverse the attributes of the current configuration tree node
520  * @tc.type: FUNC
521  * @tc.require: AR000DQ0TB
522  */
523 HWTEST_F(HdfConfigTest, HslTestTraverseAttrInNodeFail001, TestSize.Level1)
524 {
525     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_TRAVERSE_ATTR_IN_NODE_002, HDF_MSG_RESULT_DEFAULT};
526     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
527 }
528 
529 /**
530  * @tc.name: HslTestGetStringSuccess001
531  * @tc.desc: Obtains the value of a <b>String</b> attribute of a configuration tree node
532  * @tc.type: FUNC
533  * @tc.require: AR000DQ0TB
534  */
535 HWTEST_F(HdfConfigTest, HslTestGetStringSuccess001, TestSize.Level1)
536 {
537     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_STRING_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
538     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
539 }
540 
541 /**
542  * @tc.name: HslTestGetStringFail001
543  * @tc.desc: Failed to obtain the value of a <b>String</b> attribute of a configuration tree node
544  * @tc.type: FUNC
545  * @tc.require: AR000DQ0TB
546  */
547 HWTEST_F(HdfConfigTest, HslTestGetStringFail001, TestSize.Level1)
548 {
549     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_STRING_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
550     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
551 }
552 
553 /**
554  * @tc.name: HslTestGetStringArrayElemSuccess001
555  * @tc.desc: Obtains the value of a <b>String</b> array attribute numbered <b>index</b> of a configuration tree node
556  * @tc.type: FUNC
557  * @tc.require: AR000DQ0TB
558  */
559 HWTEST_F(HdfConfigTest, HslTestGetStringArrayElemSuccess001, TestSize.Level1)
560 {
561     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_STRING_ARRAY_ELEM_ATTR_VALUE_001, HDF_MSG_RESULT_DEFAULT};
562     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
563 }
564 
565 /**
566  * @tc.name: HslTestGetStringArrayElemFail001
567  * @tc.desc: Failed to obtain the value of a <b>String</b> array attribute numbered <b>index</b> of a
568  * configuration tree node
569  * @tc.type: FUNC
570  * @tc.require: AR000DQ0TB
571  */
572 HWTEST_F(HdfConfigTest, HslTestGetStringArrayElemFail001, TestSize.Level1)
573 {
574     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_STRING_ARRAY_ELEM_ATTR_VALUE_002, HDF_MSG_RESULT_DEFAULT};
575     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
576 }
577 
578 /**
579  * @tc.name: HslTestGetNodeAttrRefSuccess001
580  * @tc.desc: Obtains the node that is specified by a node-type attribute of a configuration tree node
581  * @tc.type: FUNC
582  * @tc.require: AR000DQ0TB
583  */
584 HWTEST_F(HdfConfigTest, HslTestGetNodeAttrRefSuccess001, TestSize.Level1)
585 {
586     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_NODE_BY_ATTR_REF_001, HDF_MSG_RESULT_DEFAULT};
587     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
588 }
589 
590 /**
591  * @tc.name: HslTestGetNodeAttrRefFail001
592  * @tc.desc: Failed to obtain the node that is specified by a node-type attribute of a configuration tree node
593  * @tc.type: FUNC
594  * @tc.require: AR000DQ0TB
595  */
596 HWTEST_F(HdfConfigTest, HslTestGetNodeAttrRefFail001, TestSize.Level1)
597 {
598     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_GET_NODE_BY_ATTR_REF_002, HDF_MSG_RESULT_DEFAULT};
599     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
600 }
601 
602 /**
603  * @tc.name: HslTestMacroGetOneNode
604  * @tc.desc: HDF_MACRO_GET_ONE_NODE test
605  * @tc.type: FUNC
606  * @tc.require: AR000GGTQK
607  */
608 HWTEST_F(HdfConfigTest, HslTestMacroGetOneNode, TestSize.Level1)
609 {
610     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_MACRO_GET_ONE_NODE, HDF_MSG_RESULT_DEFAULT};
611     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
612 }
613 
614 /**
615  * @tc.name: HslTestMacroGetOneNode
616  * @tc.desc: HDF_MACRO_CHECK_NODE_EXISTS test
617  * @tc.type: FUNC
618  * @tc.require: AR000GGTQK
619  */
620 HWTEST_F(HdfConfigTest, HslTestMacroCheckNodeExists, TestSize.Level1)
621 {
622     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_MACRO_CHECK_NODE_EXISTS, HDF_MSG_RESULT_DEFAULT};
623     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
624 }
625 
626 /**
627  * @tc.name: HslTestMacroGetOneNode
628  * @tc.desc: HDF_MACRO_CHECK_NODE_NOT_EXISTS test
629  * @tc.type: FUNC
630  * @tc.require: AR000GGTQK
631  */
632 HWTEST_F(HdfConfigTest, HslTestMacroCheckNodeNotExists, TestSize.Level1)
633 {
634     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_MACRO_CHECK_NODE_NOT_EXISTS, HDF_MSG_RESULT_DEFAULT};
635     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
636 }
637 
638 /**
639  * @tc.name: HslTestMacroGetOneNode
640  * @tc.desc: HDF_MACRO_GET_ONE_NODE_PROP test
641  * @tc.type: FUNC
642  * @tc.require: AR000GGTQK
643  */
644 HWTEST_F(HdfConfigTest, HslTestMacroGetOneNodeProp, TestSize.Level1)
645 {
646     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_MACRO_GET_ONE_NODE_PROP, HDF_MSG_RESULT_DEFAULT};
647     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
648 }
649 
650 /**
651  * @tc.name: HslTestMacroGetOneNode
652  * @tc.desc: HDF_MACRO_CHECK_NODE_PROP_EXISTS test
653  * @tc.type: FUNC
654  * @tc.require: AR000GGTQK
655  */
656 HWTEST_F(HdfConfigTest, HslTestMacroCheckNodePropExists, TestSize.Level1)
657 {
658     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_MACRO_CHECK_NODE_PROP_EXISTS, HDF_MSG_RESULT_DEFAULT};
659     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
660 }
661 
662 /**
663  * @tc.name: HslTestMacroGetOneNode
664  * @tc.desc: HDF_MACRO_CHECK_NODE_PROP_NOT_EXISTS test
665  * @tc.type: FUNC
666  * @tc.require: AR000GGTQK
667  */
668 HWTEST_F(HdfConfigTest, HslTestMacroCheckNodePropNotExists, TestSize.Level1)
669 {
670     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_MACRO_CHECK_NODE_PROP_NOT_EXISTS, HDF_MSG_RESULT_DEFAULT};
671     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
672 }
673 
674 /**
675  * @tc.name: HslTestMacroGetOneNode
676  * @tc.desc: HDF_MACRO_TRAVERSAL_ONE_NODE test
677  * @tc.type: FUNC
678  * @tc.require: AR000GGTQK
679  */
680 HWTEST_F(HdfConfigTest, HslTestMacroTraversalOneNode, TestSize.Level1)
681 {
682     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_MACRO_TRAVERSAL_ONE_NODE, HDF_MSG_RESULT_DEFAULT};
683     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
684 }
685 
686 /**
687  * @tc.name: HslTestMacroGetOneNode
688  * @tc.desc: HDF_MACRO_GET_ARRAY_SIZE test
689  * @tc.type: FUNC
690  * @tc.require: AR000GGTQK
691  */
692 HWTEST_F(HdfConfigTest, HslTestMacroGetArraySize, TestSize.Level1)
693 {
694     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_MACRO_GET_ARRAY_SIZE, HDF_MSG_RESULT_DEFAULT};
695     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
696 }
697 
698 /**
699  * @tc.name: HslTestMacroGetOneNode
700  * @tc.desc: HDF_MACRO_GET_ONE_ARRAY_ELEMENT test
701  * @tc.type: FUNC
702  * @tc.require: AR000GGTQK
703  */
704 HWTEST_F(HdfConfigTest, HslTestMacroGetOneArrayElevent, TestSize.Level1)
705 {
706     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_MACRO_GET_ONE_ARRAY_ELEMENT, HDF_MSG_RESULT_DEFAULT};
707     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
708 }
709 
710 /**
711  * @tc.name: HslTestMacroGetOneNode
712  * @tc.desc: HDF_MACRO_TRAVERSAL_ONE_ARRAY test
713  * @tc.type: FUNC
714  * @tc.require: AR000GGTQK
715  */
716 HWTEST_F(HdfConfigTest, HslTestMacroTraversalOneArray, TestSize.Level1)
717 {
718     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_MACRO_TRAVERSAL_ONE_ARRAY, HDF_MSG_RESULT_DEFAULT};
719     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
720 }
721 
722 /**
723  * @tc.name: HslTestMacroGetOneNode
724  * @tc.desc: HDF_MACRO_TRAVERSAL_ALL_ARRAY test
725  * @tc.type: FUNC
726  * @tc.require: AR000GGTQK
727  */
728 HWTEST_F(HdfConfigTest, HslTestMacroTraversalAllArray, TestSize.Level1)
729 {
730     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_MACRO_TRAVERSAL_ALL_ARRAY, HDF_MSG_RESULT_DEFAULT};
731     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
732 }
733 
734 /**
735  * @tc.name: HslTestMacroGetOneNode
736  * @tc.desc: HDF_MACRO_TRAVERSAL_NODE_CHILD test
737  * @tc.type: FUNC
738  * @tc.require: AR000GGTQK
739  */
740 HWTEST_F(HdfConfigTest, HslTestMacroTraversalNodeChild, TestSize.Level1)
741 {
742     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_MACRO_TRAVERSAL_NODE_CHILD, HDF_MSG_RESULT_DEFAULT};
743     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
744 }
745 
746 /**
747  * @tc.name: HslTestMacroGetOneNode
748  * @tc.desc: HDF_MACRO_TRAVERSAL_NODE_CHILD_VARGS test
749  * @tc.type: FUNC
750  * @tc.require: SR000GGTQI
751  */
752 HWTEST_F(HdfConfigTest, HslTestMacroTraversalNodeChildVargs, TestSize.Level1)
753 {
754     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_MACRO_TRAVERSAL_NODE_CHILD_VARGS, HDF_MSG_RESULT_DEFAULT};
755     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
756 }
757 
758 /**
759  * @tc.name: HslTestMacroGetOneNode
760  * @tc.desc: HDF_MACRO_GET_ONE_FILE test
761  * @tc.type: FUNC
762  * @tc.require: SR000GGTQI
763  */
764 HWTEST_F(HdfConfigTest, HslTestMacroTraversalOneFile, TestSize.Level1)
765 {
766     struct HdfTestMsg msg = {TEST_CONFIG_TYPE, HDF_MACRO_GET_ONE_FILE, HDF_MSG_RESULT_DEFAULT};
767     printf("HdfConfigTest last enter\n\r");
768     EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
769 }
770 };
771