2 * Copyright (c) 2015 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 <dali/public-api/dali-core.h>
19 #include <dali-test-suite-utils.h>
23 #include <mesh-builder.h>
25 void renderer_test_startup(void)
27 test_return_value = TET_UNDEF;
30 void renderer_test_cleanup(void)
32 test_return_value = TET_PASS;
36 int UtcDaliRendererNew01(void)
38 TestApplication application;
40 Geometry geometry = CreateQuadGeometry();
41 Material material = CreateMaterial(1.0f);
42 Renderer renderer = Renderer::New(geometry, material);
44 DALI_TEST_EQUALS( (bool)renderer, true, TEST_LOCATION );
48 int UtcDaliRendererNew02(void)
50 TestApplication application;
52 DALI_TEST_EQUALS( (bool)renderer, false, TEST_LOCATION );
56 int UtcDaliRendererDownCast01(void)
58 TestApplication application;
60 Geometry geometry = CreateQuadGeometry();
61 Material material = CreateMaterial(1.0f);
62 Renderer renderer = Renderer::New(geometry, material);
64 BaseHandle handle(renderer);
65 Renderer renderer2 = Renderer::DownCast(handle);
66 DALI_TEST_EQUALS( (bool)renderer2, true, TEST_LOCATION );
70 int UtcDaliRendererDownCast02(void)
72 TestApplication application;
74 Handle handle = Handle::New(); // Create a custom object
75 Renderer renderer = Renderer::DownCast(handle);
76 DALI_TEST_EQUALS( (bool)renderer, false, TEST_LOCATION );