Skip to content

Commit

Permalink
iox-eclipse-iceoryx#841 Replace TEST_CASE with TEST_SUITE
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Jan 7, 2022
1 parent cea4d03 commit a252db0
Show file tree
Hide file tree
Showing 26 changed files with 171 additions and 171 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ typedef ::testing::Types<SingleElementQueue, SmallQueue, MediumQueue, LargeQueue
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(LockFreeQueueStressTest, TestQueues);
TYPED_TEST_SUITE(LockFreeQueueStressTest, TestQueues);
#pragma GCC diagnostic pop

///@brief Tests concurrent operation of one prodcuer and one consumer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ typedef ::testing::Types<HalfFull2> TestConfigs;
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(ResizeableLockFreeQueueStressTest, TestConfigs);
TYPED_TEST_SUITE(ResizeableLockFreeQueueStressTest, TestConfigs);
#pragma GCC diagnostic pop


Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/test/moduletests/test_concurrent_loffli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using LoFFLiTestSubjects = Types<iox::concurrent::LoFFLi>;
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(LoFFLi_test, LoFFLiTestSubjects);
TYPED_TEST_SUITE(LoFFLi_test, LoFFLiTestSubjects);
#pragma GCC diagnostic pop

template <typename LoFFLiType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ using TriggerQueueTestSubjects = Types<TriggerQueue<uint64_t, 1, FiFo>,
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(TriggerQueue_test, TriggerQueueTestSubjects);
TYPED_TEST_SUITE(TriggerQueue_test, TriggerQueueTestSubjects);
#pragma GCC diagnostic pop

TYPED_TEST(TriggerQueue_test, EmptyOnConstruction)
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/test/moduletests/test_cxx_helplets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ using HelpletsIsPowerOfTwoTypes = Types<uint8_t, uint16_t, uint32_t, uint64_t, s
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(Helplets_test_isPowerOfTwo, HelpletsIsPowerOfTwoTypes);
TYPED_TEST_SUITE(Helplets_test_isPowerOfTwo, HelpletsIsPowerOfTwoTypes);
#pragma GCC diagnostic pop

TYPED_TEST(Helplets_test_isPowerOfTwo, OneIsPowerOfTwo)
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/test/moduletests/test_cxx_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ using Implementations = Types<string<1>, string<15>, string<100>, string<1000>>;
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(stringTyped_test, Implementations);
TYPED_TEST_SUITE(stringTyped_test, Implementations);
#pragma GCC diagnostic pop

TEST(string_test, CapacityReturnsSpecifiedCapacity)
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/test/moduletests/test_index_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ typedef ::testing::Types<IndexQueue<1>, IndexQueue<10>, IndexQueue<1000>> TestQu
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(IndexQueueTest, TestQueues);
TYPED_TEST_SUITE(IndexQueueTest, TestQueues);
#pragma GCC diagnostic pop


Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/test/moduletests/test_ipc_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ constexpr uint64_t IpcChannel_test<T>::MaxMsgNumber;
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(IpcChannel_test, IpcChannelTypes);
TYPED_TEST_SUITE(IpcChannel_test, IpcChannelTypes);
#pragma GCC diagnostic pop

TYPED_TEST(IpcChannel_test, CreateWithTooLargeMessageSizeLeadsToError)
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/test/moduletests/test_lockfree_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ typedef ::testing::Types<LFFull1,
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(LockFreeQueueTest, TestConfigs);
TYPED_TEST_SUITE(LockFreeQueueTest, TestConfigs);
#pragma GCC diagnostic pop

TEST(LockFreeQueueTest, capacityIsConsistent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ typedef ::testing::Types<Buffer<int, 10>, Buffer<Integer, 10>> TestBuffers;
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(LockFreeQueueBufferTest, TestBuffers);
TYPED_TEST_SUITE(LockFreeQueueBufferTest, TestBuffers);
#pragma GCC diagnostic pop

TYPED_TEST(LockFreeQueueBufferTest, accessElements)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ typedef ::testing::Types<CyclicIndex<1>, CyclicIndex<2>, CyclicIndex<10>, Cyclic
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(LockFreeQueueCyclicIndexTest, TestIndices);
TYPED_TEST_SUITE(LockFreeQueueCyclicIndexTest, TestIndices);
#pragma GCC diagnostic pop

// note that in all tests we will check whether the getCycle and getIndex methods
Expand Down
20 changes: 10 additions & 10 deletions iceoryx_hoofs/test/moduletests/test_logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,18 @@ class IoxLoggerLogLevel_test : public TestWithParam<iox::log::LogLevel>, public
}
};

