From 85cb3f04252b0228830903b21c08bb64e9919c18 Mon Sep 17 00:00:00 2001 From: geronimo Date: Sun, 29 Jul 2012 15:11:47 +0200 Subject: changed server setup to config file, little rearrangement of sources --- tests/ConnectionHandlerTest/ConnectionHandlerTest.cbp | 5 ++++- tests/ConnectionHandlerTest/ConnectionHandlerTest.cc | 15 +++++++++------ tests/ConnectionHandlerTest/ConnectionHandlerTest.layout | 2 +- .../ConnectionHandlerTest.layout.save | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) (limited to 'tests/ConnectionHandlerTest') diff --git a/tests/ConnectionHandlerTest/ConnectionHandlerTest.cbp b/tests/ConnectionHandlerTest/ConnectionHandlerTest.cbp index b2d783b..31d9050 100644 --- a/tests/ConnectionHandlerTest/ConnectionHandlerTest.cbp +++ b/tests/ConnectionHandlerTest/ConnectionHandlerTest.cbp @@ -38,12 +38,13 @@ - + + @@ -51,12 +52,14 @@ + + diff --git a/tests/ConnectionHandlerTest/ConnectionHandlerTest.cc b/tests/ConnectionHandlerTest/ConnectionHandlerTest.cc index 1dc3659..89dc56d 100644 --- a/tests/ConnectionHandlerTest/ConnectionHandlerTest.cc +++ b/tests/ConnectionHandlerTest/ConnectionHandlerTest.cc @@ -6,7 +6,7 @@ */ #include #include -#include +#include #include #include #include @@ -36,11 +36,11 @@ private: cServerConfig config; cConnectionHandler ch; const char *name; - cFilesystemScanner *scanner; + cFSMediaScanner *scanner; }; cTestUnit::cTestUnit(const char* Name, cConnectionPoint &cp) - : config(12345) + : config("/var/lib/cmp") , ch(cp, config) , name(Name) , scanner(NULL) @@ -49,14 +49,14 @@ cTestUnit::cTestUnit(const char* Name, cConnectionPoint &cp) config.SetDocumentRoot("/media/video"); config.SetAppIcon("/media/favicon.ico"); - scanner = new cFilesystemScanner(); + scanner = new cFSMediaScanner(); if (!scanner) { fprintf(stderr, "could not initialize application! (1)"); exit(-1); } - scanner->SetMediaFactory(new cMediaFactory(config.DocumentRoot())); + scanner->SetMediaFactory(new cMediaFactory(config)); - cAbstractMediaRequestHandler::SetFilesystemScanner(scanner); + cAbstractMediaRequestHandler::SetFSMediaScanner(scanner); cConnectionHandler::RegisterRequestHandler("/cmd", new cCommandHandler()); cMediaListHandler *listHandler = new cMediaListHandler(); @@ -130,6 +130,9 @@ int main(int argc, char** argv) std::cout << "%SUITE_FINISHED% time=" << (double)(cTimeMs::Now() - t0) / 1000 << std::endl; + cFile::Cleanup(); + cUrl::Cleanup(); + return (EXIT_SUCCESS); } diff --git a/tests/ConnectionHandlerTest/ConnectionHandlerTest.layout b/tests/ConnectionHandlerTest/ConnectionHandlerTest.layout index b29fcb8..130e1dc 100644 --- a/tests/ConnectionHandlerTest/ConnectionHandlerTest.layout +++ b/tests/ConnectionHandlerTest/ConnectionHandlerTest.layout @@ -3,7 +3,7 @@ - + diff --git a/tests/ConnectionHandlerTest/ConnectionHandlerTest.layout.save b/tests/ConnectionHandlerTest/ConnectionHandlerTest.layout.save index b29fcb8..130e1dc 100644 --- a/tests/ConnectionHandlerTest/ConnectionHandlerTest.layout.save +++ b/tests/ConnectionHandlerTest/ConnectionHandlerTest.layout.save @@ -3,7 +3,7 @@ - + -- cgit v1.2.3