316b6190a430f82fb77cb0d242111b29eeeb03e0
[platform/core/uifw/dali-adaptor.git] / automated-tests / TET / 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/dali.h>
23
24 #include <dali-test-suite-utils.h>
25
26 using namespace Dali;
27
28 static void Startup();
29 static void Cleanup();
30
31 extern "C" {
32   void (*tet_startup)() = Startup;
33   void (*tet_cleanup)() = Cleanup;
34 }
35
36 enum {
37   POSITIVE_TC_IDX = 0x01,
38   NEGATIVE_TC_IDX,
39 };
40
41 #define MAX_NUMBER_OF_TESTS 10000
42 extern "C" {
43   struct tet_testlist tet_testlist[MAX_NUMBER_OF_TESTS];
44 }
45
46 TEST_FUNCTION( Utc@MODULE@@CLASS@Method01, POSITIVE_TC_IDX );
47 TEST_FUNCTION( Utc@MODULE@@CLASS@Method02, NEGATIVE_TC_IDX );
48
49 // Called only once before first test is run.
50 static void Startup()
51 {
52 }
53
54 // Called only once after last test is run
55 static void Cleanup()
56 {
57 }
58
59
60 // Positive test case for a method
61 static void Utc@MODULE@@CLASS@Method01()
62 {
63   TestApplication application;
64
65   tet_infoline("Journaled printf Output");
66   tet_result(TET_FAIL);
67 #if 0
68   tet_result(TET_PASS);
69 #endif
70 }
71
72
73 // Negative test case for a method
74 static void Utc@MODULE@@CLASS@Method02()
75 {
76   TestApplication application;  // Exceptions require TestApplication
77
78   try
79   {
80     /* My test code and results */
81     DALI_TEST_EQUALS(myVar, expectedValue, TEST_LOCATION);
82   }
83   catch (Dali::DaliException& e)
84   {
85     // Tests that a negative test of an assertion succeeds
86     tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
87     DALI_TEST_ASSERT(e, "assert conditional", TEST_LOCATION);
88   }
89 }
90