diff options
| author | Stefan Boberg <[email protected]> | 2021-09-15 22:44:32 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-15 22:44:47 +0200 |
| commit | 8f889ca565f16f41420b5e9555d6479d6dddd725 (patch) | |
| tree | e7eb81c538cfc7a7e55ecefc6caf3cb04a1f0fa1 | |
| parent | Adde reminder that the content type is embedded in the IoBuffer (diff) | |
| download | zen-8f889ca565f16f41420b5e9555d6479d6dddd725.tar.xz zen-8f889ca565f16f41420b5e9555d6479d6dddd725.zip | |
Hooked up zenhttp to the test framework so tests actually run as part of zenserver-test
| -rw-r--r-- | zenhttp/httpserver.cpp | 9 | ||||
| -rw-r--r-- | zenhttp/include/zenhttp/httpserver.h | 4 | ||||
| -rw-r--r-- | zenhttp/include/zenhttp/zenhttp.h | 6 | ||||
| -rw-r--r-- | zenhttp/zenhttp.cpp | 13 | ||||
| -rw-r--r-- | zenhttp/zenhttp.vcxproj | 1 | ||||
| -rw-r--r-- | zenhttp/zenhttp.vcxproj.filters | 1 | ||||
| -rw-r--r-- | zenserver-test/zenserver-test.cpp | 2 |
7 files changed, 32 insertions, 4 deletions
diff --git a/zenhttp/httpserver.cpp b/zenhttp/httpserver.cpp index 5b5738fc4..f4a5f4345 100644 --- a/zenhttp/httpserver.cpp +++ b/zenhttp/httpserver.cpp @@ -525,7 +525,7 @@ CreateHttpServer() ////////////////////////////////////////////////////////////////////////// -TEST_CASE("http") +TEST_CASE("http.common") { using namespace std::literals; @@ -551,7 +551,12 @@ TEST_CASE("http") { for (uint8_t i = 0; i < uint8_t(HttpContentType::kCOUNT); ++i) { - CHECK_EQ(HttpContentType(i), ParseContentType(MapContentTypeToString(HttpContentType(i)))); + HttpContentType Ct{i}; + + if (Ct != HttpContentType::kUnknownContentType) + { + CHECK_EQ(Ct, ParseContentType(MapContentTypeToString(Ct))); + } } } } diff --git a/zenhttp/include/zenhttp/httpserver.h b/zenhttp/include/zenhttp/httpserver.h index de097ceb3..f656c69a8 100644 --- a/zenhttp/include/zenhttp/httpserver.h +++ b/zenhttp/include/zenhttp/httpserver.h @@ -268,6 +268,6 @@ private: std::unordered_map<std::string, std::string> m_PatternMap; }; -} // namespace zen - void http_forcelink(); // internal + +} // namespace zen diff --git a/zenhttp/include/zenhttp/zenhttp.h b/zenhttp/include/zenhttp/zenhttp.h index c6ec92e7c..586fc98b4 100644 --- a/zenhttp/include/zenhttp/zenhttp.h +++ b/zenhttp/include/zenhttp/zenhttp.h @@ -5,3 +5,9 @@ #include <zencore/zencore.h> #define ZENHTTP_API // Placeholder to allow DLL configs in the future + +namespace zen { + + ZENHTTP_API void zenhttp_forcelinktests(); + +} diff --git a/zenhttp/zenhttp.cpp b/zenhttp/zenhttp.cpp new file mode 100644 index 000000000..148cf4499 --- /dev/null +++ b/zenhttp/zenhttp.cpp @@ -0,0 +1,13 @@ +#include <zenhttp/zenhttp.h> + +#include <zenhttp/httpserver.h> + +namespace zen { + +void +zenhttp_forcelinktests() +{ + http_forcelink(); +} + +}
\ No newline at end of file diff --git a/zenhttp/zenhttp.vcxproj b/zenhttp/zenhttp.vcxproj index 3536d1929..eca9898d3 100644 --- a/zenhttp/zenhttp.vcxproj +++ b/zenhttp/zenhttp.vcxproj @@ -100,6 +100,7 @@ <ClCompile Include="httpsys.cpp" /> <ClCompile Include="httpuws.cpp" /> <ClCompile Include="iothreadpool.cpp" /> + <ClCompile Include="zenhttp.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="httpnull.h" /> diff --git a/zenhttp/zenhttp.vcxproj.filters b/zenhttp/zenhttp.vcxproj.filters index da292c18f..17f71bed1 100644 --- a/zenhttp/zenhttp.vcxproj.filters +++ b/zenhttp/zenhttp.vcxproj.filters @@ -8,6 +8,7 @@ <ClCompile Include="httpnull.cpp" /> <ClCompile Include="httpuws.cpp" /> <ClCompile Include="httpshared.cpp" /> + <ClCompile Include="zenhttp.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="include\zenhttp\httpclient.h" /> diff --git a/zenserver-test/zenserver-test.cpp b/zenserver-test/zenserver-test.cpp index 1ae3f39fa..213648319 100644 --- a/zenserver-test/zenserver-test.cpp +++ b/zenserver-test/zenserver-test.cpp @@ -14,6 +14,7 @@ #include <zencore/string.h> #include <zencore/thread.h> #include <zencore/timer.h> +#include <zenhttp/zenhttp.h> #include <zenhttp/httpclient.h> #include <zenserverprocess.h> @@ -658,6 +659,7 @@ main(int argc, char** argv) mi_version(); zencore_forcelinktests(); + zen::zenhttp_forcelinktests(); zen::logging::InitializeLogging(); |