Skip to content

Commit

Permalink
iox-eclipse-iceoryx#190 Remove define public private from gateway test
Browse files Browse the repository at this point in the history
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
  • Loading branch information
elBoberido committed Jan 27, 2021
1 parent c1b5d9e commit b770992
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions iceoryx_posh/test/moduletests/test_gw_gateway_discovery.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -14,22 +14,25 @@

#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;

using CaproMessage = iox::capro::CaproMessage;
using BasePort = iox::popo::BasePort;
using InterfacePort = iox::popo::InterfacePort;

template <typename T>
class GatewayDiscoveryAccess : public iox::gw::GatewayDiscovery<T>
{
public:
GatewayDiscoveryAccess(T interfacePortImpl)
: iox::gw::GatewayDiscovery<T>(interfacePortImpl)
{
}
};

class InterfacePort_mock
{
Expand All @@ -53,7 +56,8 @@ class GatewayDiscovery_test : public Test
TEST_F(GatewayDiscovery_test, GetCaproMessage)
{
InterfacePort_mock interfacePortImplMock;
iox::gw::GatewayDiscovery<InterfacePort_mock> GatewayDiscovery(interfacePortImplMock);
iox::gw::GatewayDiscovery<InterfacePort_mock> GatewayDiscovery =
GatewayDiscoveryAccess<InterfacePort_mock>(interfacePortImplMock);
CaproMessage msg;
GatewayDiscovery.getCaproMessage(msg);
EXPECT_EQ(iox::capro::CaproMessageType::ACK, msg.m_type);
Expand Down

0 comments on commit b770992

Please sign in to comment.