summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2023-05-30 08:34:06 -0400
committerAshod Nakashian <Ashod@users.noreply.github.com>2023-06-20 03:55:19 -0400
commitb6a8ca439b316253dbc5d970ed9f70f658d64059 (patch)
treee6f35e8b616dc457917e58a8636b5a9eb5ae020a
parentwsd: test: reduce manual http header creation (diff)
downloadonline-b6a8ca439b316253dbc5d970ed9f70f658d64059.tar.gz
online-b6a8ca439b316253dbc5d970ed9f70f658d64059.zip
wsd: test: use sendAndShutdown
Instead of explicit send and shutdown calls. Change-Id: Ia08ccc003b1fa6c224d2cc9bc2520c722bf5752c Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
-rw-r--r--test/UnitWOPIFileUrl.cpp7
-rw-r--r--test/UnitWOPITemplate.cpp3
2 files changed, 4 insertions, 6 deletions
diff --git a/test/UnitWOPIFileUrl.cpp b/test/UnitWOPIFileUrl.cpp
index ea3d96342e..54efb2b04e 100644
--- a/test/UnitWOPIFileUrl.cpp
+++ b/test/UnitWOPIFileUrl.cpp
@@ -123,8 +123,8 @@ public:
const std::string filename = std::string(TDOC) + InvalidFilename;
LOG_TST("FakeWOPIHost: Request, WOPI::GetFile returning 404 for: " << filename);
- socket->send(http::Response(http::StatusCode::NotFound));
- socket->shutdown();
+ http::Response httpResponse(http::StatusCode::NotFound);
+ socket->sendAndShutdown(httpResponse);
return true;
}
@@ -162,8 +162,7 @@ public:
httpResponse.setBody("{\"LastModifiedTime\": \"" +
Util::getHttpTime(getFileLastModifiedTime()) + "\" }",
"application/json; charset=utf-8");
- socket->send(httpResponse);
- socket->shutdown();
+ socket->sendAndShutdown(httpResponse);
LOG_TST("Closing document after PutFile");
WSD_CMD("closedocument");
diff --git a/test/UnitWOPITemplate.cpp b/test/UnitWOPITemplate.cpp
index 9e1d5554e2..3edf5e8fde 100644
--- a/test/UnitWOPITemplate.cpp
+++ b/test/UnitWOPITemplate.cpp
@@ -70,8 +70,7 @@ public:
http::Response httpResponse(http::StatusCode::OK);
httpResponse.set("Allow", "GET");
- socket->send(httpResponse);
- socket->shutdown();
+ socket->sendAndShutdown(httpResponse);
return true;
}