Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1755 Run clang-format-18
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Jan 8, 2025
1 parent d5b0319 commit 6bc854f
Show file tree
Hide file tree
Showing 30 changed files with 96 additions and 108 deletions.
2 changes: 1 addition & 1 deletion iceoryx_hoofs/posix/sync/source/signal_watcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void internalSignalHandler(int) noexcept

SignalWatcher::SignalWatcher() noexcept
: m_sigTermGuard(
registerSignalHandler(PosixSignal::TERM, internalSignalHandler).expect("Unable to register Signal::TERM"))
registerSignalHandler(PosixSignal::TERM, internalSignalHandler).expect("Unable to register Signal::TERM"))
, m_sigIntGuard(
registerSignalHandler(PosixSignal::INT, internalSignalHandler).expect("Unable to register Signal::INT"))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,12 @@ inline void report(const SourceLocation& location, Kind, const Error& error, con
auto moduleName = toModuleName(error);
auto errorName = toErrorName(error);

IOX_ERROR_INTERNAL_LOG(
location,
[stringifiedCondition](auto& stream) -> auto& {
return detail::logStringifiedCondition(stream, stringifiedCondition);
} << "["
<< errorName << " (code = " << code.value << ")] in module [" << moduleName << " (id = " << module.value
<< ")]");
IOX_ERROR_INTERNAL_LOG(location,
[stringifiedCondition](auto& stream) -> auto& {
return detail::logStringifiedCondition(stream, stringifiedCondition);
} << "["
<< errorName << " (code = " << code.value << ")] in module [" << moduleName
<< " (id = " << module.value << ")]");
auto& h = ErrorHandler::get();
h.onReportError(ErrorDescriptor(location, code, module));
}
Expand All @@ -115,13 +114,12 @@ report(const SourceLocation& location, iox::er::FatalKind kind, const Error& err
auto moduleName = toModuleName(error);
auto errorName = toErrorName(error);

IOX_ERROR_INTERNAL_LOG_FATAL(
location,
[stringifiedCondition](auto& stream) -> auto& {
return detail::logStringifiedCondition(stream, stringifiedCondition);
} << "["
<< kind.name << "] [" << errorName << " (code = " << code.value << ")] in module [" << moduleName
<< " (id = " << module.value << ")]");
IOX_ERROR_INTERNAL_LOG_FATAL(location,
[stringifiedCondition](auto& stream) -> auto& {
return detail::logStringifiedCondition(stream, stringifiedCondition);
} << "["
<< kind.name << "] [" << errorName << " (code = " << code.value << ")] in module ["
<< moduleName << " (id = " << module.value << ")]");
auto& h = ErrorHandler::get();
h.onReportError(ErrorDescriptor(location, code, module));
}
Expand All @@ -141,21 +139,19 @@ report(const SourceLocation& location, Kind kind, const Error& error, const char
auto module = toModule(error);
if constexpr (std::is_same<NoMessage, Message>::value)
{
IOX_ERROR_INTERNAL_LOG_FATAL(
location,
[stringifiedCondition](auto& stream) -> auto& {
return detail::logStringifiedCondition(stream, stringifiedCondition);
} << "["
<< kind.name << "]");
IOX_ERROR_INTERNAL_LOG_FATAL(location,
[stringifiedCondition](auto& stream) -> auto& {
return detail::logStringifiedCondition(stream, stringifiedCondition);
} << "["
<< kind.name << "]");
}
else
{
IOX_ERROR_INTERNAL_LOG_FATAL(
location,
[stringifiedCondition](auto& stream) -> auto& {
return detail::logStringifiedCondition(stream, stringifiedCondition);
} << "["
<< kind.name << "] " << std::forward<Message>(msg));
IOX_ERROR_INTERNAL_LOG_FATAL(location,
[stringifiedCondition](auto& stream) -> auto& {
return detail::logStringifiedCondition(stream, stringifiedCondition);
} << "["
<< kind.name << "] " << std::forward<Message>(msg));
}
auto& h = ErrorHandler::get();
h.onReportViolation(ErrorDescriptor(location, code, module));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ struct AndThenOrElseConcatenatedWorksWhenInvalid<TYPE_HAS_NO_VALUE_METHOD, TYPE_
auto sut = TestFactory::createInvalidObject();
bool wasAndThenCalled = false;
bool wasOrElseCalled = false;
sutCall(
sut, [&] { wasAndThenCalled = true; }, [&] { wasOrElseCalled = true; });
sutCall(sut, [&] { wasAndThenCalled = true; }, [&] { wasOrElseCalled = true; });

EXPECT_FALSE(wasAndThenCalled);
EXPECT_TRUE(wasOrElseCalled);
Expand All @@ -68,8 +67,7 @@ struct AndThenOrElseConcatenatedWorksWhenInvalid<TYPE_HAS_VALUE_METHOD, TYPE_HAS
auto sut = TestFactory::createInvalidObject();
bool wasAndThenCalled = false;
bool wasOrElseCalled = false;
sutCall(
sut, [&](auto&) { wasAndThenCalled = true; }, [&] { wasOrElseCalled = true; });
sutCall(sut, [&](auto&) { wasAndThenCalled = true; }, [&] { wasOrElseCalled = true; });

EXPECT_FALSE(wasAndThenCalled);
EXPECT_TRUE(wasOrElseCalled);
Expand Down Expand Up @@ -161,8 +159,7 @@ struct AndThenOrElseConcatenatedWorkWhenValid<TYPE_HAS_NO_VALUE_METHOD, TYPE_HAS
auto sut = TestFactory::createValidObject();
bool wasAndThenCalled = false;
bool wasOrElseCalled = false;
sutCall(
sut, [&] { wasAndThenCalled = true; }, [&] { wasOrElseCalled = true; });
sutCall(sut, [&] { wasAndThenCalled = true; }, [&] { wasOrElseCalled = true; });

EXPECT_TRUE(wasAndThenCalled);
EXPECT_FALSE(wasOrElseCalled);
Expand Down Expand Up @@ -200,8 +197,7 @@ struct AndThenOrElseConcatenatedWorkWhenValid<TYPE_HAS_NO_VALUE_METHOD, TYPE_HAS
auto sut = TestFactory::createValidObject();
bool wasAndThenCalled = false;
bool wasOrElseCalled = false;
sutCall(
sut, [&] { wasAndThenCalled = true; }, [&](auto&) { wasOrElseCalled = true; });
sutCall(sut, [&] { wasAndThenCalled = true; }, [&](auto&) { wasOrElseCalled = true; });

EXPECT_TRUE(wasAndThenCalled);
EXPECT_FALSE(wasOrElseCalled);
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_hoofs/test/moduletests/test_functional_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ struct Arg : Counter<Arg>
{
Arg() = default;
explicit Arg(int32_t value)
: value(value){};
: value(value) {};
Arg(const Arg&) = default;
Arg& operator=(const Arg&) = default;

Expand Down Expand Up @@ -557,7 +557,7 @@ TEST_F(function_test, CallWithRValueReferenceArgumentsWorks)

// NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved) this is okay for this test
auto lambda = [](Arg&& a) { return a.value + 1; };
function<int32_t(Arg &&), 128> sut(lambda);
function<int32_t(Arg&&), 128> sut(lambda);

auto result = sut(std::move(arg));

Expand Down
18 changes: 9 additions & 9 deletions iceoryx_posh/include/iceoryx_posh/internal/popo/trigger.inl
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ inline Trigger::Trigger(EventBasedTrigger_t,
const uint64_t notificationType,
const uint64_t notificationTypeHash) noexcept
: Trigger(
notificationOrigin,
[]() { return false; },
resetCallback,
notificationId,
callback,
uniqueId,
TriggerType::EVENT_BASED,
notificationType,
notificationTypeHash)
notificationOrigin,
[]() { return false; },
resetCallback,
notificationId,
callback,
uniqueId,
TriggerType::EVENT_BASED,
notificationType,
notificationTypeHash)
{
}
} // namespace popo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class InterfacePortRequestStackBlowup_test : public RouDi_GTest
{
}

