deskflow/src/test/integtests/ipc/IpcTests.cpp

197 lines
6.6 KiB
C++
Raw Normal View History

2012-06-28 07:29:06 +00:00
/*
* synergy -- mouse and keyboard sharing utility
2016-09-07 14:24:00 +00:00
* Copyright (C) 2012-2016 Symless Ltd.
2012-06-28 07:29:06 +00:00
* Copyright (C) 2012 Nick Bolton
*
2012-06-28 07:29:06 +00:00
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file LICENSE that should have accompanied this file.
*
2012-06-28 07:29:06 +00:00
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// TODO: fix, tests failing intermittently on mac.
#ifndef WINAPI_CARBON
2012-07-02 15:28:23 +00:00
#define TEST_ENV
#include "arch/Arch.h"
#include "base/EventQueue.h"
#include "base/Log.h"
#include "base/String.h"
#include "base/TMethodEventJob.h"
#include "base/TMethodJob.h"
#include "ipc/IpcClient.h"
#include "ipc/IpcClientProxy.h"
#include "ipc/IpcMessage.h"
#include "ipc/IpcServer.h"
#include "ipc/IpcServerProxy.h"
#include "mt/Thread.h"
#include "net/SocketMultiplexer.h"
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
#include "shared/Ipc.h"
#include "test/shared/TestEventQueue.h"
Solve SonarCloud security hotspots and bugs (#7383) * Test: allocLockCursorToScreenInfo_withState_setsState * Merge remote-tracking branch 'origin/master' into S1-1717-sonarcloud-issues * Remove header wrappers for gmock/gtest * Convenience wrapper script for tests * Use `std::copy` instead of `strcpy` * Use `std::ranges::copy` instead of `stdcpy` * Delete dead code * Add guitests VS Code config and test wrapper * Revert "Delete dead code" This reverts commit aa40f5cd35a22b4b69acfd1876aceea053088060. * Build guitests with CMake * Run all tests * Don't use --gtest_filter for Qt tests * Undo skip for GUI tests * Coverage for `IpcClient::sendCommand` * Remove provider and proxy * Use lamda for StreamProvider to reduce boilerplate * Restore version checker tests * Remove activation souces * Tasks for current/all tests * Change command for tasks * Mock QNetworkAccessManager * Create core app to satisfy Qt assertations * Use `std::copy` instead of `std::ranges::copy` * Remove integtests * Merge guitests into unittests * Use std::string::length * Remove include (resolves to root) * Fix memory leaks * Disable sigsegv tests * Fixed formatting * Remove guitests from CI * New MainWindowTests * Passing test for MainWindowTests * Use alternative to strlen in MainWindow::checkSecureSocket * Passing test for Log::print * Fixed dtor call order * Fixed var name typo * Use proxy instead of `#define protected public` * Add args test for log * Add license ctor * Fixed log test for release * Add error log test * Init qt with -platform offscreen * Back-out initQt function * Use QT_QPA_PLATFORM * Try QT_QPA_PLATFORM=offscreen * Use more readable env node * Set QT_QPA_PLATFORM in CI and CodeQL * Remove env not needed * Modernize Log::print * Calculate the length of the format string fmt during the initial scan loop * More direct and efficient alterative to `strlen` * Fixed major maint issues in AppConfig * New clang and cmake rules * Set `max_pargs_hwrap` to 4 * Undo clang format for now * Fix missing `Setting::` * Fixed missing `m_S` on Windows * Re-add accidental dep resolution (fix later) * Fixed missing buffer position increment * Turn on errors * Fixed tests and improve error message * Fixed segfault on log refactor * Extract log time to function * Copyright date * Update ChangeLog
2024-07-16 08:30:35 +00:00
#include <gtest/gtest.h>
2012-06-28 07:29:06 +00:00
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
const int kTestPort = 24802;
class IpcTests : public ::testing::Test {
2012-07-01 21:18:21 +00:00
public:
IpcTests();
virtual ~IpcTests();
2012-07-01 21:18:21 +00:00
void connectToServer_handleMessageReceived(const Event &, void *);
void sendMessageToServer_serverHandleMessageReceived(const Event &, void *);
void sendMessageToClient_serverHandleClientConnected(const Event &, void *);
void sendMessageToClient_clientHandleMessageReceived(const Event &, void *);
public:
SocketMultiplexer m_multiplexer;
bool m_connectToServer_helloMessageReceived;
bool m_connectToServer_hasClientNode;
IpcServer *m_connectToServer_server;
String m_sendMessageToServer_receivedString;
String m_sendMessageToClient_receivedString;
IpcClient *m_sendMessageToServer_client;
IpcServer *m_sendMessageToClient_server;
TestEventQueue m_events;
2012-07-01 21:18:21 +00:00
};
TEST_F(IpcTests, connectToServer) {
SocketMultiplexer socketMultiplexer;
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
IpcServer server(&m_events, &socketMultiplexer, kTestPort);
server.listen();
m_connectToServer_server = &server;
2012-07-02 13:45:52 +00:00
m_events.adoptHandler(
m_events.forIpcServer().messageReceived(), &server,
new TMethodEventJob<IpcTests>(
this, &IpcTests::connectToServer_handleMessageReceived));
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
IpcClient client(&m_events, &socketMultiplexer, kTestPort);
client.connect();
m_events.initQuitTimeout(5);
m_events.loop();
m_events.removeHandler(m_events.forIpcServer().messageReceived(), &server);
m_events.cleanupQuitTimeout();
2012-07-01 21:18:21 +00:00
EXPECT_EQ(true, m_connectToServer_helloMessageReceived);
EXPECT_EQ(true, m_connectToServer_hasClientNode);
2012-07-02 15:28:23 +00:00
}
TEST_F(IpcTests, sendMessageToServer) {
SocketMultiplexer socketMultiplexer;
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
IpcServer server(&m_events, &socketMultiplexer, kTestPort);
server.listen();
// event handler sends "test" command to server.
m_events.adoptHandler(
m_events.forIpcServer().messageReceived(), &server,
new TMethodEventJob<IpcTests>(
this, &IpcTests::sendMessageToServer_serverHandleMessageReceived));
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
IpcClient client(&m_events, &socketMultiplexer, kTestPort);
client.connect();
m_sendMessageToServer_client = &client;
m_events.initQuitTimeout(5);
m_events.loop();
m_events.removeHandler(m_events.forIpcServer().messageReceived(), &server);
m_events.cleanupQuitTimeout();
EXPECT_EQ("test", m_sendMessageToServer_receivedString);
2012-06-28 07:29:06 +00:00
}
2012-07-01 21:18:21 +00:00
TEST_F(IpcTests, sendMessageToClient) {
SocketMultiplexer socketMultiplexer;
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
IpcServer server(&m_events, &socketMultiplexer, kTestPort);
server.listen();
m_sendMessageToClient_server = &server;
// event handler sends "test" log line to client.
m_events.adoptHandler(
m_events.forIpcServer().messageReceived(), &server,
new TMethodEventJob<IpcTests>(
this, &IpcTests::sendMessageToClient_serverHandleClientConnected));
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
IpcClient client(&m_events, &socketMultiplexer, kTestPort);
client.connect();
m_events.adoptHandler(
m_events.forIpcClient().messageReceived(), &client,
new TMethodEventJob<IpcTests>(
this, &IpcTests::sendMessageToClient_clientHandleMessageReceived));
m_events.initQuitTimeout(5);
m_events.loop();
m_events.removeHandler(m_events.forIpcServer().messageReceived(), &server);
m_events.removeHandler(m_events.forIpcClient().messageReceived(), &client);
m_events.cleanupQuitTimeout();
EXPECT_EQ("test", m_sendMessageToClient_receivedString);
2012-07-01 21:18:21 +00:00
}
IpcTests::IpcTests()
: m_connectToServer_helloMessageReceived(false),
m_connectToServer_hasClientNode(false),
m_connectToServer_server(nullptr),
m_sendMessageToClient_server(nullptr),
m_sendMessageToServer_client(nullptr) {}
IpcTests::~IpcTests() {}
void IpcTests::connectToServer_handleMessageReceived(const Event &e, void *) {
IpcMessage *m = static_cast<IpcMessage *>(e.getDataObject());
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
if (m->type() == IpcMessageType::Hello) {
m_connectToServer_hasClientNode =
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
m_connectToServer_server->hasClients(IpcClientType::Node);
m_connectToServer_helloMessageReceived = true;
m_events.raiseQuitEvent();
}
2012-07-02 13:45:52 +00:00
}
2012-07-01 21:18:21 +00:00
void IpcTests::sendMessageToServer_serverHandleMessageReceived(
const Event &e, void *) {
IpcMessage *m = static_cast<IpcMessage *>(e.getDataObject());
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
if (m->type() == IpcMessageType::Hello) {
LOG((CLOG_DEBUG "client said hello, sending test to server"));
IpcCommandMessage m("test", true);
m_sendMessageToServer_client->send(m);
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
} else if (m->type() == IpcMessageType::Command) {
IpcCommandMessage *cm = static_cast<IpcCommandMessage *>(m);
LOG((CLOG_DEBUG "got ipc command message, %d", cm->command().c_str()));
m_sendMessageToServer_receivedString = cm->command();
m_events.raiseQuitEvent();
}
2012-07-01 21:18:21 +00:00
}
void IpcTests::sendMessageToClient_serverHandleClientConnected(
const Event &e, void *) {
IpcMessage *m = static_cast<IpcMessage *>(e.getDataObject());
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
if (m->type() == IpcMessageType::Hello) {
LOG((CLOG_DEBUG "client said hello, sending test to client"));
IpcLogLineMessage m("test");
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
m_sendMessageToClient_server->send(m, IpcClientType::Node);
}
2012-07-02 15:28:23 +00:00
}
void IpcTests::sendMessageToClient_clientHandleMessageReceived(
const Event &e, void *) {
IpcMessage *m = static_cast<IpcMessage *>(e.getDataObject());
Solve low hanging reliability and maintainability issues (#7403) * Add missing atom ctor init * Init members with `None` * Use in-class init and delcare getter inside if init * Temp revert of changes ahead of unit test repair * Move IPC header to shared, restore X clipboard test, simplify test cmake, new X clipboard unit test * Suppress sonar for undefs * Remove base dir include * Revert "Temp revert of changes ahead of unit test repair" This reverts commit 8f84b6ea5d5828f1be1362de3809279bcacb8cc8. * Use new accessor * Use default dtor * Beef up to 32 core * Use enum class * Make IPC protocol headers const at all levels * Use enum class and const char for better type safety * Use unique_ptr for m_clipboard * Use `-j` instead of `-j8` to utilize full parallelism * Increase thread count for sonar-scanner * Use 32 threads * Use in-class init for IpcClientProxy members * Use const instead of #define * Remove ctor member inits * Use unique_ptr on win * Implement temp bin dir for windows with more robust post-build copy * Fixed missing iostream * Add warning about copy errors * Only run clean-gcda on Linux * Use in-class init for IPC mutex * Do no-op on Windows * Hide clean-gcda task * Move flakey test to integtests * Delete dead code * Test * Temp disable post_config_all * Disable post config step * Revert "Disable post config step" This reverts commit 2f956a7714ba9bedacd4b39d4ae00940c3d565d6. * Revert "Temp disable post_config_all" This reverts commit b44ed72e44f838bfe1309f6e9672d2f1c6f21b75. * Restore -j8 * Simplify error handling * Use const for test port * Remove python check * Update changelog * Fixed order * Fixed bad issue number * Fixed bin copy source path * Remove redundant except
2024-07-18 07:04:39 +00:00
if (m->type() == IpcMessageType::LogLine) {
IpcLogLineMessage *llm = static_cast<IpcLogLineMessage *>(m);
LOG((CLOG_DEBUG "got ipc log message, %d", llm->logLine().c_str()));
m_sendMessageToClient_receivedString = llm->logLine();
m_events.raiseQuitEvent();
}
2012-07-02 15:28:23 +00:00
}
#endif // WINAPI_CARBON