diff --git a/test/blackbox/common/DDSBlackboxTestsBasic.cpp b/test/blackbox/common/DDSBlackboxTestsBasic.cpp index 540281d62d5..b02eead6f55 100644 --- a/test/blackbox/common/DDSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/DDSBlackboxTestsBasic.cpp @@ -1052,6 +1052,47 @@ TEST(DDSBasic, reliable_volatile_writer_secure_builtin_no_potential_deadlock) writer.destroy(); } +TEST(DDSBasic, participant_factory_output_log_error_no_macro_collision) +{ +#ifdef __APPLE__ + using Log = eprosima::fastdds::dds::Log; + using LogConsumer = eprosima::fastdds::dds::LogConsumer; + + // A LogConsumer that just counts the number of entries consumed + struct TestConsumer : public LogConsumer + { + TestConsumer( + std::atomic_size_t& n_logs_ref) + : n_logs_(n_logs_ref) + { + } + + void Consume( + const Log::Entry&) override + { + ++n_logs_; + } + + private: + + std::atomic_size_t& n_logs_; + }; + + // Counter for log entries + std::atomicn_logs{}; + + // Prepare Log module to check that no SECURITY errors are produced + Log::SetCategoryFilter(std::regex("DOMAIN")); + Log::SetVerbosity(Log::Kind::Error); + Log::RegisterConsumer(std::unique_ptr(new TestConsumer(n_logs))); + + auto dpf = DomainParticipantFactory::get_shared_instance(); + DomainParticipantQos qos; + dpf->get_participant_qos_from_xml("", qos, ""); + ASSERT_GE(n_logs.load(), 1u); +#endif //__APPLE__ +} + } // namespace dds } // namespace fastdds } // namespace eprosima