diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-05-25 10:14:14 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-06-30 16:08:12 +0900 |
| commit | 7e90bb1967477b331f134e27d6f0ea4cc69ffb0a (patch) | |
| tree | d84a9a28035f9d9f86a76dfdb41e7a35fe2ca381 /src/utests | |
| parent | f95d80e61e0b55201184b844cbf059efc574c2f0 (diff) | |
| download | ktorrent-7e90bb19.tar.gz ktorrent-7e90bb19.zip | |
Add cmake rules for utests and fix tester program
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit edc958f6e74feb036c90bfa55f40df1c55c37153)
Diffstat (limited to 'src/utests')
| -rw-r--r-- | src/utests/CMakeLists.txt | 18 | ||||
| -rw-r--r-- | src/utests/main.cpp | 2 | ||||
| -rw-r--r-- | src/utests/upnpparseresponsetest.cpp | 2 |
3 files changed, 21 insertions, 1 deletions
diff --git a/src/utests/CMakeLists.txt b/src/utests/CMakeLists.txt new file mode 100644 index 0000000..7eebbbe --- /dev/null +++ b/src/utests/CMakeLists.txt @@ -0,0 +1,18 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/src + ${CMAKE_SOURCE_DIR}/src/libktorrent +) + + +##### ktorrent (executable) + +tde_add_check_executable( ktutester AUTOMOC + SOURCES + unittest.cpp testrunner.cpp main.cpp upnpparsedescriptiontest.cpp upnpparseresponsetest.cpp + dhtmsgparsetest.cpp biginttest.cpp rc4test.cpp difflehellmantest.cpp + LINK + ktupnp-static + ktorrent-shared tdecore-shared tdeui-shared tdeio-shared DCOP-shared +) diff --git a/src/utests/main.cpp b/src/utests/main.cpp index 7618cac..f9feb89 100644 --- a/src/utests/main.cpp +++ b/src/utests/main.cpp @@ -28,6 +28,7 @@ #include "biginttest.h" #include "rc4test.h" #include "difflehellmantest.h" +#include <tqfile.h> using namespace kt; using namespace bt; @@ -38,6 +39,7 @@ using namespace utest; int main(int argc,char** argv) { Globals::instance().setDebugMode(true); + TQFile::remove("ktutester.log"); Globals::instance().initLog("ktutester.log"); TestRunner tr; tr.addTest(new UPnPParseDescriptionTest()); diff --git a/src/utests/upnpparseresponsetest.cpp b/src/utests/upnpparseresponsetest.cpp index 97102cf..a096b59 100644 --- a/src/utests/upnpparseresponsetest.cpp +++ b/src/utests/upnpparseresponsetest.cpp @@ -38,7 +38,7 @@ namespace utest bool UPnPParseResponseTest::doTest() { - static const char* test_ps = "M-SEARCH * HTTP/1.1\r\n" + static const char* test_ps = "HTTP/1.1\r\n" "HOST: 239.255.255.250:1900\r\n" "ST:urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\n" "MAN:\"ssdp:discover\"\r\n" |
