diff options
| author | Stefan Boberg <[email protected]> | 2022-06-13 19:14:36 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2022-06-13 19:14:36 +0200 |
| commit | 34a265ec49715e7faa2275c8dfdeeb76c5aa9955 (patch) | |
| tree | 9b3c5b2b09dc2e9a015ebb2274ce7cf273ad83b7 /zenserver-test | |
| parent | added _WIN32_WINNT define to be consistent with xmake file (diff) | |
| download | zen-34a265ec49715e7faa2275c8dfdeeb76c5aa9955.tar.xz zen-34a265ec49715e7faa2275c8dfdeeb76c5aa9955.zip | |
trivial: removed some unnecessary WriteToString in unit tests
Diffstat (limited to 'zenserver-test')
| -rw-r--r-- | zenserver-test/zenserver-test.cpp | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/zenserver-test/zenserver-test.cpp b/zenserver-test/zenserver-test.cpp index caa13f067..46b566a47 100644 --- a/zenserver-test/zenserver-test.cpp +++ b/zenserver-test/zenserver-test.cpp @@ -1982,7 +1982,7 @@ TEST_CASE("zcache.rpc.allpolicies") cpr::Response Result = cpr::Post(cpr::Url{fmt::format("{}/$rpc", BaseUri)}, cpr::Header{{"Content-Type", "application/x-ue-cbpkg"}, {"Accept", "application/x-ue-cbpkg"}}, cpr::Body{(const char*)Body.GetData(), Body.GetSize()}); - CHECK_MESSAGE(Result.status_code == 200, WriteToString<32>("PutCacheRecords unexpectedly failed.").c_str()); + CHECK_MESSAGE(Result.status_code == 200, "PutCacheRecords unexpectedly failed."); } // PutCacheValues @@ -2022,7 +2022,7 @@ TEST_CASE("zcache.rpc.allpolicies") cpr::Response Result = cpr::Post(cpr::Url{fmt::format("{}/$rpc", BaseUri)}, cpr::Header{{"Content-Type", "application/x-ue-cbpkg"}, {"Accept", "application/x-ue-cbpkg"}}, cpr::Body{(const char*)Body.GetData(), Body.GetSize()}); - CHECK_MESSAGE(Result.status_code == 200, WriteToString<32>("PutCacheValues unexpectedly failed.").c_str()); + CHECK_MESSAGE(Result.status_code == 200, "PutCacheValues unexpectedly failed."); } for (KeyData& KeyData : KeyDatas) @@ -2075,14 +2075,13 @@ TEST_CASE("zcache.rpc.allpolicies") cpr::Response Result = cpr::Post(cpr::Url{fmt::format("{}/$rpc", BaseUri)}, cpr::Header{{"Content-Type", "application/x-ue-cbpkg"}, {"Accept", "application/x-ue-cbpkg"}}, cpr::Body{(const char*)Body.GetData(), Body.GetSize()}); - CHECK_MESSAGE(Result.status_code == 200, WriteToString<32>("GetCacheRecords unexpectedly failed.").c_str()); + CHECK_MESSAGE(Result.status_code == 200, "GetCacheRecords unexpectedly failed."); CbPackage Response; bool Loaded = Response.TryLoad(zen::IoBuffer(zen::IoBuffer::Wrap, Result.text.data(), Result.text.size())); - CHECK_MESSAGE(Loaded, WriteToString<32>("GetCacheRecords response failed to load.").c_str()); + CHECK_MESSAGE(Loaded, "GetCacheRecords response failed to load."); CbObjectView ResponseObject = Response.GetObject(); CbArrayView Responses = ResponseObject["Result"sv].AsArrayView(); - CHECK_MESSAGE(Responses.Num() == GetRequests.size(), - WriteToString<32>("GetCacheRecords response count did not match request count.").c_str()); + CHECK_MESSAGE(Responses.Num() == GetRequests.size(), "GetCacheRecords response count did not match request count."); int Index = 0; for (CbFieldView ResponseField : Responses) { @@ -2186,14 +2185,13 @@ TEST_CASE("zcache.rpc.allpolicies") cpr::Response Result = cpr::Post(cpr::Url{fmt::format("{}/$rpc", BaseUri)}, cpr::Header{{"Content-Type", "application/x-ue-cbpkg"}, {"Accept", "application/x-ue-cbpkg"}}, cpr::Body{(const char*)Body.GetData(), Body.GetSize()}); - CHECK_MESSAGE(Result.status_code == 200, WriteToString<32>("GetCacheValues unexpectedly failed.").c_str()); + CHECK_MESSAGE(Result.status_code == 200, "GetCacheValues unexpectedly failed."); CbPackage Response; bool Loaded = Response.TryLoad(zen::IoBuffer(zen::IoBuffer::Wrap, Result.text.data(), Result.text.size())); - CHECK_MESSAGE(Loaded, WriteToString<32>("GetCacheValues response failed to load.").c_str()); + CHECK_MESSAGE(Loaded, "GetCacheValues response failed to load."); CbObjectView ResponseObject = Response.GetObject(); CbArrayView Responses = ResponseObject["Result"sv].AsArrayView(); - CHECK_MESSAGE(Responses.Num() == GetValueRequests.size(), - WriteToString<32>("GetCacheValues response count did not match request count.").c_str()); + CHECK_MESSAGE(Responses.Num() == GetValueRequests.size(), "GetCacheValues response count did not match request count."); int Index = 0; for (CbFieldView RequestResultView : Responses) { @@ -2285,14 +2283,13 @@ TEST_CASE("zcache.rpc.allpolicies") cpr::Response Result = cpr::Post(cpr::Url{fmt::format("{}/$rpc", BaseUri)}, cpr::Header{{"Content-Type", "application/x-ue-cbpkg"}, {"Accept", "application/x-ue-cbpkg"}}, cpr::Body{(const char*)Body.GetData(), Body.GetSize()}); - CHECK_MESSAGE(Result.status_code == 200, WriteToString<32>("GetCacheChunks unexpectedly failed.").c_str()); + CHECK_MESSAGE(Result.status_code == 200, "GetCacheChunks unexpectedly failed."); CbPackage Response; bool Loaded = Response.TryLoad(zen::IoBuffer(zen::IoBuffer::Wrap, Result.text.data(), Result.text.size())); - CHECK_MESSAGE(Loaded, WriteToString<32>("GetCacheChunks response failed to load.").c_str()); + CHECK_MESSAGE(Loaded, "GetCacheChunks response failed to load."); CbObjectView ResponseObject = Response.GetObject(); CbArrayView Responses = ResponseObject["Result"sv].AsArrayView(); - CHECK_MESSAGE(Responses.Num() == ChunkRequests.size(), - WriteToString<32>("GetCacheChunks response count did not match request count.").c_str()); + CHECK_MESSAGE(Responses.Num() == ChunkRequests.size(), "GetCacheChunks response count did not match request count."); int Index = 0; for (CbFieldView RequestResultView : Responses) { @@ -2506,7 +2503,6 @@ private: // TEST_CASE(".exec.basic" /* * doctest::skip(true) */) //{ -//# if ZEN_WITH_EXEC_SERVICES // using namespace std::literals; // // std::filesystem::path TestDir = TestEnv.CreateNewTestDir(); @@ -2537,13 +2533,14 @@ private: // // CHECK(Result["exitcode"sv].AsInt32(-1) == 1); // } -//# endif // ZEN_WITH_EXEC_SERVICES // } +# endif // ZEN_WITH_EXEC_SERVICES + TEST_CASE("mesh.basic") { // --mesh option only available with ZEN_ENABLE_MESH -# if ZEN_ENABLE_MESH +# if ZEN_ENABLE_MESH using namespace std::literals; const int kInstanceCount = 4; @@ -2568,11 +2565,9 @@ TEST_CASE("mesh.basic") Instance->WaitUntilReady(); } -# endif +# endif } -# endif // ZEN_WITH_EXEC_SERVICES - class ZenServerTestHelper { public: |