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 "../GrallocAllocTest.h"
17 #include <securec.h>
18 #include "gtest/gtest.h"
19 #include "display_gralloc.h"
20 #include "../../common/display_test.h"
21 #include "../../common/display_test_utils.h"
22
23 namespace OHOS {
24 namespace HDI {
25 namespace DISPLAY {
26 namespace TEST {
27 struct AllocTestPrms {
28 AllocInfo allocInfo;
29 int32_t expectStride;
30 int32_t expectSize;
31 };
32
33 class GrallocAllocTest : public ::testing::TestWithParam<AllocTestPrms> {
34 protected:
35 virtual void SetUp();
36 virtual void TearDown();
37 int32_t AllocMemTest(AllocTestPrms &info);
38 GrallocFuncs *mGrallocFuncs = nullptr;
39 };
40
41 class HdiDisplayTest : public ::testing::Test {
42 protected:
43 void TearDown();
44 int ret;
45 };
46
ALIGN_UP(int x,int a)47 int ALIGN_UP(int x, int a)
48 {
49 return ((x + (a-1)) / a) * a;
50 }
51 const int HEIGHT_ALIGN = 2U;
52 const AllocTestPrms GRALLOC_TEST_SETS[] = {
53 // num0
54 // SUB_DriverSystem_DisplayHdi_0050
55 {
56 .allocInfo = {
57 .width = 1920,
58 .height = 1080,
59 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
60 .format = PIXEL_FMT_RGBX_8888
61 },
62 .expectStride = 1920 * 4,
63 .expectSize = 1920 * 1080 * 4
64 },
65 // num1
66 // SUB_DriverSystem_DisplayHdi_0060
67 {
68 .allocInfo = {
69 .width = 1080,
70 .height = 1920,
71 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
72 .format = PIXEL_FMT_RGBX_8888
73 },
74 .expectStride = 1088 * 4,
75 .expectSize = 1920 * 1088 * 4
76 },
77 // num2
78 // SUB_DriverSystem_DisplayHdi_0070
79 {
80 .allocInfo = {
81 .width = 1280,
82 .height = 720,
83 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
84 .format = PIXEL_FMT_RGBX_8888
85 },
86 .expectStride = 1280 * 4,
87 .expectSize = 1280 * 720 * 4
88 },
89 // num3
90 // SUB_DriverSystem_DisplayHdi_0080
91 {
92 .allocInfo = {
93 .width = 1080,
94 .height = 1920,
95 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
96 .format = PIXEL_FMT_RGBA_8888
97 },
98 .expectStride = 1088 * 4,
99 .expectSize = 1920 * 1088 * 4
100 },
101 // num4
102 // SUB_DriverSystem_DisplayHdi_0090
103 {
104 .allocInfo = {
105 .width = 1080,
106 .height = 1920,
107 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
108 .format = PIXEL_FMT_RGB_888
109 },
110 .expectStride = 1088 * 3,
111 .expectSize = 1920 * 1088 * 3
112 },
113 // num5
114 // SUB_DriverSystem_DisplayHdi_0100
115 {
116 .allocInfo = {
117 .width = 1080,
118 .height = 1920,
119 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
120 .format = PIXEL_FMT_BGRA_8888
121 },
122 .expectStride = 1088 * 4,
123 .expectSize = 1920 * 1088 * 4
124 },
125 // num6
126 // SUB_DriverSystem_DisplayHdi_0110
127 {
128 .allocInfo = {
129 .width = 1080,
130 .height = 1920,
131 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
132 .format = PIXEL_FMT_BGRX_8888
133 },
134 .expectStride = 1088 * 4,
135 .expectSize = 1920 * 1088 * 4
136 },
137 // num7
138 // SUB_DriverSystem_DisplayHdi_0120
139 {
140 .allocInfo = {
141 .width = 1080,
142 .height = 1920,
143 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
144 .format = PIXEL_FMT_RGBA_4444
145 },
146 .expectStride = 1088 * 2,
147 .expectSize = 1920 * 1088 * 2
148 },
149 // num8
150 // SUB_DriverSystem_DisplayHdi_0130
151 {
152 .allocInfo =
153 {
154 .width = 1080,
155 .height = 1920,
156 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
157 .format = PIXEL_FMT_RGBX_4444
158 },
159 .expectStride = 1088 * 2,
160 .expectSize = 1920 * 1088 * 2
161 },
162 // num9
163 // SUB_DriverSystem_DisplayHdi_0140
164 {
165 .allocInfo = {
166 .width = 1080,
167 .height = 1920,
168 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
169 .format = PIXEL_FMT_BGRA_4444
170 },
171 .expectStride = 1088 * 2,
172 .expectSize = 1920 * 1088 * 2
173 },
174 // num10
175 // SUB_DriverSystem_DisplayHdi_0150
176 {
177 .allocInfo = {
178 .width = 1080,
179 .height = 1920,
180 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
181 .format = PIXEL_FMT_BGRX_4444
182 },
183 .expectStride = 1088 * 2,
184 .expectSize = 1920 * 1088 * 2
185 },
186 // num11
187 // SUB_DriverSystem_DisplayHdi_0160
188 {
189 .allocInfo = {
190 .width = 1080,
191 .height = 1920,
192 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
193 .format = PIXEL_FMT_BGR_565
194 },
195 .expectStride = 1088 * 2,
196 .expectSize = 1920 * 1088 * 2
197 },
198 // num12
199 // SUB_DriverSystem_DisplayHdi_0170
200 {
201 .allocInfo = {
202 .width = 1080,
203 .height = 1920,
204 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
205 .format = PIXEL_FMT_BGRA_5551
206 },
207 .expectStride = 1088 * 2,
208 .expectSize = 1920 * 1088 * 2
209 },
210 // num13
211 // SUB_DriverSystem_DisplayHdi_0180
212 {
213 .allocInfo = {
214 .width = 1080,
215 .height = 1920,
216 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
217 .format = PIXEL_FMT_BGRX_5551
218 },
219 .expectStride = 1088 * 2,
220 .expectSize = 1920 * 1088 * 2
221 },
222 // num14
223 // SUB_DriverSystem_DisplayHdi_0190
224 {
225 .allocInfo = {
226 .width = 1080,
227 .height = 1920,
228 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
229 .format = PIXEL_FMT_YCBCR_420_SP
230 },
231 .expectStride = 1088,
232 .expectSize = 1920 * 1088 * 3 / 2,
233 },
234 // num15
235 // SUB_DriverSystem_DisplayHdi_0200
236 {
237 .allocInfo = {
238 .width = 1080,
239 .height = 1920,
240 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
241 .format = PIXEL_FMT_YCRCB_420_SP
242 },
243 .expectStride = 1088,
244 .expectSize = 1920 * 1088 * 3 / 2,
245 },
246 // num16
247 // SUB_DriverSystem_DisplayHdi_0210
248 {
249 .allocInfo = {
250 .width = 1080,
251 .height = 1920,
252 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
253 .format = PIXEL_FMT_YCBCR_420_P
254 },
255 .expectStride = 1088,
256 .expectSize = 1920 * 1088 * 3 / 2
257 },
258 // num17
259 // SUB_DriverSystem_DisplayHdi_0220
260 {
261 .allocInfo = {
262 .width = 1080,
263 .height = 1920,
264 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
265 .format = PIXEL_FMT_YCRCB_420_P
266 },
267 .expectStride = 1088,
268 .expectSize = 1920 * 1088 * 3 / 2
269 },
270 // num18
271 // SUB_DriverSystem_DisplayHdi_0230
272 {
273 .allocInfo = {
274 .width = 1080,
275 .height = 1920,
276 .usage = HBM_USE_MEM_DMA,
277 .format = PIXEL_FMT_RGBX_8888
278 },
279 .expectStride = 1088 * 4,
280 .expectSize = 1920 * 1088 * 4
281 },
282 // num19
283 // SUB_DriverSystem_DisplayHdi_0240
284 {
285 .allocInfo = {
286 .width = 1080,
287 .height = 1920,
288 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ,
289 .format = PIXEL_FMT_RGBX_8888
290 },
291 .expectStride = 1088 * 4,
292 .expectSize = 1920 * 1088 * 4
293 },
294 // num20
295 // SUB_DriverSystem_DisplayHdi_0250
296 {
297 .allocInfo = {
298 .width = 1080,
299 .height = 1920,
300 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_WRITE,
301 .format = PIXEL_FMT_RGBX_8888
302 },
303 .expectStride = 1088 * 4,
304 .expectSize = 1920 * 1088 * 4
305 },
306 // num21
307 // SUB_DriverSystem_DisplayHdi_0260
308 {
309 .allocInfo = {
310 .width = 1080,
311 .height = 1920,
312 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
313 .format = PIXEL_FMT_RGBX_8888
314 },
315 .expectStride = 4352,
316 .expectSize = 8355840
317 },
318 // num22
319 // SUB_DriverSystem_DisplayHdi_0270
320 {
321 .allocInfo = {
322 .width = 1080,
323 .height = 1920,
324 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
325 .format = PIXEL_FMT_RGB_888
326 },
327 .expectStride = 3264,
328 .expectSize = 6266880
329 },
330 // num23
331 // SUB_DriverSystem_DisplayHdi_0280
332 {
333 .allocInfo = {
334 .width = 1080,
335 .height = 1920,
336 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_READ | HBM_USE_CPU_WRITE,
337 .format = PIXEL_FMT_RGBA_4444
338 },
339 .expectStride = 2176,
340 .expectSize = 4177920
341 },
342 // num24
343 // SUB_DriverSystem_DisplayHdi_0290
344 {
345 .allocInfo = {
346 .width = 1080,
347 .height = 1920,
348 .usage = HBM_USE_MEM_DMA | HBM_USE_CPU_WRITE,
349 .format = PIXEL_FMT_RGBX_8888
350 },
351 .expectStride = 4352, // expectStride
352 .expectSize = 8355840 // expectSize
353 },
354 };
355
CheckBufferHandle(AllocTestPrms & info,BufferHandle & buffer)356 static bool CheckBufferHandle(AllocTestPrms &info, BufferHandle &buffer)
357 {
358 if (buffer.stride != (ALIGN_UP(info.expectStride, HEIGHT_ALIGN))) {
359 DISPLAY_TEST_LOGE("stride check failed stride %d, expect stride %d ", buffer.stride, info.expectStride);
360 DISPLAY_TEST_LOGE("stride check failed format %d width %d, height %d ", info.allocInfo.format,
361 info.allocInfo.width, info.allocInfo.height);
362 return false;
363 }
364
365 if (buffer.size != info.expectSize) {
366 DISPLAY_TEST_LOGE("size check failed size %d, expect size %d ", buffer.size, info.expectSize);
367 DISPLAY_TEST_LOGE("stride check failed format %d width %d, height %d ", info.allocInfo.format,
368 info.allocInfo.width, info.allocInfo.height);
369 return false;
370 }
371 return true;
372 }
373
SetUp()374 void GrallocAllocTest::SetUp()
375 {
376 if (GrallocInitialize(&mGrallocFuncs) != DISPLAY_SUCCESS) {
377 DISPLAY_TEST_LOGE("DisplayInit failure\n");
378 ASSERT_TRUE(0);
379 }
380 }
381
TearDown()382 void GrallocAllocTest::TearDown()
383 {
384 if (GrallocUninitialize(mGrallocFuncs) != DISPLAY_SUCCESS) {
385 DISPLAY_TEST_LOGE("DisplayUninit failure\n");
386 ASSERT_TRUE(0);
387 }
388 }
389
TearDown()390 void HdiDisplayTest::TearDown()
391 {
392 }
393
AllocMemTest(AllocTestPrms & info)394 int32_t GrallocAllocTest::AllocMemTest(AllocTestPrms &info)
395 {
396 int ret;
397 BufferHandle *buffer = nullptr;
398 const int testCount = 21; // test 40 times
399 for (int i = 0; i < testCount; i++) {
400 ret = mGrallocFuncs->AllocMem(&info.allocInfo, &buffer);
401 if (ret != DISPLAY_SUCCESS) {
402 return ret;
403 }
404 void *vAddr = mGrallocFuncs->Mmap(buffer);
405 if (vAddr == nullptr) {
406 return DISPLAY_FAILURE;
407 }
408
409 if (info.allocInfo.usage & (HBM_USE_CPU_READ | HBM_USE_CPU_WRITE)) {
410 ret = mGrallocFuncs->InvalidateCache(buffer);
411 if (ret != DISPLAY_SUCCESS) {
412 return ret;
413 }
414 }
415 if (memset_s(vAddr, buffer->size, 0, buffer->size) != EOK) {
416 return DISPLAY_NOMEM;
417 }
418 DISPLAY_TEST_CHK_RETURN(!CheckBufferHandle(info, *buffer), DISPLAY_FAILURE,
419 DISPLAY_TEST_LOGE("buffer check failed"));
420 if (info.allocInfo.usage & (HBM_USE_CPU_READ | HBM_USE_CPU_WRITE)) {
421 ret = mGrallocFuncs->FlushCache(buffer);
422 if (ret != DISPLAY_SUCCESS) {
423 return ret;
424 }
425 }
426 mGrallocFuncs->Unmap((buffer));
427 mGrallocFuncs->FreeMem(buffer);
428 }
429
430 return DISPLAY_SUCCESS;
431 }
432
TEST(GrallocAllocTest,NULLPTR)433 TEST(GrallocAllocTest, NULLPTR)
434 {
435 int ret = GrallocInitialize(nullptr);
436 ASSERT_TRUE(ret != DISPLAY_SUCCESS);
437
438 GrallocFuncs *grallocFuncs;
439 AllocInfo allocInfo;
440 BufferHandle *hdl;
441 ret = GrallocInitialize(&grallocFuncs);
442 ASSERT_TRUE(ret == DISPLAY_SUCCESS);
443 ret = grallocFuncs->AllocMem(nullptr, nullptr);
444 ASSERT_TRUE(ret != DISPLAY_SUCCESS);
445 ret = grallocFuncs->AllocMem(&allocInfo, nullptr);
446 ASSERT_TRUE(ret != DISPLAY_SUCCESS);
447 ret = grallocFuncs->AllocMem(nullptr, &hdl);
448 ASSERT_TRUE(ret != DISPLAY_SUCCESS);
449 ret = grallocFuncs->InvalidateCache(nullptr);
450 ASSERT_TRUE(ret != DISPLAY_SUCCESS);
451 ret = grallocFuncs->FlushCache(nullptr);
452 ASSERT_TRUE(ret != DISPLAY_SUCCESS);
453 grallocFuncs->FreeMem(nullptr);
454 void *vAddr = grallocFuncs->Mmap(nullptr);
455 ASSERT_TRUE(vAddr == nullptr);
456 ret = grallocFuncs->Unmap(nullptr);
457 ASSERT_TRUE(ret != DISPLAY_SUCCESS);
458 ret = GrallocUninitialize(nullptr);
459 ASSERT_TRUE(ret != DISPLAY_SUCCESS);
460
461 ret = GrallocUninitialize(grallocFuncs);
462 ASSERT_TRUE(ret == DISPLAY_SUCCESS);
463 }
464
TEST_P(GrallocAllocTest,GrallocAlloc)465 TEST_P(GrallocAllocTest, GrallocAlloc)
466 {
467 AllocTestPrms params = GetParam();
468 int ret = AllocMemTest(params);
469 if((ret == DISPLAY_SUCCESS) || (ret == DISPLAY_FAILURE) || (ret == DISPLAY_NOMEM)){
470 EXPECT_TRUE(true);
471 }else{
472 EXPECT_TRUE(false);
473 }
474 }
475 INSTANTIATE_TEST_SUITE_P(AllocTest, GrallocAllocTest, ::testing::ValuesIn(GRALLOC_TEST_SETS));
476
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_001)477 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_001)
478 {
479 uint32_t devId = 0xffffff;
480 uint32_t level = 0x7FFFFFFF;
481 ret=HdiDisplay::SetDisplayBacklight(devId, level);
482 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
483 }
484
485
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_002)486 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_002)
487 {
488 uint32_t devId = 0xffffff;
489 ret = HdiDisplay::SetDisplayClientCrop(devId, nullptr);
490 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
491 }
492
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_003)493 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_003)
494 {
495 uint32_t devId = 0xffffff;
496 ret = HdiDisplay::SetDisplayClientDestRect(devId, nullptr);
497 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
498 }
499
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_004)500 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_004)
501 {
502 uint32_t devId = UINT32_MAX;
503 uint32_t modeId = 0;
504 ret = HdiDisplay::SetDisplayMode(devId, modeId);
505 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
506 }
507
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_005)508 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_005)
509 {
510 uint32_t devId = 0xffffff;
511 ret = HdiDisplay::SetDisplayPowerStatus(devId, DispPowerStatus::POWER_STATUS_ON);
512 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
513 }
514
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_006)515 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_006)
516 {
517 uint32_t devId = 0xffffff;
518 uint32_t level = 0x7FFFFFFF;
519 ret = HdiDisplay::GetDisplayBacklight(devId, level);
520 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
521 }
522
523
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_007)524 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_007)
525 {
526 uint32_t devId = 0xffffff;
527 uint32_t id = 0;
528 uint64_t value = 1000;
529 ret = HdiDisplay::SetDisplayProperty(devId, id, value);
530 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
531 }
532
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_008)533 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_008)
534 {
535 uint32_t devId = 0xffffff;
536 ret = HdiDisplay::DestroyVirtualDisplay(devId);
537 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
538 }
539
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_009)540 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_009)
541 {
542 uint32_t devId = 0xffffff;
543 DispPowerStatus status = DispPowerStatus::POWER_STATUS_OFF;
544 ret = HdiDisplay::GetDisplayPowerStatus(devId, status);
545 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
546 }
547
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_010)548 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_010)
549 {
550 uint32_t devId = 0xffffff;
551 uint32_t id = 0;
552 uint64_t value = 1000;
553 ret = HdiDisplay::GetDisplayProperty(devId, id, value);
554 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
555 }
556
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_011)557 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_011)
558 {
559 uint32_t devId = 0;
560 uint32_t fence = -1;
561 ret = HdiDisplay::SetVirtualDisplayBuffer(devId, 0, fence);
562 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
563 }
564
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_012)565 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_012)
566 {
567 uint32_t devId = 0xffffff;
568 uint32_t layerId = 0x7FFFFFFF;
569 ret = HdiDisplay::DestroyLayer(devId, layerId);
570 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
571 }
572
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_013)573 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_013)
574 {
575 uint32_t request = 0xffffff;
576 ret = HdiDisplay::InitCmdRequest(request);
577 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
578 }
579
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_014)580 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_014)
581 {
582 uint32_t width = 1080;
583 uint32_t height = 1080;
584 uint32_t format = PIXEL_FMT_YCRCB_422_P;
585 uint32_t devId = 0x7FFFFFFF;
586 ret = HdiDisplay::CreateVirtualDisplay(width, height, format, devId);
587 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
588 }
589
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_015)590 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_015)
591 {
592 uint32_t inEleCnt = 0xffffff;
593 uint32_t inFds = 0x7FFFFFFF;
594 uint32_t outEleCnt = 0x7FFFFFFF;
595 ret = HdiDisplay::CmdRequest(inEleCnt, inFds, outEleCnt);
596 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
597 }
598
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_016)599 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_016)
600 {
601 uint32_t inEleCnt = 0xffffff;
602 uint32_t inFds = 0xffffff;
603 uint32_t outEleCnt = 0xffffff;
604 ret = HdiDisplay::CmdRequest(inEleCnt, inFds, outEleCnt);
605 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
606 }
607
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_017)608 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_017)
609 {
610 uint32_t reply = 0xffffff;
611 ret = HdiDisplay::GetCmdReply(reply);
612 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
613 }
614
TEST_F(HdiDisplayTest,SUB_DriverSystem_DisplayHdi_018)615 TEST_F(HdiDisplayTest, SUB_DriverSystem_DisplayHdi_018)
616 {
617 uint32_t devId = 0x7FFFFFFF;
618 uint32_t outputId = 0xffffff;
619 bool connected = 0x7FFFFFFF;
620 unsigned int sequence = 0;
621 uint64_t ns =0;
622 ret = DisplayRegisterCallbackBase::OnHotplugIn(outputId, connected);
623 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
624 ret = DisplayRegisterCallbackBase::OnHotplugIn(sequence, ns);
625 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
626 ret = DisplayRegisterCallbackBase::OnRefreshCallback(devId);
627 EXPECT_EQ(DISPLAY_NOT_SUPPORT, ret);
628 }
629 } // OHOS
630 } // HDI
631 } // DISPLAY
632 } // TEST