Skip to content

Commit

Permalink
Refs #22657: BB test
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Domínguez López <mariodominguez@eprosima.com>
  • Loading branch information
Mario-DL committed Jan 21, 2025
1 parent c0e7929 commit b455005
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions test/blackbox/common/DDSBlackboxTestsBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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::atomic<size_t>n_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<LogConsumer>(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

0 comments on commit b455005

Please sign in to comment.