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.
21 #include <dali/public-api/dali-core.h>
22 #include <dali-test-suite-utils.h>
26 void utc_dali_shader_startup(void)
28 test_return_value = TET_UNDEF;
31 void utc_dali_shader_cleanup(void)
33 test_return_value = TET_PASS;
39 static const char* VertexSource =
40 "This is a custom vertex shader\n"
41 "made on purpose to look nothing like a normal vertex shader inside dali\n";
43 static const char* FragmentSource =
44 "This is a custom fragment shader\n"
45 "made on purpose to look nothing like a normal fragment shader inside dali\n";
50 int UtcDaliShaderMethodNew01(void)
52 TestApplication application;
54 Shader shader = Shader::New( VertexSource, FragmentSource );
55 DALI_TEST_EQUALS((bool)shader, true, TEST_LOCATION);
59 int UtcDaliShaderMethodNew02(void)
61 TestApplication application;
64 DALI_TEST_EQUALS((bool)shader, false, TEST_LOCATION);
68 int UtcDaliShaderDownCast01(void)
70 TestApplication application;
72 Shader shader = Shader::New(VertexSource, FragmentSource);
74 BaseHandle handle(shader);
75 Shader shader2 = Shader::DownCast(handle);
76 DALI_TEST_EQUALS( (bool)shader2, true, TEST_LOCATION );
80 int UtcDaliShaderDownCast02(void)
82 TestApplication application;
84 Handle handle = Handle::New(); // Create a custom object
85 Shader shader = Shader::DownCast(handle);
86 DALI_TEST_EQUALS( (bool)shader, false, TEST_LOCATION );