Skip to content

Commit

Permalink
Move LOOLWebSocket into test/ - where it can be slowly removed.
Browse files Browse the repository at this point in the history
Change-Id: I388690261d323377648a1502b927e73f862ad802
Signed-off-by: Michael Meeks <[email protected]>
  • Loading branch information
mmeeks committed Oct 11, 2021
1 parent a2055d2 commit b043b62
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 81 deletions.
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,11 @@ shared_headers = common/Common.hpp \
common/FileUtil.hpp \
common/JailUtil.hpp \
common/Log.hpp \
common/LOOLWebSocket.hpp \
common/Protocol.hpp \
common/StringVector.hpp \
common/Seccomp.hpp \
common/Session.hpp \
common/Unit.hpp \
common/UnitHTTP.hpp \
common/Util.hpp \
common/ConfigUtil.hpp \
common/Authorization.hpp \
Expand Down Expand Up @@ -314,6 +312,8 @@ kit_headers = kit/ChildSession.hpp \
kit/Watermark.hpp

noinst_HEADERS = $(wsd_headers) $(shared_headers) $(kit_headers) \
tools/LOOLWebSocket.hpp \
test/UnitHTTP.hpp \
test/HttpTestServer.hpp \
test/WopiTestServer.hpp \
test/countloolkits.hpp \
Expand Down
1 change: 1 addition & 0 deletions common/FileUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <sys/mount.h>
#endif

#include <fcntl.h>
#include <chrono>
#include <cstdio>
#include <cstdlib>
Expand Down
8 changes: 1 addition & 7 deletions common/Unit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@
#include <memory>
#include <string>

#include <LOOLWebSocket.hpp>
#include "net/Socket.hpp"

class UnitBase;
class UnitWSD;
class UnitKit;
class UnitTimeout;
class UnitHTTPServerRequest;
class UnitHTTPServerResponse;

class WebSocketHandler;

Expand Down Expand Up @@ -295,10 +292,7 @@ class UnitWSD : public UnitBase
Client,
Prisoner
};
/// Simulate an incoming request
static void testHandleRequest(TestRequest type,
UnitHTTPServerRequest& request,
UnitHTTPServerResponse& response);

/// Do we have hooks for the Kit too
bool hasKitHooks() { return _hasKitHooks; }
/// set in your unit if you want to be injected into the kit too.
Expand Down
5 changes: 1 addition & 4 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ noinst_LTLIBRARIES = \
unit-convert.la unit-typing.la unit-copy-paste.la \
unit-timeout.la unit-prefork.la unit-storage.la \
unit-admin.la unit-tilecache.la \
unit-fuzz.la unit-oob.la unit-http.la unit-oauth.la \
unit-fuzz.la unit-http.la unit-oauth.la \
unit-wopi.la unit-wopi-saveas.la \
unit-wopi-async-upload-close.la unit-wopi-async-upload-modify.la \
unit-wopi-async-upload-modifyclose.la \
Expand Down Expand Up @@ -139,7 +139,6 @@ unit_crash_la_SOURCES = UnitClient.cpp httpcrashtest.cpp
unit_crash_la_LIBADD = $(CPPUNIT_LIBS)

# unit test modules:
unit_oob_la_SOURCES = UnitOOB.cpp
unit_http_la_SOURCES = UnitHTTP.cpp
unit_http_la_LIBADD = $(CPPUNIT_LIBS)
unit_fuzz_la_SOURCES = UnitFuzz.cpp
Expand Down Expand Up @@ -239,8 +238,6 @@ check-local:
./fakesockettest
@fc-cache "@LO_PATH@"/share/fonts/truetype

# FIXME 2: unit-oob.la fails with symbol undefined:
# UnitWSD::testHandleRequest(UnitWSD::TestRequest, UnitHTTPServerRequest&, UnitHTTPServerResponse&) ,
TESTS = \
unit-base.la unit-tiletest.la \
unit-integration.la unit-httpws.la unit-crash.la \
Expand Down
1 change: 0 additions & 1 deletion test/TileCacheTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include <Common.hpp>
#include <Protocol.hpp>
#include <LOOLWebSocket.hpp>
#include <MessageQueue.hpp>
#include <Png.hpp>
#include <TileCache.hpp>
Expand Down
1 change: 0 additions & 1 deletion test/UnitConvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include <Common.hpp>
#include <Protocol.hpp>
#include <LOOLWebSocket.hpp>
#include <Unit.hpp>
#include <Util.hpp>
#include <FileUtil.hpp>
Expand Down
1 change: 0 additions & 1 deletion test/UnitFuzz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include <Common.hpp>
#include <Protocol.hpp>
#include <LOOLWebSocket.hpp>
#include <Unit.hpp>
#include <Util.hpp>

Expand Down
2 changes: 1 addition & 1 deletion common/UnitHTTP.hpp → test/UnitHTTP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <Poco/Version.h>

#include "Common.hpp"
#include <LOOLWebSocket.hpp>
#include <tools/LOOLWebSocket.hpp>

using Poco::Net::SocketAddress;
using Poco::Net::HTTPServerParams;
Expand Down
47 changes: 0 additions & 47 deletions test/UnitOOB.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion test/helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <Common.hpp>
#include "Socket.hpp"
#include "common/FileUtil.hpp"
#include <LOOLWebSocket.hpp>
#include <tools/LOOLWebSocket.hpp>
#include <common/ConfigUtil.hpp>
#include <common/Util.hpp>
#include <net/WebSocketSession.hpp>
Expand Down
1 change: 0 additions & 1 deletion test/httpcrashtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <UserMessages.hpp>
#include <Util.hpp>
#include <Protocol.hpp>
#include <LOOLWebSocket.hpp>
#include <test.hpp>
#include <helpers.hpp>
#include <countloolkits.hpp>
Expand Down
1 change: 0 additions & 1 deletion test/httpwstest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include <Common.hpp>
#include <Protocol.hpp>
#include <LOOLWebSocket.hpp>

#include "lokassert.hpp"
#include <countloolkits.hpp>
Expand Down
2 changes: 1 addition & 1 deletion tools/Connect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include <Common.hpp>
#include <Protocol.hpp>
#include <LOOLWebSocket.hpp>
#include "LOOLWebSocket.hpp"
#include <Log.hpp>
#include <Util.hpp>

Expand Down
File renamed without changes.
13 changes: 0 additions & 13 deletions wsd/LOOLWSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ using Poco::Net::PartHandler;
#include "Storage.hpp"
#include "TraceFile.hpp"
#include <Unit.hpp>
#include <UnitHTTP.hpp>
#include "UserMessages.hpp"
#include <Util.hpp>
#include <common/ConfigUtil.hpp>
Expand Down Expand Up @@ -4511,18 +4510,6 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)

#if !MOBILEAPP

void UnitWSD::testHandleRequest(TestRequest type, UnitHTTPServerRequest& /* request */, UnitHTTPServerResponse& /* response */)
{
switch (type)
{
case TestRequest::Client:
break;
default:
assert(false);
break;
}
}

std::vector<std::shared_ptr<DocumentBroker>> LOOLWSD::getBrokersTestOnly()
{
std::lock_guard<std::mutex> docBrokersLock(DocBrokersMutex);
Expand Down

0 comments on commit b043b62

Please sign in to comment.