# HG changeset patch # User Sebastien Jodogne # Date 1606247601 -3600 # Node ID 9684a690ca63cd41558969b4e537b590f84d567a # Parent 83c5bd439fcc1866ef8b0b98fdb067ef2796f080 fix link errors on wasm unit tests diff -r 83c5bd439fcc -r 9684a690ca63 OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake --- a/OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake Tue Nov 24 19:43:10 2020 +0100 +++ b/OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake Tue Nov 24 20:53:21 2020 +0100 @@ -154,7 +154,6 @@ ${CMAKE_CURRENT_LIST_DIR}/../../Sources/Enumerations.cpp ${CMAKE_CURRENT_LIST_DIR}/../../Sources/FileStorage/MemoryStorageArea.cpp ${CMAKE_CURRENT_LIST_DIR}/../../Sources/HttpServer/HttpContentNegociation.cpp - ${CMAKE_CURRENT_LIST_DIR}/../../Sources/HttpServer/HttpToolbox.cpp ${CMAKE_CURRENT_LIST_DIR}/../../Sources/HttpServer/MultipartStreamReader.cpp ${CMAKE_CURRENT_LIST_DIR}/../../Sources/HttpServer/StringMatcher.cpp ${CMAKE_CURRENT_LIST_DIR}/../../Sources/Logging.cpp @@ -307,6 +306,7 @@ ${CMAKE_CURRENT_LIST_DIR}/../../Sources/HttpServer/HttpOutput.cpp ${CMAKE_CURRENT_LIST_DIR}/../../Sources/HttpServer/HttpServer.cpp ${CMAKE_CURRENT_LIST_DIR}/../../Sources/HttpServer/HttpStreamTranscoder.cpp + ${CMAKE_CURRENT_LIST_DIR}/../../Sources/HttpServer/HttpToolbox.cpp ${CMAKE_CURRENT_LIST_DIR}/../../Sources/HttpServer/StringHttpOutput.cpp ${CMAKE_CURRENT_LIST_DIR}/../../Sources/RestApi/RestApi.cpp ${CMAKE_CURRENT_LIST_DIR}/../../Sources/RestApi/RestApiCall.cpp diff -r 83c5bd439fcc -r 9684a690ca63 OrthancFramework/Sources/HttpServer/HttpToolbox.cpp --- a/OrthancFramework/Sources/HttpServer/HttpToolbox.cpp Tue Nov 24 19:43:10 2020 +0100 +++ b/OrthancFramework/Sources/HttpServer/HttpToolbox.cpp Tue Nov 24 20:53:21 2020 +0100 @@ -23,18 +23,17 @@ #include "../PrecompiledHeaders.h" #include "HttpToolbox.h" +#include "HttpOutput.h" +#include "StringHttpOutput.h" + #include #include #include -#include "HttpOutput.h" -#include "StringHttpOutput.h" - static const char* LOCALHOST = "127.0.0.1"; - namespace Orthanc { static void SplitGETNameValue(IHttpHandler::GetArguments& result, @@ -188,7 +187,6 @@ } -#if ORTHANC_SANDBOXED != 1 bool HttpToolbox::SimpleGet(std::string& result, IHttpHandler& handler, RequestOrigin origin, @@ -213,10 +211,8 @@ return false; } } -#endif -#if ORTHANC_SANDBOXED != 1 static bool SimplePostOrPut(std::string& result, IHttpHandler& handler, RequestOrigin origin, @@ -245,10 +241,8 @@ return false; } } -#endif -#if ORTHANC_SANDBOXED != 1 bool HttpToolbox::SimplePost(std::string& result, IHttpHandler& handler, RequestOrigin origin, @@ -259,10 +253,8 @@ { return SimplePostOrPut(result, handler, origin, HttpMethod_Post, uri, bodyData, bodySize, httpHeaders); } -#endif -#if ORTHANC_SANDBOXED != 1 bool HttpToolbox::SimplePut(std::string& result, IHttpHandler& handler, RequestOrigin origin, @@ -273,10 +265,8 @@ { return SimplePostOrPut(result, handler, origin, HttpMethod_Put, uri, bodyData, bodySize, httpHeaders); } -#endif - -#if ORTHANC_SANDBOXED != 1 + bool HttpToolbox::SimpleDelete(IHttpHandler& handler, RequestOrigin origin, const std::string& uri, @@ -293,5 +283,4 @@ return handler.Handle(http, origin, LOCALHOST, "", HttpMethod_Delete, curi, httpHeaders, getArguments, NULL /* no body for DELETE */, 0); } -#endif } diff -r 83c5bd439fcc -r 9684a690ca63 OrthancFramework/Sources/HttpServer/HttpToolbox.h --- a/OrthancFramework/Sources/HttpServer/HttpToolbox.h Tue Nov 24 19:43:10 2020 +0100 +++ b/OrthancFramework/Sources/HttpServer/HttpToolbox.h Tue Nov 24 20:53:21 2020 +0100 @@ -22,10 +22,6 @@ #pragma once -#if !defined(ORTHANC_SANDBOXED) -# error Macro ORTHANC_SANDBOXED must be defined -#endif - #include "../OrthancFramework.h" #include "IHttpHandler.h" @@ -55,7 +51,6 @@ static void CompileGetArguments(IHttpHandler::Arguments& compiled, const IHttpHandler::GetArguments& source); -#if ORTHANC_SANDBOXED != 1 static bool SimpleGet(std::string& result, IHttpHandler& handler, RequestOrigin origin, @@ -68,7 +63,7 @@ const std::string& uri, const void* bodyData, size_t bodySize, - const IHttpHandler::Arguments& httpHeaders); + const IHttpHandler::Arguments& httpHeaders); static bool SimplePut(std::string& result, IHttpHandler& handler, @@ -82,6 +77,5 @@ RequestOrigin origin, const std::string& uri, const IHttpHandler::Arguments& httpHeaders); -#endif }; } diff -r 83c5bd439fcc -r 9684a690ca63 OrthancFramework/UnitTestsSources/FrameworkTests.cpp --- a/OrthancFramework/UnitTestsSources/FrameworkTests.cpp Tue Nov 24 19:43:10 2020 +0100 +++ b/OrthancFramework/UnitTestsSources/FrameworkTests.cpp Tue Nov 24 20:53:21 2020 +0100 @@ -34,13 +34,13 @@ #include #include "../Sources/DicomFormat/DicomTag.h" -#include "../Sources/HttpServer/HttpToolbox.h" #include "../Sources/Logging.h" #include "../Sources/OrthancException.h" #include "../Sources/Toolbox.h" #if ORTHANC_SANDBOXED != 1 # include "../Sources/FileBuffer.h" +# include "../Sources/HttpServer/HttpToolbox.h" # include "../Sources/MetricsRegistry.h" # include "../Sources/SystemToolbox.h" # include "../Sources/TemporaryFile.h" @@ -101,6 +101,7 @@ } +#if ORTHANC_SANDBOXED != 1 TEST(ParseGetArguments, Basic) { IHttpHandler::GetArguments b; @@ -114,7 +115,9 @@ ASSERT_EQ(a["bb"], "a"); ASSERT_EQ(a["aa"], "c"); } +#endif +#if ORTHANC_SANDBOXED != 1 TEST(ParseGetArguments, BasicEmpty) { IHttpHandler::GetArguments b; @@ -128,7 +131,9 @@ ASSERT_EQ(a["bb"], "aa"); ASSERT_EQ(a["aa"], ""); } +#endif +#if ORTHANC_SANDBOXED != 1 TEST(ParseGetArguments, Single) { IHttpHandler::GetArguments b; @@ -140,7 +145,9 @@ ASSERT_EQ(1u, a.size()); ASSERT_EQ(a["aaa"], "baaa"); } +#endif +#if ORTHANC_SANDBOXED != 1 TEST(ParseGetArguments, SingleEmpty) { IHttpHandler::GetArguments b; @@ -152,7 +159,9 @@ ASSERT_EQ(1u, a.size()); ASSERT_EQ(a["aaa"], ""); } +#endif +#if ORTHANC_SANDBOXED != 1 TEST(ParseGetQuery, Test1) { UriComponents uri; @@ -171,7 +180,9 @@ ASSERT_EQ(a["bb"], "a"); ASSERT_EQ(a["aa"], "c"); } +#endif +#if ORTHANC_SANDBOXED != 1 TEST(ParseGetQuery, Test2) { UriComponents uri; @@ -187,6 +198,7 @@ ASSERT_EQ("world", uri[2]); ASSERT_EQ(0u, a.size()); } +#endif TEST(Uri, SplitUriComponents) { diff -r 83c5bd439fcc -r 9684a690ca63 OrthancFramework/UnitTestsSources/RestApiTests.cpp --- a/OrthancFramework/UnitTestsSources/RestApiTests.cpp Tue Nov 24 19:43:10 2020 +0100 +++ b/OrthancFramework/UnitTestsSources/RestApiTests.cpp Tue Nov 24 20:53:21 2020 +0100 @@ -179,6 +179,7 @@ } +#if ORTHANC_SANDBOXED != 1 TEST(RestApi, ParseCookies) { IHttpHandler::Arguments headers; @@ -207,6 +208,7 @@ ASSERT_EQ(1u, cookies.size()); ASSERT_EQ("v", cookies["n"]); } +#endif TEST(RestApi, RestApiPath)