- (weird) linker error on windows caused by using different include.
- IpcTests using private field which had a public accessor.
- some includes using wrong lib.
This commit is contained in:
Nick Bolton 2014-02-28 15:04:49 +00:00
parent ad8905ccbf
commit f4bb72ce52
14 changed files with 22 additions and 50 deletions

View File

@ -1,25 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Bolton Software Ltd.
* Copyright (C) 2011 Chris Schoeneman
*
* 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 COPYING that should have accompanied this file.
*
* 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/>.
*/
#pragma once
// make everything public for unit tests
#ifdef TEST_ENV
#define protected public
#define private public
#endif

View File

@ -17,7 +17,7 @@
#include "arch/ArchInternetUnix.h" #include "arch/ArchInternetUnix.h"
#include <gtest/gtest.h> #include "test/global/gtest.h"
#define TEST_URL "https://synergy-foss.org/tests/?testString" #define TEST_URL "https://synergy-foss.org/tests/?testString"
//#define TEST_URL "http://localhost/synergy/tests/?testString" //#define TEST_URL "http://localhost/synergy/tests/?testString"

View File

@ -17,7 +17,7 @@
#include "arch/ArchInternetWindows.h" #include "arch/ArchInternetWindows.h"
#include <gtest/gtest.h> #include "test/global/gtest.h"
#define TEST_URL "https://synergy-foss.org/tests/?testString" #define TEST_URL "https://synergy-foss.org/tests/?testString"
//#define TEST_URL "http://localhost/synergy/tests/?testString" //#define TEST_URL "http://localhost/synergy/tests/?testString"

View File

