diff options
author | geronimo <geronimo013@gmx.de> | 2012-07-29 15:11:47 +0200 |
---|---|---|
committer | geronimo <geronimo013@gmx.de> | 2012-07-29 15:11:47 +0200 |
commit | 85cb3f04252b0228830903b21c08bb64e9919c18 (patch) | |
tree | 5c00dbd8d296861aa56cca598ee2a36e51971822 /tests/ConnectionHandlerTest/ConnectionHandlerTest.cc | |
parent | 736033f3d532c4814eeff84db5dbf99f0249df6e (diff) | |
download | cmp-85cb3f04252b0228830903b21c08bb64e9919c18.tar.gz cmp-85cb3f04252b0228830903b21c08bb64e9919c18.tar.bz2 |
changed server setup to config file, little rearrangement of sources
Diffstat (limited to 'tests/ConnectionHandlerTest/ConnectionHandlerTest.cc')
-rw-r--r-- | tests/ConnectionHandlerTest/ConnectionHandlerTest.cc | 15 |
1 files changed, 9 insertions, 6 deletions
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 <ConnectionHandler.h> #include <ServerConfig.h> -#include <FilesystemScanner.h> +#include <FSMediaScanner.h> #include <MediaFactory.h> #include <MediaListHandler.h> #include <MediaFileHandler.h> @@ -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); } |