summaryrefslogtreecommitdiff
path: root/tests/ConnectionHandlerTest
diff options
context:
space:
mode:
authorgeronimo <geronimo013@gmx.de>2012-07-29 15:11:47 +0200
committergeronimo <geronimo013@gmx.de>2012-07-29 15:11:47 +0200
commit85cb3f04252b0228830903b21c08bb64e9919c18 (patch)
tree5c00dbd8d296861aa56cca598ee2a36e51971822 /tests/ConnectionHandlerTest
parent736033f3d532c4814eeff84db5dbf99f0249df6e (diff)
downloadcmp-85cb3f04252b0228830903b21c08bb64e9919c18.tar.gz
cmp-85cb3f04252b0228830903b21c08bb64e9919c18.tar.bz2
changed server setup to config file, little rearrangement of sources
Diffstat (limited to 'tests/ConnectionHandlerTest')
-rw-r--r--tests/ConnectionHandlerTest/ConnectionHandlerTest.cbp5
-rw-r--r--tests/ConnectionHandlerTest/ConnectionHandlerTest.cc15
-rw-r--r--tests/ConnectionHandlerTest/ConnectionHandlerTest.layout2
-rw-r--r--tests/ConnectionHandlerTest/ConnectionHandlerTest.layout.save2
4 files changed, 15 insertions, 9 deletions
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 @@
</Build>
<Compiler>
<Add option="-Wall" />
- <Add option="-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -ansi" />
+ <Add option="-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration" />
<Add option="-D_REENTRANT" />
<Add option="-D_GNU_SOURCE=1" />
<Add directory="../../cmps/serverlib/include" />
<Add directory="../../libs/fsScan/include" />
<Add directory="../../libs/networking/include" />
+ <Add directory="../../libs/IO/include" />
<Add directory="../../libs/util/include" />
<Add directory="../../libs/vdr/include" />
</Compiler>
@@ -51,12 +52,14 @@
<Add library="../../cmps/serverlib/libserverlib.a" />
<Add library="../../libs/fsScan/libfsScan.a" />
<Add library="../../libs/networking/libnetworking.a" />
+ <Add library="../../libs/IO/libIO.a" />
<Add library="../../libs/util/libutil.a" />
<Add library="../../libs/vdr/libvdr.a" />
<Add library="ssl" />
<Add library="crypt" />
<Add library="pthread" />
<Add library="rt" />
+ <Add library="pcrecpp" />
</Linker>
<Unit filename="ConnectionHandlerTest.cc" />
<Extensions>
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);
}
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 @@
<ActiveTarget name="Debug" />
<File name="ConnectionHandlerTest.cc" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
- <Cursor1 position="1092" topLine="3" />
+ <Cursor1 position="916" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>
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 @@
<ActiveTarget name="Debug" />
<File name="ConnectionHandlerTest.cc" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
- <Cursor1 position="1092" topLine="3" />
+ <Cursor1 position="916" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>