• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 "hdi_composer_ut.h"
17 #include <chrono>
18 #include <cinttypes>
19 #include <algorithm>
20 #include "v1_0/include/idisplay_composer_interface.h"
21 #include "v1_1/display_composer_type.h"
22 #include "v1_0/display_buffer_type.h"
23 #include "display_test.h"
24 #include "display_test_utils.h"
25 #include "hdi_composition_check.h"
26 #include "hdi_test_device.h"
27 #include "hdi_test_device_common.h"
28 #include "hdi_test_display.h"
29 #include "hdi_test_render_utils.h"
30 
31 using namespace OHOS::HDI::Display::Buffer::V1_0;
32 using namespace OHOS::HDI::Display::Composer::V1_1;
33 using namespace OHOS::HDI::Display::TEST;
34 using namespace testing::ext;
35 
36 static sptr<Composer::V1_1::IDisplayComposerInterface> g_composerDevice = nullptr;
37 static std::shared_ptr<IDisplayBuffer> g_gralloc = nullptr;
38 static std::vector<uint32_t> g_displayIds;
39 
SetUpTestCase()40 void DeviceTestAdditional::SetUpTestCase()
41 {
42     int ret = HdiTestDevice::GetInstance().InitDevice();
43     ASSERT_TRUE(ret == DISPLAY_SUCCESS);
44 
45     g_composerDevice = HdiTestDevice::GetInstance().GetDeviceInterface();
46     ASSERT_TRUE(g_composerDevice != nullptr);
47 
48     g_gralloc.reset(IDisplayBuffer::Get());
49     ASSERT_TRUE(g_gralloc != nullptr);
50 
51     g_displayIds = HdiTestDevice::GetInstance().GetDevIds();
52     ASSERT_TRUE(g_displayIds.size() > 0);
53 }
54 
TearDownTestCase()55 void DeviceTestAdditional::TearDownTestCase()
56 {
57     HdiTestDevice::GetInstance().Clear();
58     HdiTestDevice::GetInstance().GetFirstDisplay()->ResetClientLayer();
59 }
60 
61 /**
62  * @tc.number : SUB_Driver_Display_ClientBufferCount_0100
63  * @tc.name   : testClientBufferCount001
64  * @tc.desc   : test cache count Max
65  */
66 HWTEST_F(DeviceTestAdditional, testClientBufferCount001, Function | MediumTest | Level1)
67 {
68     const uint32_t cacheCount = 20;
69     auto ret = g_composerDevice->SetClientBufferCacheCount(g_displayIds[0], cacheCount);
70     EXPECT_EQ(DISPLAY_SUCCESS, ret);
71 }
72 
73 /**
74  * @tc.number : SUB_Driver_Display_ClientBufferCount_0200
75  * @tc.name   : testClientBufferCount002
76  * @tc.desc   : test cache count Min
77  */
78 HWTEST_F(DeviceTestAdditional, testClientBufferCount002, Function | MediumTest | Level1)
79 {
80     const uint32_t cacheCount = 0;
81     auto ret = g_composerDevice->SetClientBufferCacheCount(g_displayIds[0], cacheCount);
82     EXPECT_EQ(DISPLAY_SUCCESS, ret);
83 }
84 
85 /**
86  * @tc.number : SUB_Driver_Display_ClientBufferCount_0300
87  * @tc.name   : testClientBufferCount003
88  * @tc.desc   : test cache count Random
89  */
90 HWTEST_F(DeviceTestAdditional, testClientBufferCount003, Function | MediumTest | Level1)
91 {
92     const uint32_t cacheCount = 15;
93     auto ret = g_composerDevice->SetClientBufferCacheCount(g_displayIds[0], cacheCount);
94     EXPECT_EQ(DISPLAY_SUCCESS, ret);
95 }
96 
97 /**
98  * @tc.number : SUB_Driver_Display_ClientBufferCount_0400
99  * @tc.name   : testClientBufferCount004
100  * @tc.desc   : test devId Max
101  */
102 HWTEST_F(DeviceTestAdditional, testClientBufferCount004, Function | MediumTest | Level2)
103 {
104     const uint32_t cacheCount = 5;
105     auto ret = g_composerDevice->SetClientBufferCacheCount(20, cacheCount);
106     EXPECT_EQ(DISPLAY_FAILURE, ret);
107 }
108 
109 /**
110  * @tc.number : SUB_Driver_Display_ClientBufferCount_0500
111  * @tc.name   : testClientBufferCount005
112  * @tc.desc   : test devId Min
113  */
114 HWTEST_F(DeviceTestAdditional, testClientBufferCount005, Function | MediumTest | Level1)
115 {
116     const uint32_t cacheCount = 5;
117     auto ret = g_composerDevice->SetClientBufferCacheCount(0, cacheCount);
118     EXPECT_EQ(DISPLAY_SUCCESS, ret);
119 }
120 
121 /**
122  * @tc.number : SUB_Driver_Display_ClientBufferCount_0600
123  * @tc.name   : testClientBufferCount006
124  * @tc.desc   : test devId Random
125  */
126 HWTEST_F(DeviceTestAdditional, testClientBufferCount006, Function | MediumTest | Level2)
127 {
128     const uint32_t cacheCount = 5;
129     auto ret = g_composerDevice->SetClientBufferCacheCount(15, cacheCount);
130     EXPECT_EQ(DISPLAY_FAILURE, ret);
131 }
132 
133 /**
134  * @tc.number : SUB_Driver_Display_ClientBufferCount_0700
135  * @tc.name   : testClientBufferCount007
136  * @tc.desc   : test devId Negative Number
137  */
138 HWTEST_F(DeviceTestAdditional, testClientBufferCount007, Function | MediumTest | Level2)
139 {
140     const uint32_t cacheCount = 5;
141     auto ret = g_composerDevice->SetClientBufferCacheCount(-1, cacheCount);
142     EXPECT_EQ(DISPLAY_FAILURE, ret);
143 }
144 
145 /**
146  * @tc.number : SUB_Driver_Display_ClientBufferCount_0800
147  * @tc.name   : testClientBufferCount008
148  * @tc.desc   : test devId Negative Number
149  */
150 HWTEST_F(DeviceTestAdditional, testClientBufferCount008, Function | MediumTest | Level1)
151 {
152     const uint32_t cacheCount = -1;
153     auto ret = g_composerDevice->SetClientBufferCacheCount(g_displayIds[0], cacheCount);
154     EXPECT_EQ(DISPLAY_SUCCESS, ret);
155 }
156 
157 /**
158  * @tc.number : SUB_Driver_Display_Capability_0200
159  * @tc.name   : testCapability002
160  * @tc.desc   : test devId Min
161  */
162 HWTEST_F(DeviceTestAdditional, testCapability002, Function | MediumTest | Level1)
163 {
164     DisplayCapability info;
165     auto ret = g_composerDevice->GetDisplayCapability(0, info);
166     EXPECT_EQ(DISPLAY_SUCCESS, ret);
167 }
168 
169 /**
170  * @tc.number : SUB_Driver_Display_SupportedModes_0100
171  * @tc.name   : testSupportedModes001
172  * @tc.desc   : test devId Max
173  */
174 HWTEST_F(DeviceTestAdditional, testSupportedModes001, Function | MediumTest | Level2)
175 {
176     std::vector<DisplayModeInfo> modes;
177     auto ret = g_composerDevice->GetDisplaySupportedModes(20, modes);
178     EXPECT_EQ(DISPLAY_FAILURE, ret);
179 }
180 
181 /**
182  * @tc.number : SUB_Driver_Display_SupportedModes_0200
183  * @tc.name   : testSupportedModes002
184  * @tc.desc   : test devId Min
185  */
186 HWTEST_F(DeviceTestAdditional, testSupportedModes002, Function | MediumTest | Level1)
187 {
188     std::vector<DisplayModeInfo> modes;
189     auto ret = g_composerDevice->GetDisplaySupportedModes(0, modes);
190     EXPECT_EQ(DISPLAY_SUCCESS, ret);
191 }
192 
193 /**
194  * @tc.number : SUB_Driver_Display_SupportedModes_0400
195  * @tc.name   : testSupportedModes004
196  * @tc.desc   : test devId Negative Number
197  */
198 HWTEST_F(DeviceTestAdditional, testSupportedModes004, Function | MediumTest | Level2)
199 {
200     std::vector<DisplayModeInfo> modes;
201     auto ret = g_composerDevice->GetDisplaySupportedModes(-1, modes);
202     EXPECT_EQ(DISPLAY_FAILURE, ret);
203 }
204 
205 /**
206  * @tc.number : SUB_Driver_Display_GetDisplayMode_0100
207  * @tc.name   :	testGetDisplayMode001
208  * @tc.desc   : test devId Max
209  */
210 HWTEST_F(DeviceTestAdditional, testGetDisplayMode001, Function | MediumTest | Level2)
211 {
212     uint32_t mode = 0;
213     auto ret = g_composerDevice->GetDisplayMode(20, mode);
214     EXPECT_EQ(DISPLAY_FAILURE, ret);
215 }
216 
217 /**
218  * @tc.number : SUB_Driver_Display_GetDisplayMode_0200
219  * @tc.name   : testGetDisplayMode002
220  * @tc.desc   : test devId Min
221  */
222 HWTEST_F(DeviceTestAdditional, testGetDisplayMode002, Function | MediumTest | Level1)
223 {
224     uint32_t mode = 0;
225     auto ret = g_composerDevice->GetDisplayMode(0, mode);
226     EXPECT_EQ(DISPLAY_SUCCESS, ret);
227 }
228 
229 /**
230  * @tc.number : SUB_Driver_Display_GetDisplayMode_0300
231  * @tc.name   : testGetDisplayMode003
232  * @tc.desc   : test devId Random
233  */
234 HWTEST_F(DeviceTestAdditional, testGetDisplayMode003, Function | MediumTest | Level2)
235 {
236     uint32_t mode = 0;
237     auto ret = g_composerDevice->GetDisplayMode(15, mode);
238     EXPECT_EQ(DISPLAY_FAILURE, ret);
239 }
240 
241 /**
242  * @tc.number : SUB_Driver_Display_GetDisplayMode_0400
243  * @tc.name   : testGetDisplayMode004
244  * @tc.desc   : test devId Negative Number
245  */
246 HWTEST_F(DeviceTestAdditional, testGetDisplayMode004, Function | MediumTest | Level2)
247 {
248     uint32_t mode = 0;
249     auto ret = g_composerDevice->GetDisplayMode(-1, mode);
250     EXPECT_EQ(DISPLAY_FAILURE, ret);
251 }
252 
253 /**
254  * @tc.number : SUB_Driver_Display_SetDisplayMode_0100
255  * @tc.name   : testSetDisplayMode001
256  * @tc.desc   : test devId Max
257  */
258 HWTEST_F(DeviceTestAdditional, testSetDisplayMode001, Function | MediumTest | Level2)
259 {
260     const uint32_t mode = 0;
261     auto ret = g_composerDevice->SetDisplayMode(20, mode);
262     EXPECT_EQ(DISPLAY_FAILURE, ret);
263 }
264 
265 /**
266  * @tc.number : SUB_Driver_Display_SetDisplayMode_0200
267  * @tc.name   : testSetDisplayMode002
268  * @tc.desc   : test devId Min
269  */
270 HWTEST_F(DeviceTestAdditional, testSetDisplayMode002, Function | MediumTest | Level1)
271 {
272     const uint32_t mode = 0;
273     auto ret = g_composerDevice->SetDisplayMode(0, mode);
274     EXPECT_EQ(DISPLAY_SUCCESS, ret);
275 }
276 
277 /**
278  * @tc.number : SUB_Driver_Display_SetDisplayMode_0300
279  * @tc.name   : testSetDisplayMode003
280  * @tc.desc   : test devId Random
281  */
282 HWTEST_F(DeviceTestAdditional, testSetDisplayMode003, Function | MediumTest | Level2)
283 {
284     const uint32_t mode = 0;
285     auto ret = g_composerDevice->SetDisplayMode(15, mode);
286     EXPECT_EQ(DISPLAY_FAILURE, ret);
287 }
288 
289 /**
290  * @tc.number : SUB_Driver_Display_SetDisplayMode_0400
291  * @tc.name   : testSetDisplayMode004
292  * @tc.desc   : test devId Negative Number
293  */
294 HWTEST_F(DeviceTestAdditional, testSetDisplayMode004, Function | MediumTest | Level2)
295 {
296     const uint32_t mode = 0;
297     auto ret = g_composerDevice->SetDisplayMode(-1, mode);
298     EXPECT_EQ(DISPLAY_FAILURE, ret);
299 }
300 
301 #ifdef DISPLAY_COMMUNITY
302 /**
303  * @tc.number : SUB_Driver_Display_SetDisplayMode_0500
304  * @tc.name   : testSetDisplayMode005
305  * @tc.desc   : test ModeId Max
306  */
307 HWTEST_F(DeviceTestAdditional, testSetDisplayMode005, Function | MediumTest | Level2)
308 {
309     const uint32_t mode = 20;
310     auto ret = g_composerDevice->SetDisplayMode(g_displayIds[0], mode);
311     EXPECT_EQ(DISPLAY_FAILURE, ret);
312 }
313 
314 /**
315  * @tc.number : SUB_Driver_Display_SetDisplayMode_0600
316  * @tc.name   : testSetDisplayMode006
317  * @tc.desc   : test devId Boundary
318  */
319 HWTEST_F(DeviceTestAdditional, testSetDisplayMode006, Function | MediumTest | Level2)
320 {
321     const uint32_t mode = 8;
322     auto ret = g_composerDevice->SetDisplayMode(g_displayIds[0], mode);
323     EXPECT_EQ(DISPLAY_FAILURE, ret);
324 }
325 
326 /**
327  * @tc.number : SUB_Driver_Display_SetDisplayMode_0700
328  * @tc.name   : testSetDisplayMode007
329  * @tc.desc   : test devId Random
330  */
331 HWTEST_F(DeviceTestAdditional, testSetDisplayMode007, Function | MediumTest | Level2)
332 {
333     const uint32_t mode = 15;
334     auto ret = g_composerDevice->SetDisplayMode(g_displayIds[0], mode);
335     EXPECT_EQ(DISPLAY_FAILURE, ret);
336 }
337 
338 /**
339  * @tc.number : SUB_Driver_Display_SetDisplayMode_0800
340  * @tc.name   : testSetDisplayMode008
341  * @tc.desc   : test devId Random
342  */
343 HWTEST_F(DeviceTestAdditional, testSetDisplayMode008, Function | MediumTest | Level1)
344 {
345     const uint32_t mode = -1;
346     auto ret = g_composerDevice->SetDisplayMode(g_displayIds[0], mode);
347     EXPECT_EQ(DISPLAY_FAILURE, ret);
348 }
349 
350 /**
351  * @tc.number : SUB_Driver_Display_GetDisplayPowerStatus_0100
352  * @tc.name   : testGetDisplayPowerStatus001
353  * @tc.desc   : test devId Max
354  */
355 HWTEST_F(DeviceTestAdditional, testGetDisplayPowerStatus001, Function | MediumTest | Level2)
356 {
357     Composer::V1_0::DispPowerStatus powerStatus = Composer::V1_0::DispPowerStatus::POWER_STATUS_OFF;
358     auto ret = g_composerDevice->GetDisplayPowerStatus(20, powerStatus);
359     EXPECT_EQ(DISPLAY_FAILURE, ret);
360 }
361 #endif
362 
363 /**
364  * @tc.number : SUB_Driver_Display_GetDisplayPowerStatus_0200
365  * @tc.name   : testGetDisplayPowerStatus002
366  * @tc.desc   : test devId Min
367  */
368 HWTEST_F(DeviceTestAdditional, testGetDisplayPowerStatus002, Function | MediumTest | Level1)
369 {
370     Composer::V1_0::DispPowerStatus powerStatus = Composer::V1_0::DispPowerStatus::POWER_STATUS_OFF;
371     auto ret = g_composerDevice->GetDisplayPowerStatus(0, powerStatus);
372     EXPECT_EQ(DISPLAY_SUCCESS, ret);
373 }
374 
375 #ifdef DISPLAY_COMMUNITY
376 /**
377  * @tc.number : SUB_Driver_Display_GetDisplayPowerStatus_0300
378  * @tc.name   : testGetDisplayPowerStatus003
379  * @tc.desc   : test devId Random
380  */
381 HWTEST_F(DeviceTestAdditional, testGetDisplayPowerStatus003, Function | MediumTest | Level2)
382 {
383     Composer::V1_0::DispPowerStatus powerStatus = Composer::V1_0::DispPowerStatus::POWER_STATUS_OFF;
384     auto ret = g_composerDevice->GetDisplayPowerStatus(15, powerStatus);
385     EXPECT_EQ(DISPLAY_FAILURE, ret);
386 }
387 
388 /**
389  * @tc.number : SUB_Driver_Display_GetDisplayPowerStatus_0400
390  * @tc.name   : testGetDisplayPowerStatus004
391  * @tc.desc   : test devId Negative Number
392  */
393 HWTEST_F(DeviceTestAdditional, testGetDisplayPowerStatus004, Function | MediumTest | Level2)
394 {
395     Composer::V1_0::DispPowerStatus powerStatus = Composer::V1_0::DispPowerStatus::POWER_STATUS_OFF;
396     auto ret = g_composerDevice->GetDisplayPowerStatus(-1, powerStatus);
397     EXPECT_EQ(DISPLAY_FAILURE, ret);
398 }
399 
400 /**
401  * @tc.number : SUB_Driver_Display_SetDisplayPowerStatus_0100
402  * @tc.name   : testSetDisplayPowerStatus001
403  * @tc.desc   : test devId Max
404  */
405 HWTEST_F(DeviceTestAdditional, testSetDisplayPowerStatus001, Function | MediumTest | Level2)
406 {
407     auto ret = g_composerDevice->SetDisplayPowerStatus(20, Composer::V1_0::DispPowerStatus::POWER_STATUS_ON);
408     EXPECT_EQ(DISPLAY_FAILURE, ret);
409 }
410 #endif
411 
412 /**
413  * @tc.number : SUB_Driver_Display_SetDisplayPowerStatus_0200
414  * @tc.name   : testSetDisplayPowerStatus002
415  * @tc.desc   : test devId Min
416  */
417 HWTEST_F(DeviceTestAdditional, testSetDisplayPowerStatus002, Function | MediumTest | Level1)
418 {
419     auto ret = g_composerDevice->SetDisplayPowerStatus(0, Composer::V1_0::DispPowerStatus::POWER_STATUS_ON);
420     EXPECT_EQ(DISPLAY_SUCCESS, ret);
421 }
422 
423 /**
424  * @tc.number : SUB_Driver_Display_SetDisplayPowerStatus_0300
425  * @tc.name   : testSetDisplayPowerStatus003
426  * @tc.desc   : test devId Random
427  */
428 HWTEST_F(DeviceTestAdditional, testSetDisplayPowerStatus003, Function | MediumTest | Level2)
429 {
430     auto ret = g_composerDevice->SetDisplayPowerStatus(15, Composer::V1_0::DispPowerStatus::POWER_STATUS_ON);
431     EXPECT_EQ(DISPLAY_FAILURE, ret);
432 }
433 
434 /**
435  * @tc.number : SUB_Driver_Display_SetDisplayPowerStatus_0400
436  * @tc.name   : testSetDisplayPowerStatus004
437  * @tc.desc   : test devId Negative Number
438  */
439 HWTEST_F(DeviceTestAdditional, testSetDisplayPowerStatus004, Function | MediumTest | Level2)
440 {
441     auto ret = g_composerDevice->SetDisplayPowerStatus(-1, Composer::V1_0::DispPowerStatus::POWER_STATUS_ON);
442     EXPECT_EQ(DISPLAY_FAILURE, ret);
443 }
444 
445 /**
446  * @tc.number : SUB_Driver_Display_SetDisplayPowerStatus_0500
447  * @tc.name   : testSetDisplayPowerStatus005
448  * @tc.desc   : test devId Max when power status is POWER_STATUS_STANDBY
449  */
450 HWTEST_F(DeviceTestAdditional, testSetDisplayPowerStatus005, Function | MediumTest | Level2)
451 {
452     auto ret = g_composerDevice->SetDisplayPowerStatus(20, Composer::V1_0::DispPowerStatus::POWER_STATUS_STANDBY);
453     EXPECT_EQ(DISPLAY_FAILURE, ret);
454 }
455 
456 /**
457  * @tc.number : SUB_Driver_Display_SetDisplayPowerStatus_0600
458  * @tc.name   : testSetDisplayPowerStatus006
459  * @tc.desc   : test devId Min when power status is POWER_STATUS_STANDBY
460  */
461 HWTEST_F(DeviceTestAdditional, testSetDisplayPowerStatus006, Function | MediumTest | Level1)
462 {
463     auto ret = g_composerDevice->SetDisplayPowerStatus(0, Composer::V1_0::DispPowerStatus::POWER_STATUS_STANDBY);
464     EXPECT_EQ(DISPLAY_SUCCESS, ret);
465 }
466 
467 /**
468  * @tc.number : SUB_Driver_Display_SetDisplayPowerStatus_0700
469  * @tc.name   : testSetDisplayPowerStatus007
470  * @tc.desc   : test devId Random when power status is POWER_STATUS_STANDBY
471  */
472 HWTEST_F(DeviceTestAdditional, testSetDisplayPowerStatus007, Function | MediumTest | Level2)
473 {
474     auto ret = g_composerDevice->SetDisplayPowerStatus(15, Composer::V1_0::DispPowerStatus::POWER_STATUS_STANDBY);
475     EXPECT_EQ(DISPLAY_FAILURE, ret);
476 }
477 
478 /**
479  * @tc.number : SUB_Driver_Display_SetDisplayPowerStatus_0800
480  * @tc.name   : testSetDisplayPowerStatus008
481  * @tc.desc   : test devId Negative Number when power status is POWER_STATUS_STANDBY
482  */
483 HWTEST_F(DeviceTestAdditional, testSetDisplayPowerStatus008, Function | MediumTest | Level2)
484 {
485     auto ret = g_composerDevice->SetDisplayPowerStatus(-1, Composer::V1_0::DispPowerStatus::POWER_STATUS_STANDBY);
486     EXPECT_EQ(DISPLAY_FAILURE, ret);
487 }
488 
489 /**
490  * @tc.number : SUB_Driver_Display_SetDisplayPowerStatus_0900
491  * @tc.name   : testSetDisplayPowerStatus009
492  * @tc.desc   : test power status is POWER_STATUS_SUSPEND
493  */
494 HWTEST_F(DeviceTestAdditional, testSetDisplayPowerStatus009, Function | MediumTest | Level1)
495 {
496     auto ret = g_composerDevice->SetDisplayPowerStatus(g_displayIds[0], Composer::V1_0::DispPowerStatus::POWER_STATUS_STANDBY);
497     EXPECT_EQ(DISPLAY_SUCCESS, ret);
498 }
499 
500 /**
501  * @tc.number : SUB_Driver_Display_SetDisplayPowerStatus_1000
502  * @tc.name   : testSetDisplayPowerStatus010
503  * @tc.desc   : test power status is POWER_STATUS_OFF
504  */
505 HWTEST_F(DeviceTestAdditional, testSetDisplayPowerStatus010, Function | MediumTest | Level1)
506 {
507     auto ret = g_composerDevice->SetDisplayPowerStatus(g_displayIds[0], Composer::V1_0::DispPowerStatus::POWER_STATUS_OFF);
508     EXPECT_EQ(DISPLAY_SUCCESS, ret);
509 }
510 
511 /**
512  * @tc.number : SUB_Driver_Display_SetDisplayPowerStatus_1100
513  * @tc.name   : testSetDisplayPowerStatus011
514  * @tc.desc   : test power status is POWER_STATUS_BUTT
515  */
516 HWTEST_F(DeviceTestAdditional, testSetDisplayPowerStatus011, Function | MediumTest | Level2)
517 {
518     auto ret = g_composerDevice->SetDisplayPowerStatus(g_displayIds[0], Composer::V1_0::DispPowerStatus::POWER_STATUS_BUTT);
519     EXPECT_EQ(DISPLAY_FAILURE, ret);
520 }
521 
522 #ifdef DISPLAY_COMMUNITY
523 /**
524  * @tc.number : SUB_Driver_Display_GetDisplayBacklight_0100
525  * @tc.name   : testGetDisplayBacklight001
526  * @tc.desc   : test devId Max
527  */
528 HWTEST_F(DeviceTestAdditional, testGetDisplayBacklight001, Function | MediumTest | Level2)
529 {
530     uint32_t level;
531     auto ret = g_composerDevice->GetDisplayBacklight(20, level);
532     EXPECT_EQ(DISPLAY_FAILURE, ret);
533 }
534 #endif
535 
536 /**
537  * @tc.number : SUB_Driver_Display_GetDisplayBacklight_0200
538  * @tc.name   : GetDisplayBacklight002
539  * @tc.desc   : test devId Min
540  */
541 HWTEST_F(DeviceTestAdditional, testGetDisplayBacklight002, Function | MediumTest | Level1)
542 {
543     uint32_t level;
544     auto ret = g_composerDevice->GetDisplayBacklight(0, level);
545     EXPECT_EQ(DISPLAY_SUCCESS, ret);
546 }
547 
548 #ifdef DISPLAY_COMMUNITY
549 /**
550  * @tc.number : SUB_Driver_Display_GetDisplayBacklight_0300
551  * @tc.name   : GetDisplayBacklight003
552  * @tc.desc   : test devId Random
553  */
554 HWTEST_F(DeviceTestAdditional, testGetDisplayBacklight003, Function | MediumTest | Level2)
555 {
556     uint32_t level;
557     auto ret = g_composerDevice->GetDisplayBacklight(15, level);
558     EXPECT_EQ(DISPLAY_FAILURE, ret);
559 }
560 
561 /**
562  * @tc.number : SUB_Driver_Display_GetDisplayBacklight_0400
563  * @tc.name   : GetDisplayBacklight004
564  * @tc.desc   : test devId Negative Number
565  */
566 HWTEST_F(DeviceTestAdditional, testGetDisplayBacklight004, Function | MediumTest | Level2)
567 {
568     uint32_t level;
569     auto ret = g_composerDevice->GetDisplayBacklight(-1, level);
570     EXPECT_EQ(DISPLAY_FAILURE, ret);
571 }
572 #endif
573 
574 /**
575  * @tc.number : SUB_Driver_Display_SetDisplayBacklight_0100
576  * @tc.name   : testSetDisplayBacklight001
577  * @tc.desc   : test devId Max
578  */
579 HWTEST_F(DeviceTestAdditional, testSetDisplayBacklight001, Function | MediumTest | Level2)
580 {
581     const uint32_t level = 10;
582     auto ret = g_composerDevice->SetDisplayBacklight(20, level);
583     EXPECT_EQ(DISPLAY_FAILURE, ret);
584 }
585 
586 /**
587  * @tc.number : SUB_Driver_Display_SetDisplayBacklight_0200
588  * @tc.name   : testSetDisplayBacklight002
589  * @tc.desc   : test devId Min
590  */
591 HWTEST_F(DeviceTestAdditional, testSetDisplayBacklight002, Function | MediumTest | Level1)
592 {
593     const uint32_t level = 10;
594     auto ret = g_composerDevice->SetDisplayBacklight(0, level);
595     EXPECT_EQ(DISPLAY_SUCCESS, ret);
596 }
597 
598 /**
599  * @tc.number : SUB_Driver_Display_SetDisplayBacklight_0300
600  * @tc.name   : testSetDisplayBacklight003
601  * @tc.desc   : test devId Random
602  */
603 HWTEST_F(DeviceTestAdditional, testSetDisplayBacklight003, Function | MediumTest | Level2)
604 {
605     const uint32_t level = 10;
606     auto ret = g_composerDevice->SetDisplayBacklight(15, level);
607     EXPECT_EQ(DISPLAY_FAILURE, ret);
608 }
609 
610 /**
611  * @tc.number : SUB_Driver_Display_SetDisplayBacklight_0400
612  * @tc.name   : testSetDisplayBacklight004
613  * @tc.desc   : test devId Negative Number
614  */
615 HWTEST_F(DeviceTestAdditional, testSetDisplayBacklight004, Function | MediumTest | Level2)
616 {
617     const uint32_t level = 10;
618     auto ret = g_composerDevice->SetDisplayBacklight(-1, level);
619     EXPECT_EQ(DISPLAY_FAILURE, ret);
620 }
621 
622 /**
623  * @tc.number : SUB_Driver_Display_SetDisplayBacklight_0500
624  * @tc.name   : testSetDisplayBacklight005
625  * @tc.desc   : test level Max
626  */
627 HWTEST_F(DeviceTestAdditional, testSetDisplayBacklight005, Function | MediumTest | Level1)
628 {
629     const uint32_t level = 20;
630     auto ret = g_composerDevice->SetDisplayBacklight(g_displayIds[0], level);
631     EXPECT_EQ(DISPLAY_SUCCESS, ret);
632 }
633 
634 /**
635  * @tc.number : SUB_Driver_Display_SetDisplayBacklight_0600
636  * @tc.name   : testSetDisplayBacklight006
637  * @tc.desc   : test level Min
638  */
639 HWTEST_F(DeviceTestAdditional, testSetDisplayBacklight006, Function | MediumTest | Level1)
640 {
641     const uint32_t level = 0;
642     auto ret = g_composerDevice->SetDisplayBacklight(g_displayIds[0], level);
643     EXPECT_EQ(DISPLAY_SUCCESS, ret);
644 }
645 
646 /**
647  * @tc.number : SUB_Driver_Display_SetDisplayBacklight_0700
648  * @tc.name   : testSetDisplayBacklight007
649  * @tc.desc   : test level Random
650  */
651 HWTEST_F(DeviceTestAdditional, testSetDisplayBacklight007, Function | MediumTest | Level1)
652 {
653     const uint32_t level = 15;
654     auto ret = g_composerDevice->SetDisplayBacklight(g_displayIds[0], level);
655     EXPECT_EQ(DISPLAY_SUCCESS, ret);
656 }
657 
658 /**
659  * @tc.number : SUB_Driver_Display_SetDisplayBacklight_0800
660  * @tc.name   : testSetDisplayBacklight008
661  * @tc.desc   : test level Negative Number
662  */
663 HWTEST_F(DeviceTestAdditional, testSetDisplayBacklight008, Function | MediumTest | Level1)
664 {
665     const uint32_t level = -1;
666     auto ret = g_composerDevice->SetDisplayBacklight(g_displayIds[0], level);
667     EXPECT_EQ(DISPLAY_SUCCESS, ret);
668 }
669 
670 /**
671  * @tc.number : SUB_Driver_Display_GetDisplayProperty_0100
672  * @tc.name   : testGetDisplayProperty001
673  * @tc.desc   : test devId Max
674  */
675 HWTEST_F(DeviceTestAdditional, testGetDisplayProperty001, Function | MediumTest | Level2)
676 {
677     const uint32_t propertyId = 1;
678     uint64_t propertyValue = 0;
679     auto ret = g_composerDevice->GetDisplayProperty(20, propertyId, propertyValue);
680     EXPECT_EQ(DISPLAY_FAILURE, ret);
681 }
682 
683 /**
684  * @tc.number : SUB_Driver_Display_GetDisplayProperty_0200
685  * @tc.name   : testGetDisplayProperty002
686  * @tc.desc   : test devId Min
687  */
688 HWTEST_F(DeviceTestAdditional, testGetDisplayProperty002, Function | MediumTest | Level2)
689 {
690     const uint32_t propertyId = 1;
691     uint64_t propertyValue = 0;
692     auto ret = g_composerDevice->GetDisplayProperty(0, propertyId, propertyValue);
693     EXPECT_EQ(DISPLAY_FAILURE, ret);
694 }
695 
696 /**
697  * @tc.number : SUB_Driver_Display_GetDisplayProperty_0300
698  * @tc.name   : testGetDisplayProperty003
699  * @tc.desc   : test devId Random
700  */
701 HWTEST_F(DeviceTestAdditional, testGetDisplayProperty003, Function | MediumTest | Level2)
702 {
703     const uint32_t propertyId = 1;
704     uint64_t propertyValue = 0;
705     auto ret = g_composerDevice->GetDisplayProperty(15, propertyId, propertyValue);
706     EXPECT_EQ(DISPLAY_FAILURE, ret);
707 }
708 
709 /**
710  * @tc.number : SUB_Driver_Display_GetDisplayProperty_0400
711  * @tc.name   : testGetDisplayProperty004
712  * @tc.desc   : test devId Negative Number
713  */
714 HWTEST_F(DeviceTestAdditional, testGetDisplayProperty004, Function | MediumTest | Level2)
715 {
716     const uint32_t propertyId = 1;
717     uint64_t propertyValue = 0;
718     auto ret = g_composerDevice->GetDisplayProperty(-1, propertyId, propertyValue);
719     EXPECT_EQ(DISPLAY_FAILURE, ret);
720 }
721 
722 /**
723  * @tc.number : SUB_Driver_Display_GetDisplayProperty_0500
724  * @tc.name   : testGetDisplayProperty005
725  * @tc.desc   : test propertyId Max
726  */
727 HWTEST_F(DeviceTestAdditional, testGetDisplayProperty005, Function | MediumTest | Level2)
728 {
729     const uint32_t propertyId = 20;
730     uint64_t propertyValue = 0;
731     auto ret = g_composerDevice->GetDisplayProperty(g_displayIds[0], propertyId, propertyValue);
732     EXPECT_EQ(DISPLAY_FAILURE, ret);
733 }
734 
735 /**
736  * @tc.number : SUB_Driver_Display_GetDisplayProperty_0600
737  * @tc.name   : testGetDisplayProperty006
738  * @tc.desc   : test propertyId Min
739  */
740 HWTEST_F(DeviceTestAdditional, testGetDisplayProperty006, Function | MediumTest | Level2)
741 {
742     const uint32_t propertyId = 0;
743     uint64_t propertyValue = 0;
744     auto ret = g_composerDevice->GetDisplayProperty(g_displayIds[0], propertyId, propertyValue);
745     EXPECT_EQ(DISPLAY_FAILURE, ret);
746 }
747 
748 /**
749  * @tc.number : SUB_Driver_Display_GetDisplayProperty_0700
750  * @tc.name   : testGetDisplayProperty007
751  * @tc.desc   : test propertyId Random
752  */
753 HWTEST_F(DeviceTestAdditional, testGetDisplayProperty007, Function | MediumTest | Level2)
754 {
755     const uint32_t propertyId = 15;
756     uint64_t propertyValue = 0;
757     auto ret = g_composerDevice->GetDisplayProperty(g_displayIds[0], propertyId, propertyValue);
758     EXPECT_EQ(DISPLAY_FAILURE, ret);
759 }
760 
761 /**
762  * @tc.number : SUB_Driver_Display_GetDisplayProperty_0800
763  * @tc.name   : testGetDisplayProperty008
764  * @tc.desc   : test propertyId Negative Number
765  */
766 HWTEST_F(DeviceTestAdditional, testGetDisplayProperty008, Function | MediumTest | Level2)
767 {
768     const uint32_t propertyId = -1;
769     uint64_t propertyValue = 0;
770     auto ret = g_composerDevice->GetDisplayProperty(g_displayIds[0], propertyId, propertyValue);
771     EXPECT_EQ(DISPLAY_FAILURE, ret);
772 }
773 
774 /**
775  * @tc.number : SUB_Driver_Display_SetDisplayProperty_0100
776  * @tc.name   : testSetDisplayProperty001
777  * @tc.desc   : test devid Max
778  */
779 HWTEST_F(DeviceTestAdditional, testSetDisplayProperty001, Function | MediumTest | Level2)
780 {
781     const uint32_t propertyId = 1;
782     uint64_t propertyValue = 0;
783     auto ret = g_composerDevice->SetDisplayProperty(20, propertyId, propertyValue);
784     EXPECT_EQ(DISPLAY_FAILURE, ret);
785 }
786 
787 /**
788  * @tc.number : SUB_Driver_Display_SetDisplayProperty_0200
789  * @tc.name   : testSetDisplayProperty002
790  * @tc.desc   : test devid Min
791  */
792 HWTEST_F(DeviceTestAdditional, testSetDisplayProperty002, Function | MediumTest | Level2)
793 {
794     const uint32_t propertyId = 1;
795     uint64_t propertyValue = 0;
796     auto ret = g_composerDevice->SetDisplayProperty(0, propertyId, propertyValue);
797     EXPECT_EQ(DISPLAY_FAILURE, ret);
798 }
799 
800 /**
801  * @tc.number : SUB_Driver_Display_SetDisplayProperty_0300
802  * @tc.name   : testSetDisplayProperty003
803  * @tc.desc   : test devid Random
804  */
805 HWTEST_F(DeviceTestAdditional, testSetDisplayProperty003, Function | MediumTest | Level2)
806 {
807     const uint32_t propertyId = 1;
808     uint64_t propertyValue = 0;
809     auto ret = g_composerDevice->SetDisplayProperty(15, propertyId, propertyValue);
810     EXPECT_EQ(DISPLAY_FAILURE, ret);
811 }
812 
813 /**
814  * @tc.number : SUB_Driver_Display_SetDisplayProperty_0400
815  * @tc.name   : testSetDisplayProperty004
816  * @tc.desc   : test devid Negative Number
817  */
818 HWTEST_F(DeviceTestAdditional, testSetDisplayProperty004, Function | MediumTest | Level2)
819 {
820     const uint32_t propertyId = 1;
821     uint64_t propertyValue = 0;
822     auto ret = g_composerDevice->SetDisplayProperty(-1, propertyId, propertyValue);
823     EXPECT_EQ(DISPLAY_FAILURE, ret);
824 }
825 
826 /**
827  * @tc.number : SUB_Driver_Display_SetDisplayProperty_0500
828  * @tc.name   : testSetDisplayProperty005
829  * @tc.desc   : test propertyId Random
830  */
831 HWTEST_F(DeviceTestAdditional, testSetDisplayProperty005, Function | MediumTest | Level2)
832 {
833     const uint32_t propertyId = 20;
834     uint64_t propertyValue = 0;
835     auto ret = g_composerDevice->SetDisplayProperty(g_displayIds[0], propertyId, propertyValue);
836     EXPECT_EQ(DISPLAY_FAILURE, ret);
837 }
838 
839 /**
840  * @tc.number : SUB_Driver_Display_SetDisplayProperty_0600
841  * @tc.name   : testSetDisplayProperty006
842  * @tc.desc   : test propertyId Min
843  */
844 HWTEST_F(DeviceTestAdditional, testSetDisplayProperty006, Function | MediumTest | Level2)
845 {
846     const uint32_t propertyId = 0;
847     uint64_t propertyValue = 0;
848     auto ret = g_composerDevice->SetDisplayProperty(g_displayIds[0], propertyId, propertyValue);
849     EXPECT_EQ(DISPLAY_FAILURE, ret);
850 }
851 
852 /**
853  * @tc.number : SUB_Driver_Display_SetDisplayProperty_0700
854  * @tc.name   : testSetDisplayProperty007
855  * @tc.desc   : test propertyId Negative Number
856  */
857 HWTEST_F(DeviceTestAdditional, testSetDisplayProperty007, Function | MediumTest | Level2)
858 {
859     const uint32_t propertyId = -1;
860     uint64_t propertyValue = 0;
861     auto ret = g_composerDevice->SetDisplayProperty(g_displayIds[0], propertyId, propertyValue);
862     EXPECT_EQ(DISPLAY_FAILURE, ret);
863 }
864 
865 /**
866  * @tc.number : SUB_Driver_Display_SetDisplayProperty_0800
867  * @tc.name   : testSetDisplayProperty008
868  * @tc.desc   : test propertyValue Random
869  */
870 HWTEST_F(DeviceTestAdditional, testSetDisplayProperty008, Function | MediumTest | Level2)
871 {
872     const uint32_t propertyId = 0;
873     uint64_t propertyValue = 20;
874     auto ret = g_composerDevice->SetDisplayProperty(g_displayIds[0], propertyId, propertyValue);
875     EXPECT_EQ(DISPLAY_FAILURE, ret);
876 }
877 
878 /**
879  * @tc.number : SUB_Driver_Display_SetDisplayProperty_0900
880  * @tc.name   : testSetDisplayProperty009
881  * @tc.desc   : test propertyValue Negative Number
882  */
883 HWTEST_F(DeviceTestAdditional, testSetDisplayProperty009, Function | MediumTest | Level2)
884 {
885     const uint32_t propertyId = 0;
886     uint64_t propertyValue = -1;
887     auto ret = g_composerDevice->SetDisplayProperty(g_displayIds[0], propertyId, propertyValue);
888     EXPECT_EQ(DISPLAY_FAILURE, ret);
889 }
890 
891 /**
892  * @tc.number : SUB_Driver_Display_SetDisplayVsyncEnabled_0100
893  * @tc.name   : testSetDisplayVsyncEnabled001
894  * @tc.desc   : test devid Max
895  */
896 HWTEST_F(DeviceTestAdditional, testSetDisplayVsyncEnabled001, Function | MediumTest | Level2)
897 {
898     auto ret = g_composerDevice->SetDisplayVsyncEnabled(20, true);
899     EXPECT_EQ(DISPLAY_FAILURE, ret);
900 }
901 
902 /**
903  * @tc.number : SUB_Driver_Display_SetDisplayVsyncEnabled_0200
904  * @tc.name   : testSetDisplayVsyncEnabled002
905  * @tc.desc   : test devid Min
906  */
907 HWTEST_F(DeviceTestAdditional, testSetDisplayVsyncEnabled002, Function | MediumTest | Level1)
908 {
909     auto ret = g_composerDevice->SetDisplayVsyncEnabled(0, true);
910     EXPECT_EQ(DISPLAY_SUCCESS, ret);
911 }
912 
913 /**
914  * @tc.number : SUB_Driver_Display_SetDisplayVsyncEnabled_0300
915  * @tc.name   : testSetDisplayVsyncEnabled003
916  * @tc.desc   : test devid Random
917  */
918 HWTEST_F(DeviceTestAdditional, testSetDisplayVsyncEnabled003, Function | MediumTest | Level2)
919 {
920     auto ret = g_composerDevice->SetDisplayVsyncEnabled(15, true);
921     EXPECT_EQ(DISPLAY_FAILURE, ret);
922 }
923 
924 /**
925  * @tc.number : SUB_Driver_Display_SetDisplayVsyncEnabled_0400
926  * @tc.name   : testSetDisplayVsyncEnabled004
927  * @tc.desc   : test devid Negative Number
928  */
929 HWTEST_F(DeviceTestAdditional, testSetDisplayVsyncEnabled004, Function | MediumTest | Level2)
930 {
931     auto ret = g_composerDevice->SetDisplayVsyncEnabled(-1, true);
932     EXPECT_EQ(DISPLAY_FAILURE, ret);
933 }
934 
935 /**
936  * @tc.number : SUB_Driver_Display_SetDisplayVsyncEnabled_0500
937  * @tc.name   : testSetDisplayVsyncEnabled005
938  * @tc.desc   : test enabled true
939  */
940 HWTEST_F(DeviceTestAdditional, testSetDisplayVsyncEnabled005, Function | MediumTest | Level1)
941 {
942     auto ret = g_composerDevice->SetDisplayVsyncEnabled(g_displayIds[0], true);
943     EXPECT_EQ(DISPLAY_SUCCESS, ret);
944 }
945 
946 /**
947  * @tc.number : SUB_Driver_Display_SetDisplayVsyncEnabled_0600
948  * @tc.name   : testSetDisplayVsyncEnabled006
949  * @tc.desc   : test enabled true
950  */
951 HWTEST_F(DeviceTestAdditional, testSetDisplayVsyncEnabled006, Function | MediumTest | Level1)
952 {
953     auto ret = g_composerDevice->SetDisplayVsyncEnabled(g_displayIds[0], false);
954     EXPECT_EQ(DISPLAY_SUCCESS, ret);
955 }
956 
957 /**
958  * @tc.number : SUB_Driver_Display_CreateLayer_0100
959  * @tc.name   : testCreateLayer001
960  * @tc.desc   : test devId Max
961  */
962 HWTEST_F(DeviceTestAdditional, testCreateLayer001, Function | MediumTest | Level2)
963 {
964     LayerInfo layerInfo;
965     uint32_t count = 3;
966     uint32_t layerId;
967     auto ret = g_composerDevice->CreateLayer(20, layerInfo, count, layerId);
968     EXPECT_EQ(DISPLAY_FAILURE, ret);
969 }
970 
971 /**
972  * @tc.number : SUB_Driver_Display_CreateLayer_0200
973  * @tc.name   : testCreateLayer002
974  * @tc.desc   : test devId Min
975  */
976 HWTEST_F(DeviceTestAdditional, testCreateLayer002, Function | MediumTest | Level1)
977 {
978     LayerInfo layerInfo;
979     uint32_t count = 3;
980     uint32_t layerId;
981     auto ret = g_composerDevice->CreateLayer(0, layerInfo, count, layerId);
982     EXPECT_EQ(DISPLAY_SUCCESS, ret);
983 }
984 
985 /**
986  * @tc.number : SUB_Driver_Display_CreateLayer_0300
987  * @tc.name   : testCreateLayer003
988  * @tc.desc   : test devId Random
989  */
990 HWTEST_F(DeviceTestAdditional, testCreateLayer003, Function | MediumTest | Level2)
991 {
992     LayerInfo layerInfo;
993     uint32_t count = 3;
994     uint32_t layerId;
995     auto ret = g_composerDevice->CreateLayer(15, layerInfo, count, layerId);
996     EXPECT_EQ(DISPLAY_FAILURE, ret);
997 }
998 
999 /**
1000  * @tc.number : SUB_Driver_Display_CreateLayer_0400
1001  * @tc.name   : testCreateLayer004
1002  * @tc.desc   : test devId Negative Number
1003  */
1004 HWTEST_F(DeviceTestAdditional, testCreateLayer004, Function | MediumTest | Level2)
1005 {
1006     LayerInfo layerInfo;
1007     uint32_t count = 3;
1008     uint32_t layerId;
1009     auto ret = g_composerDevice->CreateLayer(-1, layerInfo, count, layerId);
1010     EXPECT_EQ(DISPLAY_FAILURE, ret);
1011 }
1012 
1013 /**
1014  * @tc.number : SUB_Driver_Display_CreateLayer_0500
1015  * @tc.name   : testCreateLayer005
1016  * @tc.desc   : test cacheCount Max
1017  */
1018 HWTEST_F(DeviceTestAdditional, testCreateLayer005, Function | MediumTest | Level1)
1019 {
1020     LayerInfo layerInfo;
1021     uint32_t count = 20;
1022     uint32_t layerId;
1023     auto ret = g_composerDevice->CreateLayer(g_displayIds[0], layerInfo, count, layerId);
1024     EXPECT_EQ(DISPLAY_SUCCESS, ret);
1025 }
1026 
1027 /**
1028  * @tc.number : SUB_Driver_Display_CreateLayer_0600
1029  * @tc.name   : testCreateLayer006
1030  * @tc.desc   : test devId Min
1031  */
1032 HWTEST_F(DeviceTestAdditional, testCreateLayer006, Function | MediumTest | Level1)
1033 {
1034     LayerInfo layerInfo;
1035     uint32_t count = 0;
1036     uint32_t layerId;
1037     auto ret = g_composerDevice->CreateLayer(g_displayIds[0], layerInfo, count, layerId);
1038     EXPECT_EQ(DISPLAY_SUCCESS, ret);
1039 }
1040 
1041 /**
1042  * @tc.number : SUB_Driver_Display_CreateLayer_0700
1043  * @tc.name   : testCreateLayer007
1044  * @tc.desc   : test devId Random
1045  */
1046 HWTEST_F(DeviceTestAdditional, testCreateLayer007, Function | MediumTest | Level1)
1047 {
1048     LayerInfo layerInfo;
1049     uint32_t count = 15;
1050     uint32_t layerId;
1051     auto ret = g_composerDevice->CreateLayer(g_displayIds[0], layerInfo, count, layerId);
1052     EXPECT_EQ(DISPLAY_SUCCESS, ret);
1053 }
1054 
1055 /**
1056  * @tc.number : SUB_Driver_Display_CreateLayer_0800
1057  * @tc.name   : testCreateLayer008
1058  * @tc.desc   : test devId Negative Number
1059  */
1060 HWTEST_F(DeviceTestAdditional, testCreateLayer008, Function | MediumTest | Level1)
1061 {
1062     LayerInfo layerInfo;
1063     uint32_t count = -1;
1064     uint32_t layerId;
1065     auto ret = g_composerDevice->CreateLayer(g_displayIds[0], layerInfo, count, layerId);
1066     EXPECT_EQ(DISPLAY_SUCCESS, ret);
1067 }
1068 
1069 /**
1070  * @tc.number : SUB_Driver_Display_DestroyLayer_0100
1071  * @tc.name   : testDestroyLayer001
1072  * @tc.desc   : test devId Max
1073  */
1074 HWTEST_F(DeviceTestAdditional, testDestroyLayer001, Function | MediumTest | Level2)
1075 {
1076     uint32_t layerId = 1;
1077     auto ret = g_composerDevice->DestroyLayer(20, layerId);
1078     EXPECT_EQ(DISPLAY_FAILURE, ret);
1079 }
1080 
1081 /**
1082  * @tc.number : SUB_Driver_Display_DestroyLayer_0200
1083  * @tc.name   : testDestroyLayer002
1084  * @tc.desc   : test devId Min
1085  */
1086 HWTEST_F(DeviceTestAdditional, testDestroyLayer002, Function | MediumTest | Level2)
1087 {
1088     uint32_t layerId = 1;
1089     auto ret = g_composerDevice->DestroyLayer(0, layerId);
1090     EXPECT_EQ(DISPLAY_FAILURE, ret);
1091 }
1092 
1093 /**
1094  * @tc.number : SUB_Driver_Display_DestroyLayer_0300
1095  * @tc.name   : testDestroyLayer003
1096  * @tc.desc   : test devId Random
1097  */
1098 HWTEST_F(DeviceTestAdditional, testDestroyLayer003, Function | MediumTest | Level2)
1099 {
1100     uint32_t layerId = 1;
1101     auto ret = g_composerDevice->DestroyLayer(15, layerId);
1102     EXPECT_EQ(DISPLAY_FAILURE, ret);
1103 }
1104 
1105 /**
1106  * @tc.number : SUB_Driver_Display_DestroyLayer_0400
1107  * @tc.name   : testDestroyLayer004
1108  * @tc.desc   : test devId Negative Number
1109  */
1110 HWTEST_F(DeviceTestAdditional, testDestroyLayer004, Function | MediumTest | Level2)
1111 {
1112     uint32_t layerId = 1;
1113     auto ret = g_composerDevice->DestroyLayer(-1, layerId);
1114     EXPECT_EQ(DISPLAY_FAILURE, ret);
1115 }
1116 
1117 /**
1118  * @tc.number : SUB_Driver_Display_DestroyLayer_0500
1119  * @tc.name   : testDestroyLayer005
1120  * @tc.desc   : test layerId Max
1121  */
1122 HWTEST_F(DeviceTestAdditional, testDestroyLayer005, Function | MediumTest | Level2)
1123 {
1124     uint32_t layerId = 20;
1125     auto ret = g_composerDevice->DestroyLayer(g_displayIds[0], layerId);
1126     EXPECT_EQ(DISPLAY_FAILURE, ret);
1127 }
1128 
1129 /**
1130  * @tc.number : SUB_Driver_Display_DestroyLayer_0600
1131  * @tc.name   : testDestroyLayer006
1132  * @tc.desc   : test layerId Min
1133  */
1134 HWTEST_F(DeviceTestAdditional, testDestroyLayer006, Function | MediumTest | Level2)
1135 {
1136     uint32_t layerId = 0;
1137     auto ret = g_composerDevice->DestroyLayer(g_displayIds[0], layerId);
1138     EXPECT_EQ(DISPLAY_FAILURE, ret);
1139 }
1140 
1141 #ifdef DISPLAY_COMMUNITY
1142 /**
1143  * @tc.number : SUB_Driver_Display_DestroyLayer_0700
1144  * @tc.name   : testDestroyLayer007
1145  * @tc.desc   : test layerId Random
1146  */
1147 HWTEST_F(DeviceTestAdditional, testDestroyLayer007, Function | MediumTest | Level2)
1148 {
1149     uint32_t layerId = 15;
1150     auto ret = g_composerDevice->DestroyLayer(g_displayIds[0], layerId);
1151     EXPECT_EQ(DISPLAY_FAILURE, ret);
1152 }
1153 #endif
1154 
1155 /**
1156  * @tc.number : SUB_Driver_Display_DestroyLayer_0800
1157  * @tc.name   : testDestroyLayer008
1158  * @tc.desc   : test layerId Negative Number
1159  */
1160 HWTEST_F(DeviceTestAdditional, testDestroyLayer008, Function | MediumTest | Level2)
1161 {
1162     uint32_t layerId = -1;
1163     auto ret = g_composerDevice->DestroyLayer(g_displayIds[0], layerId);
1164     EXPECT_EQ(DISPLAY_FAILURE, ret);
1165 }
1166 
1167 /**
1168  * @tc.number : SUB_Driver_Display_SetDisplayClientCrop_0100
1169  * @tc.name   : testSetDisplayClientCrop001
1170  * @tc.desc   : test layerId Max
1171  */
1172 HWTEST_F(DeviceTestAdditional, testSetDisplayClientCrop001, Function | MediumTest | Level2)
1173 {
1174     const int32_t width = 1920;
1175     const int32_t height = 1080;
1176     IRect rect = {0, 0, width, height};
1177     auto ret = g_composerDevice->SetDisplayClientCrop(20, rect);
1178     EXPECT_EQ(DISPLAY_FAILURE, ret);
1179 }
1180 
1181 /**
1182  * @tc.number : SUB_Driver_Display_SetDisplayClientCrop_0200
1183  * @tc.name   : testSetDisplayClientCrop002
1184  * @tc.desc   : test layerId Min
1185  */
1186 HWTEST_F(DeviceTestAdditional, testSetDisplayClientCrop002, Function | MediumTest | Level2)
1187 {
1188     const int32_t width = 1920;
1189     const int32_t height = 1080;
1190     IRect rect = {0, 0, width, height};
1191     auto ret = g_composerDevice->SetDisplayClientCrop(0, rect);
1192     EXPECT_EQ(DISPLAY_FAILURE, ret);
1193 }
1194 
1195 /**
1196  * @tc.number : SUB_Driver_Display_SetDisplayClientCrop_0300
1197  * @tc.name   : testSetDisplayClientCrop003
1198  * @tc.desc   : test layerId Random
1199  */
1200 HWTEST_F(DeviceTestAdditional, testSetDisplayClientCrop003, Function | MediumTest | Level2)
1201 {
1202     const int32_t width = 1920;
1203     const int32_t height = 1080;
1204     IRect rect = {0, 0, width, height};
1205     auto ret = g_composerDevice->SetDisplayClientCrop(15, rect);
1206     EXPECT_EQ(DISPLAY_FAILURE, ret);
1207 }
1208 
1209 /**
1210  * @tc.number : SUB_Driver_Display_SetDisplayClientCrop_0400
1211  * @tc.name   : testSetDisplayClientCrop004
1212  * @tc.desc   : test layerId Negative Number
1213  */
1214 HWTEST_F(DeviceTestAdditional, testSetDisplayClientCrop004, Function | MediumTest | Level2)
1215 {
1216     const int32_t width = 1920;
1217     const int32_t height = 1080;
1218     IRect rect = {0, 0, width, height};
1219     auto ret = g_composerDevice->SetDisplayClientCrop(-1, rect);
1220     EXPECT_EQ(DISPLAY_FAILURE, ret);
1221 }
1222 
1223 #ifdef DISPLAY_COMMUNITY
1224 /**
1225  * @tc.number : SUB_Driver_Display_GetDisplayReleaseFence_0100
1226  * @tc.name   : testGetDisplayReleaseFence001
1227  * @tc.desc   : test devId Max
1228  */
1229 HWTEST_F(DeviceTestAdditional, testGetDisplayReleaseFence001, Function | MediumTest | Level2)
1230 {
1231     std::vector<uint32_t> layers{};
1232     std::vector<int32_t> fences{};
1233     auto ret = g_composerDevice->GetDisplayReleaseFence(20, layers, fences);
1234     EXPECT_EQ(DISPLAY_FAILURE, ret);
1235 }
1236 #endif
1237 
1238 /**
1239  * @tc.number : SUB_Driver_Display_GetDisplayReleaseFence_0200
1240  * @tc.name   : testGetDisplayReleaseFence002
1241  * @tc.desc   : test devId Min
1242  */
1243 HWTEST_F(DeviceTestAdditional, testGetDisplayReleaseFence002, Function | MediumTest | Level1)
1244 {
1245     std::vector<uint32_t> layers{};
1246     std::vector<int32_t> fences{};
1247     auto ret = g_composerDevice->GetDisplayReleaseFence(0, layers, fences);
1248     EXPECT_EQ(DISPLAY_SUCCESS, ret);
1249 }
1250 
1251 #ifdef DISPLAY_COMMUNITY
1252 /**
1253  * @tc.number : SUB_Driver_Display_GetDisplayReleaseFence_0300
1254  * @tc.name   : testGetDisplayReleaseFence003
1255  * @tc.desc   : test devId Random
1256  */
1257 HWTEST_F(DeviceTestAdditional, testGetDisplayReleaseFence003, Function | MediumTest | Level2)
1258 {
1259     std::vector<uint32_t> layers{};
1260     std::vector<int32_t> fences{};
1261     auto ret = g_composerDevice->GetDisplayReleaseFence(15, layers, fences);
1262     EXPECT_EQ(DISPLAY_FAILURE, ret);
1263 }
1264 
1265 /**
1266  * @tc.number : SUB_Driver_Display_GetDisplayReleaseFence_0400
1267  * @tc.name   : testGetDisplayReleaseFence004
1268  * @tc.desc   : test devId Negative Number
1269  */
1270 HWTEST_F(DeviceTestAdditional, testGetDisplayReleaseFence004, Function | MediumTest | Level2)
1271 {
1272     std::vector<uint32_t> layers{};
1273     std::vector<int32_t> fences{};
1274     auto ret = g_composerDevice->GetDisplayReleaseFence(-1, layers, fences);
1275     EXPECT_EQ(DISPLAY_FAILURE, ret);
1276 }
1277 #endif
1278 
1279 /**
1280  * @tc.number : SUB_Driver_Display_CreateVirtualDisplay_0100
1281  * @tc.name   : testCreateVirtualDisplay001
1282  * @tc.desc   : test width Min
1283  */
1284 HWTEST_F(DeviceTestAdditional, testCreateVirtualDisplay001, Function | MediumTest | Level2)
1285 {
1286     uint32_t width = 0;
1287     uint32_t height = 1080;
1288     int32_t format = 0;
1289     uint32_t devId = 0;
1290     auto ret = g_composerDevice->CreateVirtualDisplay(width, height, format, devId);
1291     EXPECT_EQ(DISPLAY_FAILURE, ret);
1292 }
1293 
1294 /**
1295  * @tc.number : SUB_Driver_Display_CreateVirtualDisplay_0200
1296  * @tc.name   : testCreateVirtualDisplay002
1297  * @tc.desc   : test width Random
1298  */
1299 HWTEST_F(DeviceTestAdditional, testCreateVirtualDisplay002, Function | MediumTest | Level2)
1300 {
1301     uint32_t width = 2560;
1302     uint32_t height = 1080;
1303     int32_t format = 0;
1304     uint32_t devId = 0;
1305     auto ret = g_composerDevice->CreateVirtualDisplay(width, height, format, devId);
1306     EXPECT_EQ(DISPLAY_FAILURE, ret);
1307 }
1308 
1309 /**
1310  * @tc.number : SUB_Driver_Display_CreateVirtualDisplay_0300
1311  * @tc.name   : testCreateVirtualDisplay003
1312  * @tc.desc   : test height Min
1313  */
1314 HWTEST_F(DeviceTestAdditional, testCreateVirtualDisplay003, Function | MediumTest | Level2)
1315 {
1316     uint32_t width = 1920;
1317     uint32_t height = 0;
1318     int32_t format = 0;
1319     uint32_t devId = 0;
1320     auto ret = g_composerDevice->CreateVirtualDisplay(width, height, format, devId);
1321     EXPECT_EQ(DISPLAY_FAILURE, ret);
1322 }
1323 
1324 /**
1325  * @tc.number : SUB_Driver_Display_CreateVirtualDisplay_0400
1326  * @tc.name   : testCreateVirtualDisplay004
1327  * @tc.desc   : test height Random
1328  */
1329 HWTEST_F(DeviceTestAdditional, testCreateVirtualDisplay004, Function | MediumTest | Level2)
1330 {
1331     uint32_t width = 1920;
1332     uint32_t height = 1440;
1333     int32_t format = 0;
1334     uint32_t devId = 0;
1335     auto ret = g_composerDevice->CreateVirtualDisplay(width, height, format, devId);
1336     EXPECT_EQ(DISPLAY_FAILURE, ret);
1337 }
1338 
1339 /**
1340  * @tc.number : SUB_Driver_Display_DestroyVirtualDisplay_0100
1341  * @tc.name   : testDestroyVirtualDisplay001
1342  * @tc.desc   : test devId Max
1343  */
1344 HWTEST_F(DeviceTestAdditional, testDestroyVirtualDisplay001, Function | MediumTest | Level2)
1345 {
1346     uint32_t devId = 20;
1347     auto ret = g_composerDevice->DestroyVirtualDisplay(devId);
1348     EXPECT_EQ(DISPLAY_FAILURE, ret);
1349 }
1350 
1351 /**
1352  * @tc.number : SUB_Driver_Display_DestroyVirtualDisplay_0200
1353  * @tc.name   : testDestroyVirtualDisplay002
1354  * @tc.desc   : test devId 1
1355  */
1356 HWTEST_F(DeviceTestAdditional, testDestroyVirtualDisplay002, Function | MediumTest | Level2)
1357 {
1358     uint32_t devId = 1;
1359     auto ret = g_composerDevice->DestroyVirtualDisplay(devId);
1360     EXPECT_EQ(DISPLAY_FAILURE, ret);
1361 }
1362 
1363 /**
1364  * @tc.number : SUB_Driver_Display_DestroyVirtualDisplay_0300
1365  * @tc.name   : testDestroyVirtualDisplay003
1366  * @tc.desc   : test devId Random
1367  */
1368 HWTEST_F(DeviceTestAdditional, testDestroyVirtualDisplay003, Function | MediumTest | Level2)
1369 {
1370     uint32_t devId = 15;
1371     auto ret = g_composerDevice->DestroyVirtualDisplay(devId);
1372     EXPECT_EQ(DISPLAY_FAILURE, ret);
1373 }
1374 
1375 /**
1376  * @tc.number : SUB_Driver_Display_DestroyVirtualDisplay_0300
1377  * @tc.name   : testDestroyVirtualDisplay004
1378  * @tc.desc   : test devId Negative Number
1379  */
1380 HWTEST_F(DeviceTestAdditional, testDestroyVirtualDisplay004, Function | MediumTest | Level2)
1381 {
1382     uint32_t devId = -1;
1383     auto ret = g_composerDevice->DestroyVirtualDisplay(devId);
1384     EXPECT_EQ(DISPLAY_FAILURE, ret);
1385 }
1386 
1387 /**
1388  * @tc.number : SUB_Driver_Display_SetVirtualDisplayBuffer_0100
1389  * @tc.name   : testSetVirtualDisplayBuffer001
1390  * @tc.desc   : test devId Max
1391  */
1392 HWTEST_F(DeviceTestAdditional, testSetVirtualDisplayBuffer001, Function | MediumTest | Level2)
1393 {
1394     BufferHandle buffer;
1395     int32_t fence = 1;
1396     auto ret = g_composerDevice->SetVirtualDisplayBuffer(20, buffer, fence);
1397     EXPECT_EQ(DISPLAY_FAILURE, ret);
1398 }
1399 
1400 /**
1401  * @tc.number : SUB_Driver_Display_SetVirtualDisplayBuffer_0200
1402  * @tc.name   : testSetVirtualDisplayBuffer002
1403  * @tc.desc   : test devId Min
1404  */
1405 HWTEST_F(DeviceTestAdditional, testSetVirtualDisplayBuffer002, Function | MediumTest | Level2)
1406 {
1407     BufferHandle buffer;
1408     int32_t fence = 1;
1409     auto ret = g_composerDevice->SetVirtualDisplayBuffer(0, buffer, fence);
1410     EXPECT_EQ(DISPLAY_FAILURE, ret);
1411 }
1412 
1413 /**
1414  * @tc.number : SUB_Driver_Display_SetVirtualDisplayBuffer_0300
1415  * @tc.name   : testSetVirtualDisplayBuffer003
1416  * @tc.desc   : test devId Random
1417  */
1418 HWTEST_F(DeviceTestAdditional, testSetVirtualDisplayBuffer003, Function | MediumTest | Level2)
1419 {
1420     BufferHandle buffer;
1421     int32_t fence = 1;
1422     auto ret = g_composerDevice->SetVirtualDisplayBuffer(15, buffer, fence);
1423     EXPECT_EQ(DISPLAY_FAILURE, ret);
1424 }
1425 
1426 /**
1427  * @tc.number : SUB_Driver_Display_SetVirtualDisplayBuffer_0400
1428  * @tc.name   : testSetVirtualDisplayBuffer004
1429  * @tc.desc   : test devId Negative Number
1430  */
1431 HWTEST_F(DeviceTestAdditional, testSetVirtualDisplayBuffer004, Function | MediumTest | Level2)
1432 {
1433     BufferHandle buffer;
1434     int32_t fence = 1;
1435     auto ret = g_composerDevice->SetVirtualDisplayBuffer(-1, buffer, fence);
1436     EXPECT_EQ(DISPLAY_FAILURE, ret);
1437 }
1438 
1439 /**
1440  * @tc.number : SUB_Driver_Display_RegDisplayVBlankCallback_0100
1441  * @tc.name   : testRegDisplayVBlankCallback001
1442  * @tc.desc   : test RegDisplayVBlankCallback
1443  */
1444 HWTEST_F(DeviceTestAdditional, testRegDisplayVBlankCallback001, Function | MediumTest | Level1)
1445 {
1446     auto ret = g_composerDevice->RegDisplayVBlankCallback(g_displayIds[0], nullptr, nullptr);
1447     EXPECT_EQ(DISPLAY_SUCCESS, ret);
1448 }
1449 
1450 /**
1451  * @tc.number : SUB_Driver_Display_RegHotPlugCallback_0100
1452  * @tc.name   : testRegHotPlugCallback001
1453  * @tc.desc   : test RegHotPlugCallback
1454  */
1455 HWTEST_F(DeviceTestAdditional, testRegHotPlugCallback001, Function | MediumTest | Level1)
1456 {
1457     auto ret = g_composerDevice->RegHotPlugCallback(nullptr, nullptr);
1458     EXPECT_EQ(DISPLAY_SUCCESS, ret);
1459 }
1460