void SetUp(){};
void TearDown(){};
void SetUp() {};
void TearDown() {};
};

TEST_F(InterfacePortRequestStackBlowup_test, RouDiMustContinue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ class PublisherSubscriberCommunicationWithBigPayload_test : public PublisherSubs
public:
PublisherSubscriberCommunicationWithBigPayload_test()
: PublisherSubscriberCommunication_test(
MinimalIceoryxConfigBuilder()
.payloadChunkSize(SIZE_LARGER_THAN_4GB + additionalSizeForUserHeader)
.payloadChunkCount(2)
.create())
MinimalIceoryxConfigBuilder()
.payloadChunkSize(SIZE_LARGER_THAN_4GB + additionalSizeForUserHeader)
.payloadChunkCount(2)
.create())
{
}

Expand Down
2 changes: 1 addition & 1 deletion iceoryx_posh/test/mocks/gateway_base_mock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class MockGatewayBase
{
public:
MockGatewayBase(const iox::capro::Interfaces){};
MockGatewayBase(const iox::capro::Interfaces) {};
MOCK_METHOD1(getCaProMessage, bool(iox::capro::CaproMessage&));

MOCK_METHOD0(getInterface, iox::capro::Interfaces());
Expand Down
8 changes: 4 additions & 4 deletions iceoryx_posh/test/mocks/publisher_mock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class MockPublisherPortUser
MockPublisherPortUser(std::nullptr_t)
{
}
MockPublisherPortUser(MemberType_t*){};
MockPublisherPortUser(MemberType_t*) {};

MockPublisherPortUser(const MockPublisherPortUser& rhs [[maybe_unused]]){};
MockPublisherPortUser(MockPublisherPortUser&& rhs [[maybe_unused]]){};
MockPublisherPortUser(const MockPublisherPortUser& rhs [[maybe_unused]]) {};
MockPublisherPortUser(MockPublisherPortUser&& rhs [[maybe_unused]]) {};
MockPublisherPortUser& operator=(const MockPublisherPortUser& rhs [[maybe_unused]])
{
return *this;
Expand Down Expand Up @@ -79,7 +79,7 @@ class MockBasePublisher
public:
using PortType = MockPublisherPortUser;

MockBasePublisher(const iox::capro::ServiceDescription&, const iox::popo::PublisherOptions&){};
MockBasePublisher(const iox::capro::ServiceDescription&, const iox::popo::PublisherOptions&) {};
MOCK_CONST_METHOD0(getUid, iox::popo::uid_t());
MOCK_CONST_METHOD0(getServiceDescription, iox::capro::ServiceDescription());
MOCK_METHOD0(offer, void(void));
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_posh/test/mocks/subscriber_mock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MockSubscriberPortUser
{
}

MockSubscriberPortUser(iox::popo::SubscriberPortData*){};
MockSubscriberPortUser(iox::popo::SubscriberPortData*) {};
iox::capro::ServiceDescription getCaProServiceDescription() const noexcept
{
return getServiceDescription();
Expand Down Expand Up @@ -70,7 +70,7 @@ class MockBaseSubscriber
using SelfType = MockBaseSubscriber<T, Port>;
using PortType = Port;

MockBaseSubscriber(const iox::capro::ServiceDescription&, const iox::popo::SubscriberOptions&){};
MockBaseSubscriber(const iox::capro::ServiceDescription&, const iox::popo::SubscriberOptions&) {};
MOCK_CONST_METHOD0(getUid, iox::popo::uid_t());
MOCK_CONST_METHOD0(getServiceDescription, iox::capro::ServiceDescription());
MOCK_METHOD1(subscribe, void(uint64_t));
Expand Down
5 changes: 2 additions & 3 deletions iceoryx_posh/test/mocks/trigger_handle_mock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ using ::testing::_;
class MockTriggeHandle
{
public:
MockTriggeHandle(iox::popo::ConditionVariableData&,
const iox::function<void(uint64_t)>,
const uint64_t) noexcept {};
MockTriggeHandle(iox::popo::ConditionVariableData&, const iox::function<void(uint64_t)>, const uint64_t) noexcept {
};
MockTriggeHandle() noexcept
{
}
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_posh/test/moduletests/test_capro_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class ServiceDescription_test : public Test
IdString_t testService;
IdString_t testInstance;
IdString_t testEvent;
void SetUp(){};
void TearDown(){};
void SetUp() {};
void TearDown() {};
};

/// BEGIN CLASSHASH TESTS
Expand Down
8 changes: 4 additions & 4 deletions iceoryx_posh/test/moduletests/test_gw_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ struct StubbedIceoryxTerminal
struct Options
{
};
StubbedIceoryxTerminal(const iox::capro::ServiceDescription&, const Options&){};
StubbedIceoryxTerminal(const iox::capro::ServiceDescription&, const Options&) {};
};

struct StubbedExternalTerminal
{
StubbedExternalTerminal(IdString_t, IdString_t, IdString_t){};
StubbedExternalTerminal(IdString_t, IdString_t, IdString_t) {};
};

using TestChannel = iox::gw::Channel<StubbedIceoryxTerminal, StubbedExternalTerminal>;
Expand All @@ -49,8 +49,8 @@ using TestChannel = iox::gw::Channel<StubbedIceoryxTerminal, StubbedExternalTerm
class ChannelTest : public Test
{
public:
void SetUp(){};
void TearDown(){};
void SetUp() {};
void TearDown() {};
};

// ======================================== Tests ======================================== //
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_posh/test/moduletests/test_gw_gateway_discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class InterfacePort_mock
class GatewayDiscovery_test : public Test
{
public:
void SetUp(){};
void TearDown(){};
void SetUp() {};
void TearDown() {};
};

TEST_F(GatewayDiscovery_test, GetCaproMessage)
Expand Down
8 changes: 4 additions & 4 deletions iceoryx_posh/test/moduletests/test_gw_gateway_generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ struct StubbedIceoryxTerminal
struct Options
{
};
StubbedIceoryxTerminal(const iox::capro::ServiceDescription&, const Options&){};
StubbedIceoryxTerminal(const iox::capro::ServiceDescription&, const Options&) {};
};

struct StubbedExternalTerminal
{
StubbedExternalTerminal(IdString_t, IdString_t, IdString_t){};
StubbedExternalTerminal(IdString_t, IdString_t, IdString_t) {};
};

using TestChannel = iox::gw::Channel<StubbedIceoryxTerminal, StubbedExternalTerminal>;
Expand All @@ -59,8 +59,8 @@ using TestGatewayGeneric = iox::gw::StubbedGatewayGeneric<TestChannel>;
class GatewayGenericTest : public Test
{
public:
void SetUp(){};
void TearDown(){};
void SetUp() {};
void TearDown() {};

std::unique_ptr<TestGatewayGeneric> sut{new TestGatewayGeneric{}};
};
Expand Down
7 changes: 2 additions & 5 deletions iceoryx_posh/test/moduletests/test_mepoo_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ TEST_F(MePooConfig_Test, AddingMempoolWhenTheMemPoolConfigContainerIsFullReturns
{
sut.addMemPool({SIZE, CHUNK_COUNT});
}
IOX_EXPECT_FATAL_FAILURE(
[&] {
sut.addMemPool({SIZE, CHUNK_COUNT});
},
iox::PoshError::MEPOO__MAXIMUM_NUMBER_OF_MEMPOOLS_REACHED);
IOX_EXPECT_FATAL_FAILURE([&] { sut.addMemPool({SIZE, CHUNK_COUNT}); },
iox::PoshError::MEPOO__MAXIMUM_NUMBER_OF_MEMPOOLS_REACHED);
}

TEST_F(MePooConfig_Test, SetDefaultMethodAddsTheDefaultMemPoolConfigurationToTheMemPoolConfigContainer)
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_posh/test/moduletests/test_mepoo_typed_mempool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class TypedMemPool_test : public Test
{
}

void SetUp(){};
void TearDown(){};
void SetUp() {};
void TearDown() {};

alignas(MemPool::CHUNK_MEMORY_ALIGNMENT) uint8_t
m_rawMemory[NumberOfChunks * ChunkSize + MpmcLoFFLiMemoryRequirement];
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_posh/test/moduletests/test_popo_base_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class StubbedBasePublisher : public iox::popo::BasePublisher<port_t>
{
public:
StubbedBasePublisher(iox::capro::ServiceDescription)
: iox::popo::BasePublisher<port_t>::BasePublisher(){};
: iox::popo::BasePublisher<port_t>::BasePublisher() {};

using iox::popo::BasePublisher<port_t>::port;
};
Expand Down
12 changes: 6 additions & 6 deletions iceoryx_posh/test/moduletests/test_popo_chunk_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ template <typename TestTypes>
class ChunkQueue_test : public Test, public ChunkQueue_testBase
{
public:
void SetUp() override{};
void TearDown() override{};
void SetUp() override {};
void TearDown() override {};

using ChunkQueueData_t = ChunkQueueData<iox::DefaultChunkQueueConfig, typename TestTypes::PolicyType_t>;

Expand Down Expand Up @@ -268,8 +268,8 @@ template <typename PolicyType>
class ChunkQueueFiFo_test : public Test, public ChunkQueue_testBase
{
public:
void SetUp() override{};
void TearDown() override{};
void SetUp() override {};
void TearDown() override {};

using ChunkQueueData_t = ChunkQueueData<iox::DefaultChunkQueueConfig, PolicyType>;

Expand Down Expand Up @@ -332,8 +332,8 @@ template <typename PolicyType>
class ChunkQueueSoFi_test : public Test, public ChunkQueue_testBase
{
public:
void SetUp() override{};
void TearDown() override{};
void SetUp() override {};
void TearDown() override {};

using ChunkQueueData_t = ChunkQueueData<iox::DefaultChunkQueueConfig, PolicyType>;

Expand Down
Loading

0 comments on commit 6bc854f

Please sign in to comment.