00001
00002 #include "MediaTable.h"
00003
00004
00005 #ifdef DOUNITTESTING
00006 #define BOOST_TEST_NO_MAIN
00007 #define BOOST_TEST_DYN_LINK
00008 #define BOOST_TEST_ALTERNATIVE_INIT_API
00009 #define BOOST_TEST_THREAD_SAFE
00010 #define BOOST_TEST_MODULE MediaTableTestSuite
00011 #include "boost/test/unit_test.hpp"
00012 #include "Tests/testMediaTable.h"
00013 #endif
00014
00015 int main(int argc, char* argv[])
00016 {
00017 OglInit(&argc, &argv[0]);
00018
00019
00020 Impala::CmdOptions& options = Impala::CmdOptions::GetInstance();
00021 options.Initialise(true, false, true);
00022 options.SetDefault("wndWidth", "1270");
00023 options.SetDefault("wndHeight", "975");
00024 options.AddOption(0, "imageCacheSize", "size of image cache", "1000");
00025 options.AddOption('a',"database", "database file to use","");
00026 options.AddOption('d',"directory", "directory of images to use","");
00027 options.AddOption('c', "csv","csv file to load","");
00028 options.AddOption(0, "trec", "", "0");
00029 options.AddOption(0, "preload","", "0");
00030 #ifdef MEDIATABLE_VIDEOLYMPICS
00031 options.AddOption(0, "videolympicsServer", "hostname of VideOlympics contest server", "");
00032 options.AddOption(0, "videolympicsPort", "port of VideOlympics contest server", "");
00033 options.AddOption(0, "videolympicsTeam", "VideOlympics team nr.", "");
00034 #endif
00035
00036 if (! options.ParseArgs(argc, argv, "", 0))
00037 return 1;
00038
00039 ILOG_VAR(MediaTable.mainMediaTable);
00040
00041 #ifdef DOUNITTESTING
00042 ILOG_STARTACTION("Unit testing", ILOG_LEVEL_INFO);
00043
00044 extern bool init_unit_test();
00045 bool BoostTestSucceed = !boost::unit_test::unit_test_main( &init_unit_test, 1, argv);
00046
00047
00048
00049
00050 assert(BoostTestSucceed);
00051
00052
00053 ILOG_ENDACTION("Unit testing");
00054 #endif
00055
00056 ILOG_SYSTEM("LOADING......");
00057 int w = options.GetInt("wndWidth");
00058 int h = options.GetInt("wndHeight");
00059
00060 Impala::Application::MediaTable::MediaTable *d =
00061 new Impala::Application::MediaTable::MediaTable(w,h);
00062 ILOG_SYSTEM("STARTING -----------------------------");
00063 d->Go();
00064 return 0;
00065 }