2 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <adaptor-test-application.h>
19 #include <dali-test-suite-utils.h>
20 #include <dali/public-api/capture/capture.h>
24 void utc_dali_capture_startup(void)
26 test_return_value = TET_UNDEF;
29 void utc_dali_capture_cleanup(void)
31 test_return_value = TET_PASS;
34 int UtcDaliCaptureNewPositive(void)
36 Dali::Capture instance = Dali::Capture::New();
37 DALI_TEST_CHECK(instance);
41 int UtcDaliCaptureNew2Positive(void)
43 CameraActor cameraActor;
44 Dali::Capture instance = Dali::Capture::New(cameraActor);
45 DALI_TEST_CHECK(instance);
49 int UtcDaliCaptureDownCast(void)
51 Dali::Capture instance;
52 DALI_TEST_CHECK(!Capture::DownCast(instance));
53 instance = Dali::Capture::New();
54 DALI_TEST_CHECK(instance);
55 DALI_TEST_CHECK(Capture::DownCast(instance));
59 int UtcDaliCaptureConstructorsPositive(void)
61 Capture capture1 = Capture::New();
64 Capture capture2 = Capture(capture1);
65 DALI_TEST_CHECK(capture1 == capture2);
68 DALI_TEST_CHECK(!capture1);
74 DALI_TEST_CHECK(capture1);
75 DALI_TEST_CHECK(!capture2);
78 Capture capture3 = Capture(std::move(capture1));
79 DALI_TEST_CHECK(capture3);
82 DALI_TEST_CHECK(!capture2);
83 capture2 = std::move(capture3);
84 DALI_TEST_CHECK(capture2);
89 int UtcDaliCaptureFinishedSignalNegative(void)
91 Dali::Capture instance;
94 instance.FinishedSignal();
95 DALI_TEST_CHECK(false); // Should not get here
99 DALI_TEST_CHECK(true); // We expect an assert
104 int UtcDaliCaptureSetImageQualityNegative(void)
106 Dali::Capture instance;
109 unsigned int arg1(0u);
110 instance.SetImageQuality(arg1);
111 DALI_TEST_CHECK(false); // Should not get here
115 DALI_TEST_CHECK(true); // We expect an assert
120 int UtcDaliCaptureStartNegative(void)
122 Dali::Capture instance;
128 instance.Start(arg1, arg2, arg3);
129 DALI_TEST_CHECK(false); // Should not get here
133 DALI_TEST_CHECK(true); // We expect an assert
138 int UtcDaliCaptureStart2Negative(void)
140 Dali::Capture instance;
147 instance.Start(arg1, arg2, arg3, arg4);
148 DALI_TEST_CHECK(false); // Should not get here
152 DALI_TEST_CHECK(true); // We expect an assert
157 int UtcDaliCaptureStart3Negative(void)
159 Dali::Capture instance;
166 unsigned int arg5(0u);
167 instance.Start(arg1, arg2, arg3, arg4, arg5);
168 DALI_TEST_CHECK(false); // Should not get here
172 DALI_TEST_CHECK(true); // We expect an assert
177 int UtcDaliCaptureStart4Negative(void)
179 Dali::Capture instance;
187 instance.Start(arg1, arg2, arg3, arg4, arg5);
188 DALI_TEST_CHECK(false); // Should not get here
192 DALI_TEST_CHECK(true); // We expect an assert
197 int UtcDaliCaptureGetNativeImageSourceNegative(void)
199 Dali::Capture instance;
202 instance.GetNativeImageSource();
203 DALI_TEST_CHECK(false); // Should not get here
207 DALI_TEST_CHECK(true); // We expect an assert