Upload package dali_0.9.11.
[platform/core/uifw/dali-core.git] / automated-tests / TET / dali-test-suite / images / utc-MODULE-CLASS.cpp.in
1 #include <iostream>
2
3 #include <stdlib.h>
4 #include <tet_api.h>
5
6 #include <dali/public-api/dali-core.h>
7
8 #include <dali-test-suite-utils.h>
9
10 using namespace Dali;
11
12 static void Startup();
13 static void Cleanup();
14
15 extern "C" {
16   void (*tet_startup)() = Startup;
17   void (*tet_cleanup)() = Cleanup;
18 }
19
20 static void Utc@MODULE@@CLASS@Method01();
21 static void Utc@MODULE@@CLASS@Method02();
22
23 enum {
24   POSITIVE_TC_IDX = 0x01,
25   NEGATIVE_TC_IDX,
26 };
27
28 // Add test functionality for all APIs in the class (Positive and Negative)
29 extern "C" {
30   struct tet_testlist tet_testlist[] = {
31     { Utc@MODULE@@CLASS@Method01, POSITIVE_TC_IDX },
32     { Utc@MODULE@@CLASS@Method02, NEGATIVE_TC_IDX },
33     { NULL, 0 }
34   };
35 }
36
37 static Dali::TestApplication* gApplication = NULL;
38
39 // Called only once before first test is run.
40 static void Startup()
41 {
42   gApplication = new Dali::TestApplication();
43 }
44
45 // Called only once after last test is run
46 static void Cleanup()
47 {
48   delete gApplication;
49 }
50
51
52 // Positive test case for a method
53 static void Utc@MODULE@@CLASS@Method01()
54 {
55   gApplication->Initialize(); // Reset all test adapter return codes
56
57   tet_infoline("Journaled printf Output");
58   tet_result(TET_FAIL);
59 #if 0
60   tet_result(TET_PASS);
61 #endif
62 }
63
64
65 // Negative test case for a method
66 static void Utc@MODULE@@CLASS@Method02()
67 {
68   gApplication->Initialize(); // Reset all test adapter return codes
69
70   try
71   {
72     /* My test code and results */
73     DALI_TEST_EQUALS(myVar, expectedValue, TEST_LOCATION);
74   }
75   catch (Dali::DaliException& e)
76   {
77     // Tests that a negative test of an assertion succeeds
78     tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
79     DALI_TEST_ASSERT(e, "assert conditional", TEST_LOCATION);
80   }
81 }
82