/* * Copyright (c) 2014 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include #include #include #include #include #include // Internal headers are allowed here using namespace Dali; using namespace Dali::Toolkit; using namespace Dali::Toolkit::Internal; static void Startup(); static void Cleanup(); extern "C" { void (*tet_startup)() = Startup; void (*tet_cleanup)() = Cleanup; } enum { POSITIVE_TC_IDX = 0x01, NEGATIVE_TC_IDX, }; #define MAX_NUMBER_OF_TESTS 10000 extern "C" { struct tet_testlist tet_testlist[MAX_NUMBER_OF_TESTS]; } // Add test functionality for all APIs in the class (Positive and Negative) TEST_FUNCTION( Utc@MODULE@@CLASS@Method01, POSITIVE_TC_IDX ); TEST_FUNCTION( Utc@MODULE@@CLASS@Method02, NEGATIVE_TC_IDX ); // Called only once before first test is run. static void Startup() { } // Called only once after last test is run static void Cleanup() { } // Positive test case for a method static void Utc@MODULE@@CLASS@Method01() { ToolkitTestApplication application; tet_infoline("Journaled printf Output"); tet_result(TET_FAIL); #if 0 tet_result(TET_PASS); #endif } // Negative test case for a method static void Utc@MODULE@@CLASS@Method02() { ToolkitTestApplication application; // Exceptions require ToolkitTestApplication try { /* My test code and results */ DALI_TEST_EQUALS(myVar, expectedValue, TEST_LOCATION); } catch (Dali::DaliException& e) { // Tests that a negative test of an assertion succeeds tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str()); DALI_TEST_EQUALS(e.mCondition, "assert conditional", TEST_LOCATION); } }