/// we require INSTANTIATE_TEST_CASE_P since we support gtest 1.8 for our safety targets
/// we require INSTANTIATE_TEST_SUITE_P since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
INSTANTIATE_TEST_CASE_P(AllLogLevel,
IoxLoggerLogLevel_test,
Values(iox::log::LogLevel::kOff,
iox::log::LogLevel::kFatal,
iox::log::LogLevel::kError,
iox::log::LogLevel::kWarn,
iox::log::LogLevel::kInfo,
iox::log::LogLevel::kDebug,
iox::log::LogLevel::kVerbose));
INSTANTIATE_TEST_SUITE_P(AllLogLevel,
IoxLoggerLogLevel_test,
Values(iox::log::LogLevel::kOff,
iox::log::LogLevel::kFatal,
iox::log::LogLevel::kError,
iox::log::LogLevel::kWarn,
iox::log::LogLevel::kInfo,
iox::log::LogLevel::kDebug,
iox::log::LogLevel::kVerbose));
#pragma GCC diagnostic pop

TEST_P(IoxLoggerLogLevel_test, LogLevel)
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_hoofs/test/moduletests/test_logstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ using LogHexBinTypes = Types<uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(IoxLogStreamHexBin_test, LogHexBinTypes);
TYPED_TEST_SUITE(IoxLogStreamHexBin_test, LogHexBinTypes);
#pragma GCC diagnostic pop

template <typename LogType>
Expand Down Expand Up @@ -266,7 +266,7 @@ using ArithmeticTypes =
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(IoxLogStreamArithmetic_test, ArithmeticTypes);
TYPED_TEST_SUITE(IoxLogStreamArithmetic_test, ArithmeticTypes);
#pragma GCC diagnostic pop

template <typename Arithmetic>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class SignalHandler_test : public Test
using Implementations =
Types<SignalType<Signal::INT>, SignalType<Signal::BUS>, SignalType<Signal::TERM>, SignalType<Signal::HUP>>;

TYPED_TEST_CASE(SignalHandler_test, Implementations);
TYPED_TEST_SUITE(SignalHandler_test, Implementations);

