1 /*
2 * Copyright (c) 2022-2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include <gtest/gtest.h>
17 #include "dcamera_hdf_demo.h"
18 #include "distributed_hardware_log.h"
19
20 using namespace testing::ext;
21 using namespace OHOS::DistributedHardware;
22
23 auto mainDemo = std::make_shared<DcameraHdfDemo>();
24 int32_t cameraOk = 0;
25 int32_t sleepOk = 2;
26 int32_t camoreError = -1;
27
28 class DCameraAutomatTest : public testing::Test {
29 public:
30 static void SetUpTestCase(void);
31 static void TearDownTestCase(void);
32 void SetUp();
33 void TearDown();
34 DCameraAutomatTest();
35 };
SetUpTestCase(void)36 void DCameraAutomatTest::SetUpTestCase(void)
37 {
38 mainDemo->InitSensors();
39
40 int32_t ret = mainDemo->InitCameraDevice();
41 if (ret == camoreError) {
42 DHLOGI("main test: mainDemo->InitCameraDevice() error");
43 return;
44 }
45 mainDemo->SetEnableResult();
46 }
47
TearDownTestCase(void)48 void DCameraAutomatTest::TearDownTestCase(void)
49 {
50 PreviewOff(mainDemo);
51 mainDemo->QuitDemo();
52 }
SetUp(void)53 void DCameraAutomatTest::SetUp(void)
54 {
55 mainDemo->InitDemo();
56 }
TearDown(void)57 void DCameraAutomatTest::TearDown(void) {}
DCameraAutomatTest(void)58 DCameraAutomatTest::DCameraAutomatTest(void) {}
59
60 /**
61 * @tc.number : SUB_DH_Dcamera_DCTS_0100
62 * @tc.name :PreviewOn()
63 * @tc.desc : [STD-DISTRIBUTED-0101]禁止修改分布式相机交互协议
64 * @tc.desc : Invoke the preview stream to send the preview file back to the local end and save it to the local end
65 * @tc.type : FUNC
66 * @tc.size : Medium test
67 */
68 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_0100, TestSize.Level1)
69 {
70 int32_t ret = PreviewOn(0, mainDemo);
71 EXPECT_EQ(cameraOk, ret) << "PreviewOn fail";
72 sleep(sleepOk);
73 }
74
75 /**
76 * @tc.number : SUB_DH_Dcamera_DCTS_0100
77 * @tc.name : CaptureTest()
78 * @tc.desc : [STD-DISTRIBUTED-0101]禁止修改分布式相机交互协议
79 * @tc.desc : Take pictures with a remote camera and save them locally
80 * @tc.type : FUNC
81 * @tc.size : Medium test
82 */
83 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_0200, TestSize.Level1)
84 {
85 int32_t ret = CaptureTest(mainDemo);
86 EXPECT_EQ(cameraOk, ret) << "CaptureTest fail";
87 sleep(sleepOk);
88 }
89
90 /**
91 * @tc.number : SUB_DH_Dcamera_DCTS_0700
92 * @tc.name :VideoTest()
93 * @tc.desc : [STD-DISTRIBUTED-0101]禁止修改分布式相机交互协议
94 * @tc.desc : Record video with a remote camera and save the video locally
95 * @tc.type : FUNC
96 * @tc.size : Medium test
97 */
98 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_0300, TestSize.Level1)
99 {
100 int32_t ret = VideoTest(mainDemo);
101 EXPECT_EQ(cameraOk, ret) << "VideoTest fail";
102 sleep(sleepOk);
103 }
104
105 /**
106 * @tc.number : SUB_DH_Dcamera_DCTS_0200
107 * @tc.name : SetAwbMode()
108 * @tc.desc : [STD-DISTRIBUTED-0101]禁止修改分布式相机交互协议
109 * @tc.desc : Set Awb Mode is 0, success is returned
110 * @tc.type : FUNC
111 * @tc.size : Medium test
112 */
113 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_0400, TestSize.Level1)
114 {
115 int32_t ret = mainDemo->SetAwbMode(sleepOk);
116 EXPECT_EQ(cameraOk, ret) << "SetAwbMode incandescent fail";
117 sleep(sleepOk);
118 }
119
120 /**
121 * @tc.number : SUB_DH_Dcamera_DCTS_0300
122 * @tc.name : SetAwbMode()
123 * @tc.desc : [STD-DISTRIBUTED-0101]禁止修改分布式相机交互协议
124 * @tc.desc : the Set Awb Mode is 2, success is returned
125 * @tc.type : FUNC
126 * @tc.size : Medium test
127 */
128 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_0500, TestSize.Level1)
129 {
130 int32_t ret = mainDemo->SetAwbMode(cameraOk);
131 EXPECT_EQ(cameraOk, ret) << "SetAwbMode fail";
132 sleep(sleepOk);
133 }
134
135 /**
136 * @tc.number : SUB_DH_Dcamera_DCTS_0400
137 * @tc.name :mainDemo->SetAeExpo()
138 * @tc.desc : [STD-DISTRIBUTED-0101]禁止修改分布式相机交互协议
139 * @tc.desc : Set the exposure mode update parameters
140 * @tc.type : FUNC
141 * @tc.size : Medium test
142 */
143 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_0600, TestSize.Level1)
144 {
145 int32_t ret = mainDemo->SetAeExpo();
146 EXPECT_EQ(cameraOk, ret) << "SetAeExpo fail";
147 sleep(sleepOk);
148 }
149
150 /**
151 * @tc.number : SUB_DH_Dcamera_DCTS_0500
152 * @tc.name :mainDemo->SetMetadata()
153 * @tc.desc : [STD-DISTRIBUTED-0101]禁止修改分布式相机交互协议
154 * @tc.desc : Set the parameters required for taking pictures and recording videos
155 * @tc.type : FUNC
156 * @tc.size : Medium test
157 */
158 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_0700, TestSize.Level1)
159 {
160 int32_t ret = mainDemo->SetMetadata();
161 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
162 sleep(sleepOk);
163 }
164
165 /**
166 * @tc.number : SUB_DH_Dcamera_DCTS_0800
167 * @tc.name :FlashLightTest()
168 * @tc.desc : [STD-DISTRIBUTED-0101]禁止修改分布式相机交互协议
169 * @tc.desc : Turn off the preview stream, turn on the flashlight, init the camera device, and turn on the preview
170 * @tc.type : FUNC
171 * @tc.size : Medium test
172 */
173 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_0800, TestSize.Level1)
174 {
175 int32_t ret = FlashLightTest(mainDemo);
176 EXPECT_EQ(cameraOk, ret) << "FlashLightTest fail";
177 sleep(sleepOk);
178 }
179
180 /**
181 * @tc.number : SUB_DH_Dcamera_DCTS_0900
182 * @tc.name :OfflineTest()
183 * @tc.desc : [STD-DISTRIBUTED-0101]禁止修改分布式相机交互协议
184 * @tc.desc : Turn off Preview Turn on dual-stream offline mode delay 5 seconds after init the camera device
185 * @tc.type : FUNC
186 * @tc.size : Medium test
187 */
188 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_0900, TestSize.Level1)
189 {
190 int32_t ret = OfflineTest(mainDemo);
191 EXPECT_EQ(cameraOk, ret) << "OfflineTest fail";
192 }
193
194 /**
195 * @tc.number : SUB_DH_Dcamera_DCTS_1000
196 * @tc.name : Test whether preview and awb parameter Settings can be successful
197 * @tc.desc : Composite test function
198 * @tc.type : FUNC
199 * @tc.size : Medium test
200 */
201 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_1000, TestSize.Level1)
202 {
203 int32_t ret = PreviewOn(1, nullptr);
204 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
205 sleep(sleepOk);
206 ret = mainDemo->SetAwbMode(sleepOk);
207 EXPECT_EQ(cameraOk, ret) << "SetAwbMode incandescent fail";
208 sleep(sleepOk);
209 ret = mainDemo->SetAwbMode(cameraOk);
210 EXPECT_EQ(cameraOk, ret) << "SetAwbMode fail";
211 sleep(sleepOk);
212 }
213
214 /**
215 * @tc.number : SUB_DH_Dcamera_DCTS_1100
216 * @tc.name : Whether an error occurs when multiple methods are executed consecutively
217 * @tc.desc : Composite test function
218 * @tc.type : FUNC
219 * @tc.size : Medium test
220 */
221 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_1100, TestSize.Level1)
222 {
223 int32_t ret = mainDemo->SetAeExpo();
224 EXPECT_EQ(cameraOk, ret) << "SetAeExpo fail";
225 sleep(sleepOk);
226 ret = mainDemo->SetMetadata();
227 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
228 sleep(sleepOk);
229 ret = CaptureTest(nullptr);
230 EXPECT_NE(cameraOk, ret) << "CaptureTest fail";
231 sleep(sleepOk);
232 }
233
234 /**
235 * @tc.number : SUB_DH_Dcamera_DCTS_1200
236 * @tc.name : Whether an error occurs when multiple methods are executed consecutively
237 * @tc.desc : Composite test function
238 * @tc.type : FUNC
239 * @tc.size : Medium test
240 */
241 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_1200, TestSize.Level1)
242 {
243 int32_t ret = VideoTest(nullptr);
244 EXPECT_NE(cameraOk, ret) << "VideoTest fail";
245 sleep(sleepOk);
246 ret = FlashLightTest(nullptr);
247 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
248 sleep(sleepOk);
249 ret = OfflineTest(nullptr);
250 EXPECT_NE(cameraOk, ret) << "OfflineTest fail";
251 }
252
253 /**
254 * @tc.number : SUB_DH_Dcamera_DCTS_1300
255 * @tc.name : Scramble the method invocation order to see if the method invocation fails
256 * @tc.desc : Composite test function
257 * @tc.type : FUNC
258 * @tc.size : Medium test
259 */
260 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_1300, TestSize.Level1)
261 {
262 int32_t ret = PreviewOn(0, nullptr);
263 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
264 sleep(sleepOk);
265 ret = mainDemo->SetAwbMode(cameraOk);
266 EXPECT_EQ(cameraOk, ret) << "SetAwbMode fail";
267 sleep(sleepOk);
268 ret = mainDemo->SetAwbMode(sleepOk);
269 EXPECT_EQ(cameraOk, ret) << "SetAwbMode incandescent fail";
270 sleep(sleepOk);
271 }
272
273 /**
274 * @tc.number : SUB_DH_Dcamera_DCTS_1400
275 * @tc.name : Scramble the method invocation order to see if the method invocation fails
276 * @tc.desc : Composite test function
277 * @tc.type : FUNC
278 * @tc.size : Medium test
279 */
280 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_1400, TestSize.Level1)
281 {
282 int32_t ret = mainDemo->SetAeExpo();
283 EXPECT_EQ(cameraOk, ret) << "SetAeExpo fail";
284 sleep(sleepOk);
285 ret = CaptureTest(nullptr);
286 EXPECT_NE(cameraOk, ret) << "CaptureTest fail";
287 sleep(sleepOk);
288 ret = mainDemo->SetMetadata();
289 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
290 sleep(sleepOk);
291 }
292
293 /**
294 * @tc.number : SUB_DH_Dcamera_DCTS_1500
295 * @tc.name : Scramble the method invocation order to see if the method invocation fails
296 * @tc.desc : Composite test function
297 * @tc.type : FUNC
298 * @tc.size : Medium test
299 */
300 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_1500, TestSize.Level1)
301 {
302 int32_t ret = VideoTest(nullptr);
303 EXPECT_NE(cameraOk, ret) << "VideoTest fail";
304 sleep(sleepOk);
305 ret = OfflineTest(nullptr);
306 EXPECT_NE(cameraOk, ret) << "OfflineTest fail";
307 ret = FlashLightTest(nullptr);
308 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
309 sleep(sleepOk);
310 }
311
312 /**
313 * @tc.number : SUB_DH_Dcamera_DCTS_1600
314 * @tc.name : Scramble the method invocation order to see if the method invocation fails
315 * @tc.desc : Composite test function
316 * @tc.type : FUNC
317 * @tc.size : Medium test
318 */
319 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_1600, TestSize.Level1)
320 {
321 int32_t ret = mainDemo->SetAwbMode(sleepOk);
322 EXPECT_EQ(cameraOk, ret) << "SetAwbMode incandescent fail";
323 sleep(sleepOk);
324 ret = PreviewOn(0, nullptr);
325 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
326 sleep(sleepOk);
327 ret = mainDemo->SetAwbMode(cameraOk);
328 EXPECT_EQ(cameraOk, ret) << "SetAwbMode fail";
329 sleep(sleepOk);
330 }
331
332 /**
333 * @tc.number : SUB_DH_Dcamera_DCTS_1700
334 * @tc.name : Scramble the method invocation order to see if the method invocation fails
335 * @tc.desc : Composite test function
336 * @tc.type : FUNC
337 * @tc.size : Medium test
338 */
339 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_1700, TestSize.Level1)
340 {
341 int32_t ret = mainDemo->SetMetadata();
342 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
343 sleep(sleepOk);
344 ret = mainDemo->SetAeExpo();
345 EXPECT_EQ(cameraOk, ret) << "SetAeExpo fail";
346 sleep(sleepOk);
347 ret = CaptureTest(nullptr);
348 EXPECT_NE(cameraOk, ret) << "CaptureTest fail";
349 sleep(sleepOk);
350 }
351
352 /**
353 * @tc.number : SUB_DH_Dcamera_DCTS_1800
354 * @tc.name : Scramble the method invocation order to see if the method invocation fails
355 * @tc.desc : Composite test function
356 * @tc.type : FUNC
357 * @tc.size : Medium test
358 */
359 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_1800, TestSize.Level1)
360 {
361 int32_t ret = FlashLightTest(nullptr);
362 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
363 sleep(sleepOk);
364 ret = VideoTest(nullptr);
365 EXPECT_NE(cameraOk, ret) << "VideoTest fail";
366 sleep(sleepOk);
367 ret = OfflineTest(nullptr);
368 EXPECT_NE(cameraOk, ret) << "OfflineTest fail";
369 }
370
371 /**
372 * @tc.number : SUB_DH_Dcamera_DCTS_1900
373 * @tc.name : Scramble the method invocation order to see if the method invocation fails
374 * @tc.desc : Composite test function
375 * @tc.type : FUNC
376 * @tc.size : Medium test
377 */
378 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_1900, TestSize.Level1)
379 {
380 int32_t ret = mainDemo->SetAwbMode(cameraOk);
381 EXPECT_EQ(cameraOk, ret) << "SetAwbMode fail";
382 sleep(sleepOk);
383 ret = mainDemo->SetAwbMode(sleepOk);
384 EXPECT_EQ(cameraOk, ret) << "SetAwbMode incandescent fail";
385 sleep(sleepOk);
386 ret = PreviewOn(0, nullptr);
387 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
388 sleep(sleepOk);
389 }
390
391 /**
392 * @tc.number : SUB_DH_Dcamera_DCTS_2000
393 * @tc.name : Scramble the method invocation order to see if the method invocation fails
394 * @tc.desc : Composite test function
395 * @tc.type : FUNC
396 * @tc.size : Medium test
397 */
398 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_2000, TestSize.Level1)
399 {
400 int32_t ret = CaptureTest(nullptr);
401 EXPECT_NE(cameraOk, ret) << "CaptureTest fail";
402 sleep(sleepOk);
403 ret = mainDemo->SetMetadata();
404 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
405 sleep(sleepOk);
406 ret = mainDemo->SetAeExpo();
407 EXPECT_EQ(cameraOk, ret) << "SetAeExpo fail";
408 sleep(sleepOk);
409 }
410
411 /**
412 * @tc.number : SUB_DH_Dcamera_DCTS_2100
413 * @tc.name : Scramble the method invocation order to see if the method invocation fails
414 * @tc.desc : Composite test function
415 * @tc.type : FUNC
416 * @tc.size : Medium test
417 */
418 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_2100, TestSize.Level1)
419 {
420 int32_t ret = OfflineTest(nullptr);
421 EXPECT_NE(cameraOk, ret) << "OfflineTest fail";
422 ret = FlashLightTest(nullptr);
423 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
424 sleep(sleepOk);
425 ret = VideoTest(nullptr);
426 EXPECT_NE(cameraOk, ret) << "VideoTest fail";
427 sleep(sleepOk);
428 }
429
430 /**
431 * @tc.number : SUB_DH_Dcamera_DCTS_2200
432 * @tc.name : Scramble the method invocation order to see if the method invocation fails
433 * @tc.desc : Composite test function
434 * @tc.type : FUNC
435 * @tc.size : Medium test
436 */
437 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_2200, TestSize.Level1)
438 {
439 int32_t ret = mainDemo->SetAeExpo();
440 EXPECT_EQ(cameraOk, ret) << "SetAeExpo fail";
441 sleep(sleepOk);
442 ret = mainDemo->SetMetadata();
443 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
444 sleep(sleepOk);
445 ret = CaptureTest(nullptr);
446 EXPECT_NE(cameraOk, ret) << "CaptureTest fail";
447 sleep(sleepOk);
448 }
449
450 /**
451 * @tc.number : SUB_DH_Dcamera_DCTS_2300
452 * @tc.name : Scramble the method invocation order to see if the method invocation fails
453 * @tc.desc : Composite test function
454 * @tc.type : FUNC
455 * @tc.size : Medium test
456 */
457 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_2300, TestSize.Level1)
458 {
459 int32_t ret = PreviewOn(0, nullptr);
460 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
461 sleep(sleepOk);
462 ret = mainDemo->SetAwbMode(sleepOk);
463 EXPECT_EQ(cameraOk, ret) << "SetAwbMode incandescent fail";
464 sleep(sleepOk);
465 ret = mainDemo->SetAwbMode(cameraOk);
466 EXPECT_EQ(cameraOk, ret) << "SetAwbMode fail";
467 sleep(sleepOk);
468 }
469
470 /**
471 * @tc.number : SUB_DH_Dcamera_DCTS_2400
472 * @tc.name : Scramble the method invocation order to see if the method invocation fails
473 * @tc.desc : Composite test function
474 * @tc.type : FUNC
475 * @tc.size : Medium test
476 */
477 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_2400, TestSize.Level1)
478 {
479 int32_t ret = VideoTest(nullptr);
480 EXPECT_NE(cameraOk, ret) << "VideoTest fail";
481 sleep(sleepOk);
482 ret = FlashLightTest(nullptr);
483 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
484 sleep(sleepOk);
485 ret = OfflineTest(nullptr);
486 EXPECT_NE(cameraOk, ret) << "OfflineTest fail";
487 }
488
489 /**
490 * @tc.number : SUB_DH_Dcamera_DCTS_2500
491 * @tc.name : Scramble the method invocation order to see if the method invocation fails
492 * @tc.desc : Composite test function
493 * @tc.type : FUNC
494 * @tc.size : Medium test
495 */
496 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_2500, TestSize.Level1)
497 {
498 int32_t ret = VideoTest(nullptr);
499 EXPECT_NE(cameraOk, ret) << "VideoTest fail";
500 sleep(sleepOk);
501 ret = FlashLightTest(nullptr);
502 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
503 sleep(sleepOk);
504 ret = OfflineTest(nullptr);
505 EXPECT_NE(cameraOk, ret) << "OfflineTest fail";
506 }
507
508 /**
509 * @tc.number : SUB_DH_Dcamera_DCTS_2600
510 * @tc.name : Scramble the method invocation order to see if the method invocation fails
511 * @tc.desc : Composite test function
512 * @tc.type : FUNC
513 * @tc.size : Medium test
514 */
515 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_2600, TestSize.Level1)
516 {
517 int32_t ret = PreviewOn(0, nullptr);
518 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
519 sleep(sleepOk);
520 ret = mainDemo->SetAwbMode(sleepOk);
521 EXPECT_EQ(cameraOk, ret) << "SetAwbMode incandescent fail";
522 sleep(sleepOk);
523 ret = mainDemo->SetAwbMode(cameraOk);
524 EXPECT_EQ(cameraOk, ret) << "SetAwbMode fail";
525 sleep(sleepOk);
526 }
527
528 /**
529 * @tc.number : SUB_DH_Dcamera_DCTS_2700
530 * @tc.name : Scramble the method invocation order to see if the method invocation fails
531 * @tc.desc : Composite test function
532 * @tc.type : FUNC
533 * @tc.size : Medium test
534 */
535 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_2700, TestSize.Level1)
536 {
537 int32_t ret = mainDemo->SetAeExpo();
538 EXPECT_EQ(cameraOk, ret) << "SetAeExpo fail";
539 sleep(sleepOk);
540 ret = mainDemo->SetMetadata();
541 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
542 sleep(sleepOk);
543 ret = CaptureTest(nullptr);
544 EXPECT_NE(cameraOk, ret) << "CaptureTest fail";
545 sleep(sleepOk);
546 }
547
548 /**
549 * @tc.number : SUB_DH_Dcamera_DCTS_2800
550 * @tc.name : Scramble the method invocation order to see if the method invocation fails
551 * @tc.desc : Composite test function
552 * @tc.type : FUNC
553 * @tc.size : Medium test
554 */
555 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_2800, TestSize.Level1)
556 {
557 int32_t ret = VideoTest(nullptr);
558 EXPECT_NE(cameraOk, ret) << "VideoTest fail";
559 sleep(sleepOk);
560 ret = OfflineTest(nullptr);
561 EXPECT_NE(cameraOk, ret) << "OfflineTest fail";
562 ret = FlashLightTest(nullptr);
563 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
564 sleep(sleepOk);
565 }
566
567 /**
568 * @tc.number : SUB_DH_Dcamera_DCTS_2900
569 * @tc.name : Scramble the method invocation order to see if the method invocation fails
570 * @tc.desc : Composite test function
571 * @tc.type : FUNC
572 * @tc.size : Medium test
573 */
574 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_2900, TestSize.Level1)
575 {
576 int32_t ret = PreviewOn(0, nullptr);
577 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
578 sleep(sleepOk);
579 ret = mainDemo->SetAwbMode(cameraOk);
580 EXPECT_EQ(cameraOk, ret) << "SetAwbMode fail";
581 sleep(sleepOk);
582 ret = mainDemo->SetAwbMode(sleepOk);
583 EXPECT_EQ(cameraOk, ret) << "SetAwbMode incandescent fail";
584 sleep(sleepOk);
585 }
586
587 /**
588 * @tc.number : SUB_DH_Dcamera_DCTS_3000
589 * @tc.name : Scramble the method invocation order to see if the method invocation fails
590 * @tc.desc : Composite test function
591 * @tc.type : FUNC
592 * @tc.size : Medium test
593 */
594 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_3000, TestSize.Level1)
595 {
596 int32_t ret = mainDemo->SetAeExpo();
597 EXPECT_EQ(cameraOk, ret) << "SetAeExpo fail";
598 sleep(sleepOk);
599 ret = CaptureTest(nullptr);
600 EXPECT_NE(cameraOk, ret) << "CaptureTest fail";
601 sleep(sleepOk);
602 ret = mainDemo->SetMetadata();
603 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
604 sleep(sleepOk);
605 }
606
607 /**
608 * @tc.number : SUB_DH_Dcamera_DCTS_3100
609 * @tc.name : Preview method Enter error parameters to see the return value
610 * @tc.desc : Test preview exception
611 * @tc.type : FUNC
612 * @tc.size : Medium test
613 */
614 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_3100, TestSize.Level1)
615 {
616 int32_t ret = PreviewOn(1, mainDemo);
617 DHLOGI("SUB_DH_Dcamera_DCTS_3100 = %{public}d", ret);
618 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
619 sleep(sleepOk);
620 }
621
622 /**
623 * @tc.number : SUB_DH_Dcamera_DCTS_3200
624 * @tc.name : Preview method Enter error parameters to see the return value
625 * @tc.desc : Test preview exception
626 * @tc.type : FUNC
627 * @tc.size : Medium test
628 */
629 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_3200, TestSize.Level1)
630 {
631 int32_t ret = PreviewOn(1, nullptr);
632 DHLOGI("SUB_DH_Dcamera_DCTS_3200 = %{public}d", ret);
633 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
634 sleep(sleepOk);
635 }
636
637 /**
638 * @tc.number : SUB_DH_Dcamera_DCTS_3300
639 * @tc.name : Preview method Enter error parameters to see the return value
640 * @tc.desc : Test preview exception
641 * @tc.type : FUNC
642 * @tc.size : Medium test
643 */
644 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_3300, TestSize.Level1)
645 {
646 int32_t ret = PreviewOn(0, nullptr);
647 DHLOGI("SUB_DH_Dcamera_DCTS_3300 = %{public}d", ret);
648 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
649 sleep(sleepOk);
650 }
651
652 /**
653 * @tc.number : SUB_DH_Dcamera_DCTS_3400
654 * @tc.name : Preview method Enter error parameters to see the return value
655 * @tc.desc : Test preview exception
656 * @tc.type : FUNC
657 * @tc.size : Medium test
658 */
659 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_3400, TestSize.Level1)
660 {
661 int32_t ret = PreviewOn(-1, mainDemo);
662 DHLOGI("SUB_DH_Dcamera_DCTS_3400 = %{public}d", ret);
663 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
664 sleep(sleepOk);
665 }
666
667 /**
668 * @tc.number : SUB_DH_Dcamera_DCTS_3500
669 * @tc.name : Set the wrong awb mode to view the return result
670 * @tc.desc : Test SetAwbMode exception
671 * @tc.type : FUNC
672 * @tc.size : Medium test
673 */
674 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_3500, TestSize.Level1)
675 {
676 int32_t ret = mainDemo->SetAwbMode(5);
677 DHLOGI("SUB_DH_Dcamera_DCTS_3500 = %{public}d", ret);
678 EXPECT_NE(cameraOk, ret) << "SetAwbMode incandescent fail";
679 sleep(sleepOk);
680 }
681
682 /**
683 * @tc.number : SUB_DH_Dcamera_DCTS_3600
684 * @tc.name : Set the wrong awb mode to view the return result
685 * @tc.desc : Test SetAwbMode exception
686 * @tc.type : FUNC
687 * @tc.size : Medium test
688 */
689 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_3600, TestSize.Level1)
690 {
691 int32_t ret = mainDemo->SetAwbMode(camoreError);
692 DHLOGI("SUB_DH_Dcamera_DCTS_3600 = %{public}d", ret);
693 EXPECT_NE(cameraOk, ret) << "SetAwbMode incandescent fail";
694 sleep(sleepOk);
695 }
696
697 /**
698 * @tc.number : SUB_DH_Dcamera_DCTS_3700
699 * @tc.name : awb mode input error parameters when calling the SetAeExpo method to see the results
700 * @tc.desc : Test SetAwbMode,SetAeExpo exception
701 * @tc.type : FUNC
702 * @tc.size : Medium test
703 */
704 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_3700, TestSize.Level1)
705 {
706 int32_t ret = mainDemo->SetAwbMode(camoreError);
707 DHLOGI("SUB_DH_Dcamera_DCTS_3700 = %{public}d", ret);
708 EXPECT_NE(cameraOk, ret) << "SetAwbMode incandescent fail";
709 sleep(sleepOk);
710 ret = mainDemo->SetAeExpo();
711 DHLOGI("SUB_DH_Dcamera_DCTS_3701 = %{public}d", ret);
712 EXPECT_EQ(cameraOk, ret) << "SetAeExpo fail";
713 sleep(sleepOk);
714 }
715
716 /**
717 * @tc.number : SUB_DH_Dcamera_DCTS_3800
718 * @tc.name : awb mode input error parameters when calling the SetAeExpo method to see the results
719 * @tc.desc : Test SetAwbMode,SetAeExpo exception
720 * @tc.type : FUNC
721 * @tc.size : Medium test
722 */
723 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_3800, TestSize.Level1)
724 {
725 int32_t ret = mainDemo->SetAwbMode(camoreError);
726 DHLOGI("SUB_DH_Dcamera_DCTS_3800 = %{public}d", ret);
727 EXPECT_NE(cameraOk, ret) << "SetAwbMode incandescent fail";
728 sleep(sleepOk);
729 ret = mainDemo->SetMetadata();
730 DHLOGI("SUB_DH_Dcamera_DCTS_3801 = %{public}d", ret);
731 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
732 sleep(sleepOk);
733 }
734
735 /**
736 * @tc.number : SUB_DH_Dcamera_DCTS_3900
737 * @tc.name : CaptureTest Enter a null value to view the return result
738 * @tc.desc : Test exception
739 * @tc.type : FUNC
740 * @tc.size : Medium test
741 */
742 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_3900, TestSize.Level1)
743 {
744 int32_t ret = CaptureTest(nullptr);
745 DHLOGI("SUB_DH_Dcamera_DCTS_3900 = %{public}d", ret);
746 EXPECT_NE(cameraOk, ret) << "CaptureTest fail";
747 sleep(sleepOk);
748 }
749
750 /**
751 * @tc.number : SUB_DH_Dcamera_DCTS_4000
752 * @tc.name : VideoTest Enter a null value to view the return result
753 * @tc.desc : Test exception
754 * @tc.type : FUNC
755 * @tc.size : Medium test
756 */
757 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_4000, TestSize.Level1)
758 {
759 int32_t ret = VideoTest(nullptr);
760 DHLOGI("SUB_DH_Dcamera_DCTS_4000 = %{public}d", ret);
761 EXPECT_NE(cameraOk, ret) << "VideoTest fail";
762 sleep(sleepOk);
763 }
764
765 /**
766 * @tc.number : SUB_DH_Dcamera_DCTS_4100
767 * @tc.name : FlashLightTest Enter a null value to view the return result
768 * @tc.desc : Test exception
769 * @tc.type : FUNC
770 * @tc.size : Medium test
771 */
772 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_4100, TestSize.Level1)
773 {
774 int32_t ret = FlashLightTest(nullptr);
775 DHLOGI("SUB_DH_Dcamera_DCTS_4100 = %{public}d", ret);
776 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
777 sleep(sleepOk);
778 }
779
780 /**
781 * @tc.number : SUB_DH_Dcamera_DCTS_4200
782 * @tc.name : OfflineTest Enter a null value to view the return result
783 * @tc.desc : Test exception
784 * @tc.type : FUNC
785 * @tc.size : Medium test
786 */
787 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_4200, TestSize.Level1)
788 {
789 int32_t ret = OfflineTest(nullptr);
790 DHLOGI("SUB_DH_Dcamera_DCTS_4200 = %{public}d", ret);
791 EXPECT_NE(cameraOk, ret) << "OfflineTest fail";
792 sleep(sleepOk);
793 }
794
795 /**
796 * @tc.number : SUB_DH_Dcamera_DCTS_4300
797 * @tc.name : Perform a combination test for different method exceptions and check the return result
798 * @tc.desc : Test exception
799 * @tc.type : FUNC
800 * @tc.size : Medium test
801 */
802 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_4300, TestSize.Level1)
803 {
804 int32_t ret = PreviewOn(1, nullptr);
805 DHLOGI("SUB_DH_Dcamera_DCTS_4300 = %{public}d", ret);
806 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
807 sleep(sleepOk);
808 ret = mainDemo->SetAwbMode(5);
809 DHLOGI("SUB_DH_Dcamera_DCTS_4301 = %{public}d", ret);
810 EXPECT_NE(cameraOk, ret) << "SetAwbMode incandescent fail";
811 sleep(sleepOk);
812 }
813
814 /**
815 * @tc.number : SUB_DH_Dcamera_DCTS_4400
816 * @tc.name : Perform a combination test for different method exceptions and check the return result
817 * @tc.desc : Test exception
818 * @tc.type : FUNC
819 * @tc.size : Medium test
820 */
821 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_4400, TestSize.Level1)
822 {
823 int32_t ret = PreviewOn(1, nullptr);
824 DHLOGI("SUB_DH_Dcamera_DCTS_4400 = %{public}d", ret);
825 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
826 sleep(sleepOk);
827 ret = mainDemo->SetAwbMode(camoreError);
828 DHLOGI("SUB_DH_Dcamera_DCTS_4401 = %{public}d", ret);
829 EXPECT_NE(cameraOk, ret) << "SetAwbMode incandescent fail";
830 sleep(sleepOk);
831 }
832
833 /**
834 * @tc.number : SUB_DH_Dcamera_DCTS_4500
835 * @tc.name : Perform a combination test for different method exceptions and check the return result
836 * @tc.desc : Test exception
837 * @tc.type : FUNC
838 * @tc.size : Medium test
839 */
840 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_4500, TestSize.Level1)
841 {
842 int32_t ret = PreviewOn(1, nullptr);
843 DHLOGI("SUB_DH_Dcamera_DCTS_4500 = %{public}d", ret);
844 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
845 sleep(sleepOk);
846 ret = CaptureTest(nullptr);
847 DHLOGI("SUB_DH_Dcamera_DCTS_4501 = %{public}d", ret);
848 EXPECT_NE(cameraOk, ret) << "CaptureTest fail";
849 sleep(sleepOk);
850 }
851
852 /**
853 * @tc.number : SUB_DH_Dcamera_DCTS_4600
854 * @tc.name : Perform a combination test for different method exceptions and check the return result
855 * @tc.desc : Test exception
856 * @tc.type : FUNC
857 * @tc.size : Medium test
858 */
859 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_4600, TestSize.Level1)
860 {
861 int32_t ret = PreviewOn(1, nullptr);
862 DHLOGI("SUB_DH_Dcamera_DCTS_4600 = %{public}d", ret);
863 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
864 sleep(sleepOk);
865 ret = VideoTest(nullptr);
866 DHLOGI("SUB_DH_Dcamera_DCTS_4601 = %{public}d", ret);
867 EXPECT_NE(cameraOk, ret) << "VideoTest fail";
868 sleep(sleepOk);
869 }
870
871 /**
872 * @tc.number : SUB_DH_Dcamera_DCTS_4700
873 * @tc.name : Perform a combination test for different method exceptions and check the return result
874 * @tc.desc : Test exception
875 * @tc.type : FUNC
876 * @tc.size : Medium test
877 */
878 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_4700, TestSize.Level1)
879 {
880 int32_t ret = PreviewOn(1, nullptr);
881 DHLOGI("SUB_DH_Dcamera_DCTS_4700 = %{public}d", ret);
882 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
883 sleep(sleepOk);
884 ret = PreviewOn(0, nullptr);
885 DHLOGI("SUB_DH_Dcamera_DCTS_4701 = %{public}d", ret);
886 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
887 sleep(sleepOk);
888 }
889
890 /**
891 * @tc.number : SUB_DH_Dcamera_DCTS_4800
892 * @tc.name : Perform a combination test for different method exceptions and check the return result
893 * @tc.desc : Test exception
894 * @tc.type : FUNC
895 * @tc.size : Medium test
896 */
897 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_4800, TestSize.Level1)
898 {
899 int32_t ret = PreviewOn(1, nullptr);
900 DHLOGI("SUB_DH_Dcamera_DCTS_4800 = %{public}d", ret);
901 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
902 sleep(sleepOk);
903 ret = FlashLightTest(nullptr);
904 DHLOGI("SUB_DH_Dcamera_DCTS_4801 = %{public}d", ret);
905 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
906 sleep(sleepOk);
907 }
908
909 /**
910 * @tc.number : SUB_DH_Dcamera_DCTS_4900
911 * @tc.name : Perform a combination test for different method exceptions and check the return result
912 * @tc.desc : Test exception
913 * @tc.type : FUNC
914 * @tc.size : Medium test
915 */
916 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_4900, TestSize.Level1)
917 {
918 int32_t ret = PreviewOn(1, nullptr);
919 DHLOGI("SUB_DH_Dcamera_DCTS_4900 = %{public}d", ret);
920 EXPECT_NE(cameraOk, ret) << "PreviewOn fail";
921 sleep(sleepOk);
922 ret = OfflineTest(nullptr);
923 DHLOGI("SUB_DH_Dcamera_DCTS_4901 = %{public}d", ret);
924 EXPECT_NE(cameraOk, ret) << "OfflineTest fail";
925 sleep(sleepOk);
926 }
927
928 /**
929 * @tc.number : SUB_DH_Dcamera_DCTS_5000
930 * @tc.name : Perform a combination test for different method exceptions and check the return result
931 * @tc.desc : Test exception
932 * @tc.type : FUNC
933 * @tc.size : Medium test
934 */
935 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_5000, TestSize.Level1)
936 {
937 int32_t ret = mainDemo->SetAwbMode(camoreError);
938 DHLOGI("SUB_DH_Dcamera_DCTS_5000 = %{public}d", ret);
939 EXPECT_NE(cameraOk, ret) << "SetAwbMode incandescent fail";
940 sleep(sleepOk);
941 ret = CaptureTest(nullptr);
942 DHLOGI("SUB_DH_Dcamera_DCTS_5001 = %{public}d", ret);
943 EXPECT_NE(cameraOk, ret) << "CaptureTest fail";
944 sleep(sleepOk);
945 }
946
947 /**
948 * @tc.number : SUB_DH_Dcamera_DCTS_5100
949 * @tc.name : Perform a combination test for different method exceptions and check the return result
950 * @tc.desc : Test exception
951 * @tc.type : FUNC
952 * @tc.size : Medium test
953 */
954 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_5100, TestSize.Level1)
955 {
956 int32_t ret = mainDemo->SetAwbMode(camoreError);
957 DHLOGI("SUB_DH_Dcamera_DCTS_5100 = %{public}d", ret);
958 EXPECT_NE(cameraOk, ret) << "SetAwbMode incandescent fail";
959 sleep(sleepOk);
960 ret = VideoTest(nullptr);
961 DHLOGI("SUB_DH_Dcamera_DCTS_5101 = %{public}d", ret);
962 EXPECT_NE(cameraOk, ret) << "VideoTest fail";
963 sleep(sleepOk);
964 }
965
966 /**
967 * @tc.number : SUB_DH_Dcamera_DCTS_5200
968 * @tc.name : Perform a combination test for different method exceptions and check the return result
969 * @tc.desc : Test exception
970 * @tc.type : FUNC
971 * @tc.size : Medium test
972 */
973 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_5200, TestSize.Level1)
974 {
975 int32_t ret = mainDemo->SetAwbMode(camoreError);
976 DHLOGI("SUB_DH_Dcamera_DCTS_5200 = %{public}d", ret);
977 EXPECT_NE(cameraOk, ret) << "SetAwbMode incandescent fail";
978 sleep(sleepOk);
979 ret = FlashLightTest(nullptr);
980 DHLOGI("SUB_DH_Dcamera_DCTS_5201 = %{public}d", ret);
981 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
982 sleep(sleepOk);
983 }
984
985 /**
986 * @tc.number : SUB_DH_Dcamera_DCTS_5300
987 * @tc.name : Perform a combination test for different method exceptions and check the return result
988 * @tc.desc : Test exception
989 * @tc.type : FUNC
990 * @tc.size : Medium test
991 */
992 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_5300, TestSize.Level1)
993 {
994 int32_t ret = mainDemo->SetAwbMode(camoreError);
995 DHLOGI("SUB_DH_Dcamera_DCTS_5300 = %{public}d", ret);
996 EXPECT_NE(cameraOk, ret) << "SetAwbMode incandescent fail";
997 sleep(sleepOk);
998 ret = OfflineTest(nullptr);
999 DHLOGI("SUB_DH_Dcamera_DCTS_5301 = %{public}d", ret);
1000 EXPECT_NE(cameraOk, ret) << "OfflineTest fail";
1001 sleep(sleepOk);
1002 }
1003
1004 /**
1005 * @tc.number : SUB_DH_Dcamera_DCTS_5400
1006 * @tc.name : Perform a combination test for different method exceptions and check the return result
1007 * @tc.desc : Test exception
1008 * @tc.type : FUNC
1009 * @tc.size : Medium test
1010 */
1011 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_5400, TestSize.Level1)
1012 {
1013 int32_t ret = CaptureTest(nullptr);
1014 DHLOGI("SUB_DH_Dcamera_DCTS_5400 = %{public}d", ret);
1015 EXPECT_NE(cameraOk, ret) << "CaptureTest fail";
1016 sleep(sleepOk);
1017 ret = VideoTest(nullptr);
1018 DHLOGI("SUB_DH_Dcamera_DCTS_5401 = %{public}d", ret);
1019 EXPECT_NE(cameraOk, ret) << "VideoTest fail";
1020 sleep(sleepOk);
1021 }
1022
1023 /**
1024 * @tc.number : SUB_DH_Dcamera_DCTS_5500
1025 * @tc.name : Perform a combination test for different method exceptions and check the return result
1026 * @tc.desc : Test exception
1027 * @tc.type : FUNC
1028 * @tc.size : Medium test
1029 */
1030 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_5500, TestSize.Level1)
1031 {
1032 int32_t ret = CaptureTest(nullptr);
1033 DHLOGI("SUB_DH_Dcamera_DCTS_5500 = %{public}d", ret);
1034 EXPECT_NE(cameraOk, ret) << "CaptureTest fail";
1035 sleep(sleepOk);
1036 ret = FlashLightTest(nullptr);
1037 DHLOGI("SUB_DH_Dcamera_DCTS_5501 = %{public}d", ret);
1038 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
1039 sleep(sleepOk);
1040 }
1041
1042 /**
1043 * @tc.number : SUB_DH_Dcamera_DCTS_5600
1044 * @tc.name : Perform a combination test for different method exceptions and check the return result
1045 * @tc.desc : Test exception
1046 * @tc.type : FUNC
1047 * @tc.size : Medium test
1048 */
1049 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_5600, TestSize.Level1)
1050 {
1051 int32_t ret = CaptureTest(nullptr);
1052 DHLOGI("SUB_DH_Dcamera_DCTS_5600 = %{public}d", ret);
1053 EXPECT_NE(cameraOk, ret) << "CaptureTest fail";
1054 sleep(sleepOk);
1055 ret = OfflineTest(nullptr);
1056 DHLOGI("SUB_DH_Dcamera_DCTS_5601 = %{public}d", ret);
1057 EXPECT_NE(cameraOk, ret) << "OfflineTest fail";
1058 sleep(sleepOk);
1059 }
1060
1061 /**
1062 * @tc.number : SUB_DH_Dcamera_DCTS_5700
1063 * @tc.name : Perform a combination test for different method exceptions and check the return result
1064 * @tc.desc : Test exception
1065 * @tc.type : FUNC
1066 * @tc.size : Medium test
1067 */
1068 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_5700, TestSize.Level1)
1069 {
1070 int32_t ret = VideoTest(nullptr);
1071 DHLOGI("SUB_DH_Dcamera_DCTS_5700 = %{public}d", ret);
1072 EXPECT_NE(cameraOk, ret) << "VideoTest fail";
1073 sleep(sleepOk);
1074 ret = FlashLightTest(nullptr);
1075 DHLOGI("SUB_DH_Dcamera_DCTS_5701 = %{public}d", ret);
1076 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
1077 sleep(sleepOk);
1078 }
1079
1080 /**
1081 * @tc.number : SUB_DH_Dcamera_DCTS_5800
1082 * @tc.name : Perform a combination test for different method exceptions and check the return result
1083 * @tc.desc : Test exception
1084 * @tc.type : FUNC
1085 * @tc.size : Medium test
1086 */
1087 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_5800, TestSize.Level1)
1088 {
1089 int32_t ret = VideoTest(nullptr);
1090 DHLOGI("SUB_DH_Dcamera_DCTS_5800 = %{public}d", ret);
1091 EXPECT_NE(cameraOk, ret) << "VideoTest fail";
1092 sleep(sleepOk);
1093 ret = OfflineTest(nullptr);
1094 DHLOGI("SUB_DH_Dcamera_DCTS_5801 = %{public}d", ret);
1095 EXPECT_NE(cameraOk, ret) << "OfflineTest fail";
1096 sleep(sleepOk);
1097 }
1098
1099 /**
1100 * @tc.number : SUB_DH_Dcamera_DCTS_5900
1101 * @tc.name : Perform a combination test for different method exceptions and check the return result
1102 * @tc.desc : Test exception
1103 * @tc.type : FUNC
1104 * @tc.size : Medium test
1105 */
1106 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_5900, TestSize.Level1)
1107 {
1108 int32_t ret = FlashLightTest(nullptr);
1109 DHLOGI("SUB_DH_Dcamera_DCTS_5900 = %{public}d", ret);
1110 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
1111 sleep(sleepOk);
1112 ret = OfflineTest(nullptr);
1113 DHLOGI("SUB_DH_Dcamera_DCTS_5901 = %{public}d", ret);
1114 EXPECT_NE(cameraOk, ret) << "OfflineTest fail";
1115 sleep(sleepOk);
1116 }
1117
1118 /**
1119 * @tc.number : SUB_DH_Dcamera_DCTS_6000
1120 * @tc.name : Perform a combination test for different method exceptions and check the return result
1121 * @tc.desc : Test exception
1122 * @tc.type : FUNC
1123 * @tc.size : Medium test
1124 */
1125 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_6000, TestSize.Level1)
1126 {
1127 int32_t ret = FlashLightTest(nullptr);
1128 DHLOGI("SUB_DH_Dcamera_DCTS_6000 = %{public}d", ret);
1129 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
1130 sleep(sleepOk);
1131 ret = FlashLightTest(nullptr);
1132 DHLOGI("SUB_DH_Dcamera_DCTS_6001 = %{public}d", ret);
1133 EXPECT_NE(cameraOk, ret) << "FlashLightTest fail";
1134 sleep(sleepOk);
1135 }
1136
1137 /**
1138 * @tc.number : SUB_DH_Dcamera_DCTS_6100
1139 * @tc.name :mainDemo->SetMetadata()
1140 * @tc.desc : Set the parameters required for taking pictures and recording videos
1141 * @tc.type : FUNC
1142 * @tc.size : Medium test
1143 */
1144 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_6100, TestSize.Level1)
1145 {
1146 uint8_t mode = OHOS_CAMERA_EXPOSURE_MODE_MANUAL;
1147 int32_t ret = mainDemo->SetMetadataAe(mode);
1148 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1149 sleep(sleepOk);
1150 }
1151
1152 /**
1153 * @tc.number : SUB_DH_Dcamera_DCTS_6200
1154 * @tc.name :mainDemo->SetMetadata()
1155 * @tc.desc : Set the parameters required for taking pictures and recording videos
1156 * @tc.type : FUNC
1157 * @tc.size : Medium test
1158 */
1159 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_6200, TestSize.Level1)
1160 {
1161 uint8_t mode = OHOS_CAMERA_EXPOSURE_MODE_LOCKED;
1162 int32_t ret = mainDemo->SetMetadataAe(mode);
1163 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1164 sleep(sleepOk);
1165 }
1166
1167 /**
1168 * @tc.number : SUB_DH_Dcamera_DCTS_6300
1169 * @tc.name :mainDemo->SetMetadata()
1170 * @tc.desc : Set the parameters required for taking pictures and recording videos
1171 * @tc.type : FUNC
1172 * @tc.size : Medium test
1173 */
1174 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_6300, TestSize.Level1)
1175 {
1176 uint8_t mode = OHOS_CAMERA_EXPOSURE_MODE_AUTO;
1177 int32_t ret = mainDemo->SetMetadataAe(mode);
1178 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1179 sleep(sleepOk);
1180 }
1181
1182 /**
1183 * @tc.number : SUB_DH_Dcamera_DCTS_6400
1184 * @tc.name :mainDemo->SetMetadata()
1185 * @tc.desc : Set the parameters required for taking pictures and recording videos
1186 * @tc.type : FUNC
1187 * @tc.size : Medium test
1188 */
1189 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_6400, TestSize.Level1)
1190 {
1191 uint8_t mode = OHOS_CAMERA_SPOT_METERING;
1192 int32_t ret = mainDemo->SetMetadataMeter(mode);
1193 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1194 sleep(sleepOk);
1195 }
1196
1197 /**
1198 * @tc.number : SUB_DH_Dcamera_DCTS_6500
1199 * @tc.name :mainDemo->SetMetadata()
1200 * @tc.desc : Set the parameters required for taking pictures and recording videos
1201 * @tc.type : FUNC
1202 * @tc.size : Medium test
1203 */
1204 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_6500, TestSize.Level1)
1205 {
1206 uint8_t mode = OHOS_CAMERA_REGION_METERING;
1207 int32_t ret = mainDemo->SetMetadataMeter(mode);
1208 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1209 sleep(sleepOk);
1210 }
1211
1212 /**
1213 * @tc.number : SUB_DH_Dcamera_DCTS_6600
1214 * @tc.name :mainDemo->SetMetadata()
1215 * @tc.desc : Set the parameters required for taking pictures and recording videos
1216 * @tc.type : FUNC
1217 * @tc.size : Medium test
1218 */
1219 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_6600, TestSize.Level1)
1220 {
1221 uint8_t mode = OHOS_CAMERA_FLASH_MODE_CLOSE;
1222 int32_t ret = mainDemo->SetMetadataFlash(mode);
1223 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1224 sleep(sleepOk);
1225 }
1226
1227 /**
1228 * @tc.number : SUB_DH_Dcamera_DCTS_6700
1229 * @tc.name :mainDemo->SetMetadata()
1230 * @tc.desc : Set the parameters required for taking pictures and recording videos
1231 * @tc.type : FUNC
1232 * @tc.size : Medium test
1233 */
1234 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_6700, TestSize.Level1)
1235 {
1236 uint8_t mode = OHOS_CAMERA_FLASH_MODE_OPEN;
1237 int32_t ret = mainDemo->SetMetadataFlash(mode);
1238 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1239 sleep(sleepOk);
1240 }
1241
1242 /**
1243 * @tc.number : SUB_DH_Dcamera_DCTS_6800
1244 * @tc.name :mainDemo->SetMetadata()
1245 * @tc.desc : Set the parameters required for taking pictures and recording videos
1246 * @tc.type : FUNC
1247 * @tc.size : Medium test
1248 */
1249 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_6800, TestSize.Level1)
1250 {
1251 uint8_t mode = OHOS_CAMERA_FLASH_MODE_AUTO;
1252 int32_t ret = mainDemo->SetMetadataFlash(mode);
1253 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1254 sleep(sleepOk);
1255 }
1256
1257 /**
1258 * @tc.number : SUB_DH_Dcamera_DCTS_6900
1259 * @tc.name :mainDemo->SetMetadata()
1260 * @tc.desc : Set the parameters required for taking pictures and recording videos
1261 * @tc.type : FUNC
1262 * @tc.size : Medium test
1263 */
1264 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_6900, TestSize.Level1)
1265 {
1266 uint8_t mode = OHOS_CAMERA_MIRROR_ON;
1267 int32_t ret = mainDemo->SetMetadataMirror(mode);
1268 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1269 sleep(sleepOk);
1270 }
1271
1272 /**
1273 * @tc.number : SUB_DH_Dcamera_DCTS_7000
1274 * @tc.name :mainDemo->SetMetadata()
1275 * @tc.desc : Set the parameters required for taking pictures and recording videos
1276 * @tc.type : FUNC
1277 * @tc.size : Medium test
1278 */
1279 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_7000, TestSize.Level1)
1280 {
1281 uint8_t mode = OHOS_CAMERA_JPEG_ROTATION_0;
1282 int32_t ret = mainDemo->SetMetadataJpeg(mode);
1283 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1284 sleep(sleepOk);
1285 }
1286
1287 /**
1288 * @tc.number : SUB_DH_Dcamera_DCTS_7100
1289 * @tc.name :mainDemo->SetMetadata()
1290 * @tc.desc : Set the parameters required for taking pictures and recording videos
1291 * @tc.type : FUNC
1292 * @tc.size : Medium test
1293 */
1294 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_7100, TestSize.Level1)
1295 {
1296 uint8_t mode = OHOS_CAMERA_JPEG_ROTATION_90;
1297 int32_t ret = mainDemo->SetMetadataJpeg(mode);
1298 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1299 sleep(sleepOk);
1300 }
1301
1302 /**
1303 * @tc.number : SUB_DH_Dcamera_DCTS_7200
1304 * @tc.name :mainDemo->SetMetadata()
1305 * @tc.desc : Set the parameters required for taking pictures and recording videos
1306 * @tc.type : FUNC
1307 * @tc.size : Medium test
1308 */
1309 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_7200, TestSize.Level1)
1310 {
1311 uint8_t mode = OHOS_CAMERA_FOCUS_MODE_MANUAL;
1312 int32_t ret = mainDemo->SetMetadataAf(mode);
1313 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1314 sleep(sleepOk);
1315 }
1316
1317 /**
1318 * @tc.number : SUB_DH_Dcamera_DCTS_7300
1319 * @tc.name :mainDemo->SetMetadata()
1320 * @tc.desc : Set the parameters required for taking pictures and recording videos
1321 * @tc.type : FUNC
1322 * @tc.size : Medium test
1323 */
1324 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_7300, TestSize.Level1)
1325 {
1326 uint8_t mode = OHOS_CAMERA_FOCUS_MODE_CONTINUOUS_AUTO;
1327 int32_t ret = mainDemo->SetMetadataAf(mode);
1328 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1329 sleep(sleepOk);
1330 }
1331
1332 /**
1333 * @tc.number : SUB_DH_Dcamera_DCTS_7400
1334 * @tc.name :mainDemo->SetMetadata()
1335 * @tc.desc : Set the parameters required for taking pictures and recording videos
1336 * @tc.type : FUNC
1337 * @tc.size : Medium test
1338 */
1339 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_7400, TestSize.Level1)
1340 {
1341 uint8_t mode = OHOS_CAMERA_FOCUS_MODE_LOCKED;
1342 int32_t ret = mainDemo->SetMetadataAf(mode);
1343 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1344 sleep(sleepOk);
1345 }
1346
1347 /**
1348 * @tc.number : SUB_DH_Dcamera_DCTS_7500
1349 * @tc.name :mainDemo->SetMetadata()
1350 * @tc.desc : Set the parameters required for taking pictures and recording videos
1351 * @tc.type : FUNC
1352 * @tc.size : Medium test
1353 */
1354 HWTEST_F(DCameraAutomatTest, SUB_DH_Dcamera_DCTS_7500, TestSize.Level1)
1355 {
1356 uint8_t mode = OHOS_CAMERA_FACE_DETECT_MODE_OFF;
1357 int32_t ret = mainDemo->SetMetadataFace(mode);
1358 EXPECT_EQ(cameraOk, ret) << "SetMetadata fail";
1359 sleep(sleepOk);
1360 }