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 propertyBuffer_test_startup(void)
27 test_return_value = TET_UNDEF;
30 void propertyBuffer_test_cleanup(void)
32 test_return_value = TET_PASS;
35 int UtcDaliPropertyBufferNew01(void)
37 TestApplication application;
39 Property::Map texturedQuadVertexFormat;
40 texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
41 texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
43 PropertyBuffer propertyBuffer = PropertyBuffer::New( PropertyBuffer::STATIC,
44 texturedQuadVertexFormat, 4 );
46 DALI_TEST_EQUALS( (bool)propertyBuffer, true, TEST_LOCATION );
50 int UtcDaliPropertyBufferNew02(void)
52 TestApplication application;
53 PropertyBuffer propertyBuffer;
54 DALI_TEST_EQUALS( (bool)propertyBuffer, false, TEST_LOCATION );
58 int UtcDaliPropertyBufferDownCast01(void)
60 TestApplication application;
62 Property::Map texturedQuadVertexFormat;
63 texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
64 texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
66 PropertyBuffer propertyBuffer = PropertyBuffer::New( PropertyBuffer::STATIC,
67 texturedQuadVertexFormat, 4 );
69 BaseHandle handle(propertyBuffer);
70 PropertyBuffer propertyBuffer2 = PropertyBuffer::DownCast(handle);
71 DALI_TEST_EQUALS( (bool)propertyBuffer2, true, TEST_LOCATION );
75 int UtcDaliPropertyBufferDownCast02(void)
77 TestApplication application;
79 Handle handle = Handle::New(); // Create a custom object
80 PropertyBuffer propertyBuffer = PropertyBuffer::DownCast(handle);
81 DALI_TEST_EQUALS( (bool)propertyBuffer, false, TEST_LOCATION );