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