Put scroll-connector.h in the capi folder
[platform/core/uifw/dali-toolkit.git] / automated-tests / dali-internal-test-suite / utc-MODULE-CLASS.cpp.in
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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
7 //
8 //     http://floralicense.org/license/
9 //
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.
15 //
16
17 #include <iostream>
18
19 #include <stdlib.h>
20 #include <tet_api.h>
21
22 #include <dali/public-api/dali-core.h>
23 #include <dali-toolkit/dali-toolkit.h>
24
25 #include <dali-toolkit-test-suite-utils.h>
26
27 // Internal headers are allowed here
28
29 using namespace Dali;
30 using namespace Dali::Toolkit;
31 using namespace Dali::Toolkit::Internal;
32
33 static void Startup();
34 static void Cleanup();
35
36 extern "C" {
37   void (*tet_startup)() = Startup;
38   void (*tet_cleanup)() = Cleanup;
39 }
40
41 enum {
42   POSITIVE_TC_IDX = 0x01,
43   NEGATIVE_TC_IDX,
44 };
45
46 #define MAX_NUMBER_OF_TESTS 10000
47 extern "C" {
48   struct tet_testlist tet_testlist[MAX_NUMBER_OF_TESTS];
49 }
50
51 // Add test functionality for all APIs in the class (Positive and Negative)
52 TEST_FUNCTION( Utc@MODULE@@CLASS@Method01, POSITIVE_TC_IDX );
53 TEST_FUNCTION( Utc@MODULE@@CLASS@Method02, NEGATIVE_TC_IDX );
54
55 // Called only once before first test is run.
56 static void Startup()
57 {
58 }
59
60 // Called only once after last test is run
61 static void Cleanup()
62 {
63 }
64
65
66 // Positive test case for a method
67 static void Utc@MODULE@@CLASS@Method01()
68 {
69   ToolkitTestApplication application;
70
71   tet_infoline("Journaled printf Output");
72   tet_result(TET_FAIL);
73 #if 0
74   tet_result(TET_PASS);
75 #endif
76 }
77
78
79 // Negative test case for a method
80 static void Utc@MODULE@@CLASS@Method02()
81 {
82   ToolkitTestApplication application;  // Exceptions require ToolkitTestApplication
83
84   try
85   {
86     /* My test code and results */
87     DALI_TEST_EQUALS(myVar, expectedValue, TEST_LOCATION);
88   }
89   catch (Dali::DaliException& e)
90   {
91     // Tests that a negative test of an assertion succeeds
92     tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
93     DALI_TEST_EQUALS(e.mCondition, "assert conditional", TEST_LOCATION);
94   }
95 }
96