From b770992b2ea62cdd407750565bd89403a0fc5c11 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 27 Jan 2021 12:55:26 +0100 Subject: [PATCH] iox-#190 Remove define public private from gateway test Signed-off-by: Mathias Kraus --- .../moduletests/test_gw_gateway_discovery.cpp | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/iceoryx_posh/test/moduletests/test_gw_gateway_discovery.cpp b/iceoryx_posh/test/moduletests/test_gw_gateway_discovery.cpp index 84d6302dc2..71f8264fac 100644 --- a/iceoryx_posh/test/moduletests/test_gw_gateway_discovery.cpp +++ b/iceoryx_posh/test/moduletests/test_gw_gateway_discovery.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2019, 2021 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,15 +14,9 @@ #include "test.hpp" -#define private public -#define protected public - #include "iceoryx_posh/gateway/gateway_discovery.hpp" #include "iceoryx_posh/internal/popo/ports/base_port.hpp" -#undef private -#undef protected - using namespace ::testing; using ::testing::Return; @@ -30,6 +24,15 @@ using CaproMessage = iox::capro::CaproMessage; using BasePort = iox::popo::BasePort; using InterfacePort = iox::popo::InterfacePort; +template +class GatewayDiscoveryAccess : public iox::gw::GatewayDiscovery +{ + public: + GatewayDiscoveryAccess(T interfacePortImpl) + : iox::gw::GatewayDiscovery(interfacePortImpl) + { + } +}; class InterfacePort_mock { @@ -53,7 +56,8 @@ class GatewayDiscovery_test : public Test TEST_F(GatewayDiscovery_test, GetCaproMessage) { InterfacePort_mock interfacePortImplMock; - iox::gw::GatewayDiscovery GatewayDiscovery(interfacePortImplMock); + iox::gw::GatewayDiscovery GatewayDiscovery = + GatewayDiscoveryAccess(interfacePortImplMock); CaproMessage msg; GatewayDiscovery.getCaproMessage(msg); EXPECT_EQ(iox::capro::CaproMessageType::ACK, msg.m_type);