@ -21,7 +21,6 @@
#define TEST_ENV #define TEST_ENV
#include "test/global/access.h"
#include "test/global/TestEventQueue.h" #include "test/global/TestEventQueue.h"
#include "ipc/IpcServer.h" #include "ipc/IpcServer.h"
#include "ipc/IpcClient.h" #include "ipc/IpcClient.h"
@ -38,7 +37,7 @@
#include "base/EventQueue.h" #include "base/EventQueue.h"
#include "base/TMethodEventJob.h" #include "base/TMethodEventJob.h"
#include <gtest/gtest.h> #include "test/global/gtest.h"
#define TEST_IPC_PORT 24802 #define TEST_IPC_PORT 24802
@ -161,7 +160,7 @@ void
CIpcTests::connectToServer_handleMessageReceived(const CEvent& e, void*) CIpcTests::connectToServer_handleMessageReceived(const CEvent& e, void*)
{ {
CIpcMessage* m = static_cast<CIpcMessage*>(e.getDataObject()); CIpcMessage* m = static_cast<CIpcMessage*>(e.getDataObject());
if (m->m_type == kIpcHello) { if (m->type() == kIpcHello) {
m_connectToServer_hasClientNode = m_connectToServer_hasClientNode =
m_connectToServer_server->hasClients(kIpcClientNode); m_connectToServer_server->hasClients(kIpcClientNode);
m_connectToServer_helloMessageReceived = true; m_connectToServer_helloMessageReceived = true;
@ -173,12 +172,12 @@ void
CIpcTests::sendMessageToServer_serverHandleMessageReceived(const CEvent& e, void*) CIpcTests::sendMessageToServer_serverHandleMessageReceived(const CEvent& e, void*)
{ {
CIpcMessage* m = static_cast<CIpcMessage*>(e.getDataObject()); CIpcMessage* m = static_cast<CIpcMessage*>(e.getDataObject());
if (m->m_type == kIpcHello) { if (m->type() == kIpcHello) {
LOG((CLOG_DEBUG "client said hello, sending test to server")); LOG((CLOG_DEBUG "client said hello, sending test to server"));
CIpcCommandMessage m("test", true); CIpcCommandMessage m("test", true);
m_sendMessageToServer_client->send(m); m_sendMessageToServer_client->send(m);
} }
else if (m->m_type == kIpcCommand) { else if (m->type() == kIpcCommand) {
CIpcCommandMessage* cm = static_cast<CIpcCommandMessage*>(m); CIpcCommandMessage* cm = static_cast<CIpcCommandMessage*>(m);
LOG((CLOG_DEBUG "got ipc command message, %d", cm->command().c_str())); LOG((CLOG_DEBUG "got ipc command message, %d", cm->command().c_str()));
m_sendMessageToServer_receivedString = cm->command(); m_sendMessageToServer_receivedString = cm->command();
@ -190,7 +189,7 @@ void
CIpcTests::sendMessageToClient_serverHandleClientConnected(const CEvent& e, void*) CIpcTests::sendMessageToClient_serverHandleClientConnected(const CEvent& e, void*)
{ {
CIpcMessage* m = static_cast<CIpcMessage*>(e.getDataObject()); CIpcMessage* m = static_cast<CIpcMessage*>(e.getDataObject());
if (m->m_type == kIpcHello) { if (m->type() == kIpcHello) {
LOG((CLOG_DEBUG "client said hello, sending test to client")); LOG((CLOG_DEBUG "client said hello, sending test to client"));
CIpcLogLineMessage m("test"); CIpcLogLineMessage m("test");
m_sendMessageToClient_server->send(m, kIpcClientNode); m_sendMessageToClient_server->send(m, kIpcClientNode);
@ -201,7 +200,7 @@ void
CIpcTests::sendMessageToClient_clientHandleMessageReceived(const CEvent& e, void*) CIpcTests::sendMessageToClient_clientHandleMessageReceived(const CEvent& e, void*)
{ {
CIpcMessage* m = static_cast<CIpcMessage*>(e.getDataObject()); CIpcMessage* m = static_cast<CIpcMessage*>(e.getDataObject());
if (m->m_type == kIpcLogLine) { if (m->type() == kIpcLogLine) {
CIpcLogLineMessage* llm = static_cast<CIpcLogLineMessage*>(m); CIpcLogLineMessage* llm = static_cast<CIpcLogLineMessage*>(m);
LOG((CLOG_DEBUG "got ipc log message, %d", llm->logLine().c_str())); LOG((CLOG_DEBUG "got ipc log message, %d", llm->logLine().c_str()));
m_sendMessageToClient_receivedString = llm->logLine(); m_sendMessageToClient_receivedString = llm->logLine();

View File

@ -38,7 +38,7 @@
#include "base/TMethodJob.h" #include "base/TMethodJob.h"
#include "base/Log.h" #include "base/Log.h"
#include <gtest/gtest.h> #include "test/global/gtest.h"
#include <stdexcept> #include <stdexcept>
#include <sstream> #include <sstream>
#include <fstream> #include <fstream>

View File

@ -19,8 +19,8 @@
#include "platform/MSWindowsClipboard.h" #include "platform/MSWindowsClipboard.h"
#include "platform/IMSWindowsClipboardFacade.h" #include "platform/IMSWindowsClipboardFacade.h"
#include <gmock/gmock.h> #include "test/global/gmock.h"
#include <gtest/gtest.h> #include "test/global/gtest.h"
class CMSWindowsClipboardTests : public ::testing::Test class CMSWindowsClipboardTests : public ::testing::Test
{ {

View File

@ -18,17 +18,16 @@
#define TEST_ENV #define TEST_ENV
#include "test/global/access.h" #include "test/mock/synergy/MockEventQueue.h"
#include "test/mock/synergy/MockKeyMap.h"
#include "platform/MSWindowsKeyState.h" #include "platform/MSWindowsKeyState.h"
#include "platform/MSWindowsDesks.h" #include "platform/MSWindowsDesks.h"
#include "platform/MSWindowsScreen.h" #include "platform/MSWindowsScreen.h"
#include "platform/MSWindowsScreenSaver.h" #include "platform/MSWindowsScreenSaver.h"
#include "synergy/CMockEventQueue.h"
#include "synergy/CMockKeyMap.h"
#include "base/TMethodJob.h" #include "base/TMethodJob.h"
#include <gtest/gtest.h> #include "test/global/gtest.h"
#include <gmock/gmock.h> #include "test/global/gmock.h"
// wParam = flags, HIBYTE(lParam) = virtual key, LOBYTE(lParam) = scan code // wParam = flags, HIBYTE(lParam) = virtual key, LOBYTE(lParam) = scan code
#define SYNERGY_MSG_FAKE_KEY SYNERGY_HOOK_LAST_MSG + 4 #define SYNERGY_MSG_FAKE_KEY SYNERGY_HOOK_LAST_MSG + 4

View File

@ -15,7 +15,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "test/global/access.h"
#include "platform/OSXScreen.h" #include "platform/OSXScreen.h"
#include "arch/Arch.h" #include "arch/Arch.h"
#include "base/EventQueue.h" #include "base/EventQueue.h"

View File

@ -18,7 +18,7 @@
#include "platform/XWindowsClipboard.h" #include "platform/XWindowsClipboard.h"
#include <gtest/gtest.h> #include "test/global/gtest.h"
#include <iostream> #include <iostream>
class CXWindowsClipboardTests : public ::testing::Test class CXWindowsClipboardTests : public ::testing::Test

View File

@ -32,8 +32,8 @@
# include <X11/XKBlib.h> # include <X11/XKBlib.h>
#endif #endif
#include <gtest/gtest.h> #include "test/global/gtest.h"
#include <gmock/gmock.h> #include "test/global/gmock.h"
#include <errno.h> #include <errno.h>
class CXWindowsKeyStateTests : public ::testing::Test class CXWindowsKeyStateTests : public ::testing::Test

View File

@ -22,7 +22,7 @@
#include "test/mock/synergy/MockEventQueue.h" #include "test/mock/synergy/MockEventQueue.h"
#include "platform/XWindowsScreenSaver.h" #include "platform/XWindowsScreenSaver.h"
#include <gtest/gtest.h> #include "test/global/gtest.h"
#include <X11/Xlib.h> #include <X11/Xlib.h>
using ::testing::_; using ::testing::_;

View File

@ -19,7 +19,7 @@
#include "platform/XWindowsScreen.h" #include "platform/XWindowsScreen.h"
#include "synergy/CMockEventQueue.h" #include "synergy/CMockEventQueue.h"
#include <gtest/gtest.h> #include "test/global/gtest.h"
using ::testing::_; using ::testing::_;

View File

@ -19,7 +19,7 @@
#define TEST_ENV #define TEST_ENV
#include "synergy/PrimaryClient.h" #include "server/PrimaryClient.h"
#include "base/String.h" #include "base/String.h"
#include "test/global/gmock.h" #include "test/global/gmock.h"

View File

@ -21,7 +21,7 @@
#include "server/Server.h" #include "server/Server.h"
#include <gmock/gmock.h> #include "test/global/gmock.h"
class IEventQueue; class IEventQueue;