libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
check_libmoldeo.cpp
Go to the documentation of this file.
1 #include <../libmoldeo/moText.h>
2 #include <../libmoldeo/moResourceManager.h>
3 #include <../libmoldeo/moDataManager.h>
4 #include <../libmoldeo/moConsole.h>
5 
6 #include "../config.h"
7 #include <check.h>
8 
9 /*
10  * Core test suite
11  */
12 START_TEST(test_text)
13 {
14  fail_unless(moText("hola") == moText("hola"));
15  fail_unless(moText("adios") != moText("hola"));
16 }
17 END_TEST
18 
19 START_TEST(test_video_graph) {
20  /* TODO: Not implemented */
21 }
22 END_TEST
23 
24 START_TEST(test_data_session_config) {
25  bool res;
26  moDataSessionConfig *DataSessionConfig = new moDataSessionConfig(
27  moText("apppath"),
28  moText("datapath"),
29  moText("config.mol"),
30  moText("session_file_name"),
31  moText("video_file_name"),
32  0, 1, 2, 3);
33  fail_unless(DataSessionConfig != NULL);
34 /*
35  fail_unless(DataSessionConfig->GetDataPath() == moText("datapath"));
36  fail_unless(DataSessionConfig->GetConsoleConfigName() == moText("config.mol"));
37  fail_unless(DataSessionConfig->GetSessionFileName() == moText("session_file_name"));
38  fail_unless(DataSessionConfig->GetVideoFileName() == moText("video_file_name"));
39 */
40  /* TODO: Not implemented
41  m_MaxKeys
42  m_MaxTimecode
43  m_Port
44  m_Address
45  */
46  delete DataSessionConfig;
47 }
48 END_TEST
49 
50 START_TEST(test_data_session) {
51  bool res;
52  moDataSession *DataSession = new moDataSession();
53  fail_unless(DataSession != NULL);
54  /*res = DataSession->Init(moText("my_name"),
55  NULL,
56  );*/
57  delete DataSession;
58 }
59 END_TEST
60 
61 START_TEST(test_data_manager) {
62  bool res;
63  moDataManager *DataManager = new moDataManager();
64  fail_unless(DataManager != NULL);
65 /*
66  res = DataManager->Init( moText(""),moText("data"), moText("config.mol"));
67  fail_unless(res != true);
68 /*
69  fail_unless(DataManager->GetDataPath() == moText("data"));
70  fail_unless(DataManager->GetConsoleConfigName() == moText("config.mol"));
71 */
72  delete DataManager;
73 }
74 END_TEST
75 
76 START_TEST(test_resource_manager) {
77  bool res;
78  moResourceManager *ResourceManager = new moResourceManager();
79  fail_unless(ResourceManager != NULL);
80  delete ResourceManager;
81 }
82 END_TEST
83 
84 START_TEST(test_console) {
85  bool res;
86  moConsole *MoldeoSession;
87  MoldeoSession = new moConsole();
88  fail_unless(MoldeoSession != NULL);
89  delete MoldeoSession;
90 }
91 END_TEST
92 
93 /*
94  * Prepare test suite
95  */
96 Suite *
98 {
99  Suite *s = suite_create("libmoldeo");
100  TCase *tc = tcase_create("core");
101  tcase_add_test(tc, test_text);
102  tcase_add_test(tc, test_data_session_config);
103  suite_add_tcase(s, tc);
104  return s;
105 }
106 
107 /*
108  * Main
109  */
110 int
111 main( int argc, char *argv[] )
112 {
113  int nf;
114  Suite *s = libmoldeo_suite();
115  SRunner *sr = srunner_create(s);
116  srunner_set_log(sr, "check_libmoldeo.log");
117  srunner_run_all(sr, CK_NORMAL);
118  nf = srunner_ntests_failed(sr);
119  srunner_free(sr);
120  return (nf == 0) ? 0 : 1;
121 }
122 
Objeto Consola.
Definition: moConsole.h:147
START_TEST(test_text)
moText0 moText
Definition: moText.h:291
Administrador de recursos.
int main(int argc, char *argv[])
END_TEST Suite * libmoldeo_suite(void)