TYPED_TEST(SignalHandler_test, RegisteringSignalGuardCallbackWorks)
{
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/test/moduletests/test_relative_pointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ typedef testing::Types<uint8_t, int8_t, double> Types;
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(base_relative_ptr_test, Types);
TYPED_TEST_SUITE(base_relative_ptr_test, Types);
#pragma GCC diagnostic pop

TYPED_TEST(base_relative_ptr_test, ConstrTests)
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/test/moduletests/test_relocatable_ptr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ typedef ::testing::Types<int, Data, void, char*, const Data, const void> TestTyp
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(Relocatable_ptr_typed_test, TestTypes);
TYPED_TEST_SUITE(Relocatable_ptr_typed_test, TestTypes);
#pragma GCC diagnostic pop

TYPED_TEST(Relocatable_ptr_typed_test, wrappedPointerTypeIsCorrect)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ typedef ::testing::Types<IntegerQueue<1>, IntegerQueue<11>, IntQueue<10>> TestQu
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(ResizeableLockFreeQueueTest, TestQueues);
TYPED_TEST_SUITE(ResizeableLockFreeQueueTest, TestQueues);
#pragma GCC diagnostic pop

TEST(ResizeableLockFreeQueueTest, maxCapacityIsConsistent)
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/test/moduletests/test_semaphore_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class SemaphoreCreate_test : public Test
/// we require INSTANTIATE_TEST_CASE since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
INSTANTIATE_TEST_CASE_P(Semaphore_test, Semaphore_test, Values(&createNamedSemaphore, &createUnnamedSemaphore));
INSTANTIATE_TEST_SUITE_P(Semaphore_test, Semaphore_test, Values(&createNamedSemaphore, &createUnnamedSemaphore));
#pragma GCC diagnostic pop

TEST_F(SemaphoreCreate_test, CreateNamedSemaphore)
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_posh/test/moduletests/test_base_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ using PortDataTypes =
/// we require TYPED_TEST since we support gtest 1.8 for our safety targets
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
TYPED_TEST_CASE(BasePort_test, PortDataTypes);
TYPED_TEST_SUITE(BasePort_test, PortDataTypes);
#pragma GCC diagnostic pop

// port data factories
Expand Down
112 changes: 56 additions & 56 deletions iceoryx_posh/test/moduletests/test_mepoo_chunk_header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,34 +412,34 @@ class ChunkHeader_AlteringUserPayloadWithoutUserHeader : public ::testing::TestW

// without a user-header, the user-payload is located right after the ChunkHeader, therefore the payload size and
// alignment parameters are made dependant on the ChunkHeader
INSTANTIATE_TEST_CASE_P(ChunkHeader_test,
ChunkHeader_AlteringUserPayloadWithoutUserHeader,
::testing::Values(
// alignment = 0
PayloadParams{0U, 0U},
PayloadParams{1U, 0U},
PayloadParams{sizeof(ChunkHeader), 0U},
PayloadParams{sizeof(ChunkHeader) * 42U, 0U},
// alignment = 1
PayloadParams{0U, 1U},
PayloadParams{1U, 1U},
PayloadParams{sizeof(ChunkHeader), 1U},
PayloadParams{sizeof(ChunkHeader) * 42U, 1U},
// alignment = alignof(ChunkHeader) / 2
PayloadParams{0U, alignof(ChunkHeader) / 2},
PayloadParams{1U, alignof(ChunkHeader) / 2},
PayloadParams{sizeof(ChunkHeader), alignof(ChunkHeader) / 2},
PayloadParams{sizeof(ChunkHeader) * 42U, alignof(ChunkHeader) / 2},
// alignment = alignof(ChunkHeader)
PayloadParams{0U, alignof(ChunkHeader)},
PayloadParams{1U, alignof(ChunkHeader)},
PayloadParams{sizeof(ChunkHeader), alignof(ChunkHeader)},
PayloadParams{sizeof(ChunkHeader) * 42U, alignof(ChunkHeader)},
// alignment = alignof(ChunkHeader) * 2
PayloadParams{0U, alignof(ChunkHeader) * 2},
PayloadParams{1U, alignof(ChunkHeader) * 2},
PayloadParams{sizeof(ChunkHeader), alignof(ChunkHeader) * 2},
PayloadParams{sizeof(ChunkHeader) * 42U, alignof(ChunkHeader) * 2}));
INSTANTIATE_TEST_SUITE_P(ChunkHeader_test,
ChunkHeader_AlteringUserPayloadWithoutUserHeader,
::testing::Values(
// alignment = 0
PayloadParams{0U, 0U},
PayloadParams{1U, 0U},
PayloadParams{sizeof(ChunkHeader), 0U},
PayloadParams{sizeof(ChunkHeader) * 42U, 0U},
// alignment = 1
PayloadParams{0U, 1U},
PayloadParams{1U, 1U},
PayloadParams{sizeof(ChunkHeader), 1U},
PayloadParams{sizeof(ChunkHeader) * 42U, 1U},
// alignment = alignof(ChunkHeader) / 2
PayloadParams{0U, alignof(ChunkHeader) / 2},
PayloadParams{1U, alignof(ChunkHeader) / 2},
PayloadParams{sizeof(ChunkHeader), alignof(ChunkHeader) / 2},
PayloadParams{sizeof(ChunkHeader) * 42U, alignof(ChunkHeader) / 2},
// alignment = alignof(ChunkHeader)
PayloadParams{0U, alignof(ChunkHeader)},
PayloadParams{1U, alignof(ChunkHeader)},
PayloadParams{sizeof(ChunkHeader), alignof(ChunkHeader)},
PayloadParams{sizeof(ChunkHeader) * 42U, alignof(ChunkHeader)},
// alignment = alignof(ChunkHeader) * 2
PayloadParams{0U, alignof(ChunkHeader) * 2},
PayloadParams{1U, alignof(ChunkHeader) * 2},
PayloadParams{sizeof(ChunkHeader), alignof(ChunkHeader) * 2},
PayloadParams{sizeof(ChunkHeader) * 42U, alignof(ChunkHeader) * 2}));

TEST_P(ChunkHeader_AlteringUserPayloadWithoutUserHeader, CheckIntegrityOfChunkHeaderWithoutUserHeader)
{
Expand Down Expand Up @@ -468,34 +468,34 @@ class ChunkHeader_AlteringUserPayloadWithUserHeader : public ::testing::TestWith

// with a user-header, the user-payload is located right after the UserPayloadOffset_t, therefore the user-payload size
// and alignment parameters are made dependant on the UserPayloadOffset_t
INSTANTIATE_TEST_CASE_P(ChunkHeader_test,
ChunkHeader_AlteringUserPayloadWithUserHeader,
::testing::Values(
// alignment = 0
PayloadParams{0U, 0U},
PayloadParams{1U, 0U},
PayloadParams{sizeof(UserPayloadOffset_t), 0U},
PayloadParams{sizeof(UserPayloadOffset_t) * 42U, 0U},
// alignment = 1
PayloadParams{0U, 1U},
PayloadParams{1U, 1U},
PayloadParams{sizeof(UserPayloadOffset_t), 1U},
PayloadParams{sizeof(UserPayloadOffset_t) * 42U, 1U},
// alignment = alignof(UserPayloadOffset_t) / 2
PayloadParams{0U, alignof(UserPayloadOffset_t) / 2},
PayloadParams{1U, alignof(UserPayloadOffset_t) / 2},
PayloadParams{sizeof(UserPayloadOffset_t), alignof(UserPayloadOffset_t) / 2},
PayloadParams{sizeof(UserPayloadOffset_t) * 42U, alignof(UserPayloadOffset_t) / 2},
// alignment = alignof(UserPayloadOffset_t)
PayloadParams{0U, alignof(UserPayloadOffset_t)},
PayloadParams{1U, alignof(UserPayloadOffset_t)},
PayloadParams{sizeof(UserPayloadOffset_t), alignof(UserPayloadOffset_t)},
PayloadParams{sizeof(UserPayloadOffset_t) * 42U, alignof(UserPayloadOffset_t)},
// alignment = alignof(UserPayloadOffset_t) * 2
PayloadParams{0U, alignof(UserPayloadOffset_t) * 2},
PayloadParams{1U, alignof(UserPayloadOffset_t) * 2},
PayloadParams{sizeof(UserPayloadOffset_t), alignof(UserPayloadOffset_t) * 2},
PayloadParams{sizeof(UserPayloadOffset_t) * 42U, alignof(UserPayloadOffset_t) * 2}));
INSTANTIATE_TEST_SUITE_P(ChunkHeader_test,
ChunkHeader_AlteringUserPayloadWithUserHeader,
::testing::Values(
// alignment = 0
PayloadParams{0U, 0U},
PayloadParams{1U, 0U},
PayloadParams{sizeof(UserPayloadOffset_t), 0U},
PayloadParams{sizeof(UserPayloadOffset_t) * 42U, 0U},
// alignment = 1
PayloadParams{0U, 1U},
PayloadParams{1U, 1U},
PayloadParams{sizeof(UserPayloadOffset_t), 1U},
PayloadParams{sizeof(UserPayloadOffset_t) * 42U, 1U},
// alignment = alignof(UserPayloadOffset_t) / 2
PayloadParams{0U, alignof(UserPayloadOffset_t) / 2},
PayloadParams{1U, alignof(UserPayloadOffset_t) / 2},
PayloadParams{sizeof(UserPayloadOffset_t), alignof(UserPayloadOffset_t) / 2},
PayloadParams{sizeof(UserPayloadOffset_t) * 42U, alignof(UserPayloadOffset_t) / 2},
// alignment = alignof(UserPayloadOffset_t)
PayloadParams{0U, alignof(UserPayloadOffset_t)},
PayloadParams{1U, alignof(UserPayloadOffset_t)},
PayloadParams{sizeof(UserPayloadOffset_t), alignof(UserPayloadOffset_t)},
PayloadParams{sizeof(UserPayloadOffset_t) * 42U, alignof(UserPayloadOffset_t)},
// alignment = alignof(UserPayloadOffset_t) * 2
PayloadParams{0U, alignof(UserPayloadOffset_t) * 2},
PayloadParams{1U, alignof(UserPayloadOffset_t) * 2},
PayloadParams{sizeof(UserPayloadOffset_t), alignof(UserPayloadOffset_t) * 2},
PayloadParams{sizeof(UserPayloadOffset_t) * 42U, alignof(UserPayloadOffset_t) * 2}));

TEST_P(ChunkHeader_AlteringUserPayloadWithUserHeader, CheckIntegrityOfChunkHeaderWithUserHeader)
{
Expand Down
Loading

0 comments on commit a252db0

Please sign in to comment.