Skip to content

Commit

Permalink
Refs #22624: Regression test
Browse files Browse the repository at this point in the history
Signed-off-by: Juanjo Garcia <juanjosegarcia@eprosima.com>
  • Loading branch information
juanjo4936 committed Jan 30, 2025
1 parent 9ddad46 commit 05fd124
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/unittest/logging/LogTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,30 @@ TEST_F(LogTests, thread_config)
EXPECT_EQ(entries.size(), n_logs);
}

/**
* Regression test 22624: when setting thread affinity fails, eprosima log error throws another error,
* and calls eprosima log error. This causes a looping recursive call for eprosima log error.
*/
TEST_F(LogTests, thread_log_error_loop)
{
// Set general verbosity
Log::SetVerbosity(Log::Error);

// Set thread settings
eprosima::fastdds::rtps::ThreadSettings thr_settings{};
#ifdef __linux__
thr_settings.affinity = 0xFFFFFFFFFFFFFFFF;
#elif _WIN32
thr_settings.affinity = 0xFFFFFFFFFFFFFFFF;
#elif __APPLE__
thr_settings.affinity = 0xFFFFFFFFFFFFFFFF;
#endif
Log::SetThreadConfig(thr_settings);

// Start the error message
EPROSIMA_LOG_ERROR(SYSTEM, "Did I start the recursive loop?");
}

int main(
int argc,
char** argv)
Expand Down

0 comments on commit 05fd124

Please sign in to comment.