Skip to content

Commit

Permalink
Merge pull request #688 from ApexAI/iox-#14-consolidate-chunk-mocks
Browse files Browse the repository at this point in the history
Iox #14 consolidate chunk mocks
  • Loading branch information
elBoberido authored Apr 8, 2021
2 parents 449d3eb + edc9dfb commit a62858e
Show file tree
Hide file tree
Showing 76 changed files with 205 additions and 236 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ See [Eclipse iceoryx 1.0.0 (Almond)](https://projects.eclipse.org/projects/techn
- iceoryx libs should be build as static libs [\#509](https://github.com/eclipse-iceoryx/iceoryx/issues/509)
- Build with gcov is broken [\#497](https://github.com/eclipse-iceoryx/iceoryx/issues/497)

## [v0.99.x](https://github.com/eclipse-iceoryx/iceoryx/tree/v0.99.x) (2021-04-xx)

[Full Changelog](https://github.com/eclipse-iceoryx/iceoryx/compare/v0.99.6...v0.99.x)

- cleanup testing libraries; if used outside of iceoryx, include paths and link targets must be adjusted

## [v0.99.6](https://github.com/eclipse-iceoryx/iceoryx/tree/v0.99.6) (2021-04-08)

[Full Changelog](https://github.com/eclipse-iceoryx/iceoryx/compare/v0.99.5...v0.99.6)
Expand Down
3 changes: 2 additions & 1 deletion iceoryx_binding_c/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cmake_minimum_required(VERSION 3.5)
project(test_binding_c VERSION 0)

find_package(iceoryx_utils_testing REQUIRED)
find_package(iceoryx_posh_testing REQUIRED)
find_package(GTest CONFIG REQUIRED)

set(PROJECT_PREFIX "binding_c")
Expand All @@ -35,7 +36,7 @@ set(TEST_LINK_LIBS
iceoryx_posh::iceoryx_posh
iceoryx_posh::iceoryx_posh_config
iceoryx_posh::iceoryx_posh_roudi
iceoryx_posh::iceoryx_posh_roudi_environment
iceoryx_posh_testing::iceoryx_posh_testing
)

if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_binding_c/test/moduletests/test_chunk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extern "C" {
#include "iceoryx_binding_c/runtime.h"
}

#include "testutils/roudi_gtest.hpp"
#include "iceoryx_posh/testing/roudi_gtest.hpp"

namespace
{
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_binding_c/test/moduletests/test_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "iceoryx_posh/mepoo/mepoo_config.hpp"
#include "iceoryx_posh/popo/listener.hpp"
#include "iceoryx_posh/popo/user_trigger.hpp"
#include "testutils/timing_test.hpp"
#include "iceoryx_utils/testing/timing_test.hpp"

using namespace iox;
using namespace iox::popo;
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_binding_c/test/moduletests/test_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// SPDX-License-Identifier: Apache-2.0

#include "iceoryx_posh/runtime/posh_runtime.hpp"
#include "testutils/roudi_gtest.hpp"
#include "iceoryx_posh/testing/roudi_gtest.hpp"

using namespace iox;
using namespace iox::runtime;
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_binding_c/test/moduletests/test_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include "iceoryx_posh/internal/popo/building_blocks/chunk_queue_popper.hpp"
#include "iceoryx_posh/internal/popo/ports/publisher_port_roudi.hpp"
#include "iceoryx_posh/internal/popo/ports/publisher_port_user.hpp"
#include "iceoryx_posh/internal/roudi_environment/roudi_environment.hpp"
#include "iceoryx_posh/mepoo/mepoo_config.hpp"
#include "iceoryx_posh/testing/roudi_environment/roudi_environment.hpp"

using namespace iox;
using namespace iox::popo;
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_binding_c/test/moduletests/test_runtime.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020 by Apex.AI Inc. All rights reserved.
// Copyright (c) 2020 - 2021 by 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 @@ -19,7 +19,7 @@ extern "C" {
}

#include "iceoryx_posh/iceoryx_posh_types.hpp"
#include "testutils/roudi_gtest.hpp"
#include "iceoryx_posh/testing/roudi_gtest.hpp"

using namespace iox;
using namespace iox::runtime;
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_binding_c/test/moduletests/test_subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include "iceoryx_posh/internal/popo/building_blocks/chunk_queue_pusher.hpp"
#include "iceoryx_posh/internal/popo/ports/subscriber_port_single_producer.hpp"
#include "iceoryx_posh/internal/popo/ports/subscriber_port_user.hpp"
#include "iceoryx_posh/internal/roudi_environment/roudi_environment.hpp"
#include "iceoryx_posh/mepoo/mepoo_config.hpp"
#include "iceoryx_posh/testing/roudi_environment/roudi_environment.hpp"
#include "mocks/wait_set_mock.hpp"

using namespace iox;
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_binding_c/test/moduletests/test_wait_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include "iceoryx_binding_c/internal/cpp2c_subscriber.hpp"
#include "iceoryx_posh/iceoryx_posh_types.hpp"
#include "iceoryx_posh/internal/popo/ports/subscriber_port_user.hpp"
#include "iceoryx_utils/testing/timing_test.hpp"
#include "mocks/wait_set_mock.hpp"
#include "testutils/timing_test.hpp"

using namespace iox;
using namespace iox::popo;
Expand Down
2 changes: 2 additions & 0 deletions iceoryx_dds/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cmake_minimum_required(VERSION 3.5)
project(test_iox_to_dds VERSION 0)

find_package(iceoryx_utils_testing REQUIRED)
find_package(iceoryx_posh_testing REQUIRED)
find_package(GTest CONFIG REQUIRED)

set(PROJECT_PREFIX "dds_gateway")
Expand All @@ -32,6 +33,7 @@ set(TEST_LINK_LIBS
iceoryx_utils::iceoryx_utils
iceoryx_utils_testing::iceoryx_utils_testing
iceoryx_posh::iceoryx_posh
iceoryx_posh_testing::iceoryx_posh_testing
iceoryx_dds::iceoryx_dds
)

Expand Down
4 changes: 2 additions & 2 deletions iceoryx_dds/test/helpers/fixture_dds_gateway.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2020 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved.
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2021 by 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 @@ -21,7 +22,6 @@

#include "mocks/google_mocks.hpp"
#include "test.hpp"
#include "testutils/roudi_gtest.hpp"

template <typename IceoryxTerminal, typename DDSTerminal>
class DDSGatewayTestFixture : public Test
Expand Down
102 changes: 0 additions & 102 deletions iceoryx_dds/test/mocks/chunk_mock_dds.hpp

This file was deleted.

5 changes: 2 additions & 3 deletions iceoryx_dds/test/moduletests/test_dds_to_iox.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2020 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved.
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2020 - 2021 by 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 @@ -19,10 +20,8 @@
#include "iceoryx_dds/gateway/dds_to_iox.hpp"
#include "iceoryx_posh/gateway/channel.hpp"

#include "mocks/chunk_mock_dds.hpp"
#include "mocks/google_mocks.hpp"
#include "test.hpp"
#include "testutils/roudi_gtest.hpp"

using namespace ::testing;
using ::testing::_;
Expand Down
12 changes: 6 additions & 6 deletions iceoryx_dds/test/moduletests/test_iox_to_dds.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2020 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved.
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2020 - 2021 by 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 @@ -25,10 +26,9 @@
#include "iceoryx_utils/cxx/expected.hpp"
#include "iceoryx_utils/cxx/optional.hpp"

#include "mocks/chunk_mock_dds.hpp"
#include "iceoryx_posh/testing/mocks/chunk_mock.hpp"
#include "mocks/google_mocks.hpp"
#include "test.hpp"
#include "testutils/roudi_gtest.hpp"

#include <limits>

Expand Down Expand Up @@ -194,7 +194,7 @@ TEST_F(Iceoryx2DDSGatewayTest, ForwardsChunkFromSubscriberToDataWriter)
auto testService = iox::capro::ServiceDescription({"Radar", "Front-Right", "Reflections"});

// Prepare a mock mempool chunk
ChunkMockDDS<int> mockChunk{42};
ChunkMock<int> mockChunk{42};

// Set up subscriber to provide the chunk
auto mockSubscriber = createMockIceoryxTerminal(testService, iox::popo::SubscriberOptions());
Expand Down Expand Up @@ -222,7 +222,7 @@ TEST_F(Iceoryx2DDSGatewayTest, IgnoresMemoryChunksWithNoPayload)
auto testService = iox::capro::ServiceDescription({"Radar", "Front-Right", "Reflections"});

// Prepare a mock mempool chunk
ChunkMockDDS<int> mockChunk{0};
ChunkMock<int> mockChunk{0};
mockChunk.chunkHeader()->m_info.m_payloadSize = 0;

// Set up subscriber to provide the chunk
Expand All @@ -249,7 +249,7 @@ TEST_F(Iceoryx2DDSGatewayTest, ReleasesReferenceToMemoryChunkAfterSend)
auto testService = iox::capro::ServiceDescription({"Radar", "Front-Right", "Reflections"});

// Prepare a mock mempool chunk
ChunkMockDDS<int> mockChunk{42};
ChunkMock<int> mockChunk{42};

// Set up expect sequence of interactions with subscriber and data writer
auto mockSubscriber = createMockIceoryxTerminal(testService, iox::popo::SubscriberOptions());
Expand Down
Loading

0 comments on commit a62858e

Please sign in to comment.