Skip to content

Commit

Permalink
Remove completely unnecessary use of CLASSNAME. (#471)
Browse files Browse the repository at this point in the history
This test wasn't even being run with multiple rmw implementations,
so just remove the unnecessary infrastructure.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette authored Jul 8, 2024
1 parent f69abc1 commit cf3e998
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
7 changes: 0 additions & 7 deletions test/benchmark/benchmark_logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@
#include "osrf_testing_tools_cpp/scope_exit.hpp"
#include "rcutils/logging.h"

#ifdef RMW_IMPLEMENTATION
# define CLASSNAME_(NAME, SUFFIX) NAME ## __ ## SUFFIX
# define CLASSNAME(NAME, SUFFIX) CLASSNAME_(NAME, SUFFIX)
#else
# define CLASSNAME(NAME, SUFFIX) NAME
#endif

size_t g_log_calls = 0;
struct LogEvent
{
Expand Down
14 changes: 4 additions & 10 deletions test/test_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,17 @@
#include "osrf_testing_tools_cpp/memory_tools/memory_tools.hpp"
#include "osrf_testing_tools_cpp/scope_exit.hpp"

#ifdef RMW_IMPLEMENTATION
# define CLASSNAME_(NAME, SUFFIX) NAME ## __ ## SUFFIX
# define CLASSNAME(NAME, SUFFIX) CLASSNAME_(NAME, SUFFIX)
#else
# define CLASSNAME(NAME, SUFFIX) NAME
#endif

using osrf_testing_tools_cpp::memory_tools::disable_monitoring_in_all_threads;
using osrf_testing_tools_cpp::memory_tools::enable_monitoring_in_all_threads;
using osrf_testing_tools_cpp::memory_tools::on_unexpected_calloc;
using osrf_testing_tools_cpp::memory_tools::on_unexpected_free;
using osrf_testing_tools_cpp::memory_tools::on_unexpected_malloc;
using osrf_testing_tools_cpp::memory_tools::on_unexpected_realloc;

class CLASSNAME (TestAllocatorFixture, RMW_IMPLEMENTATION) : public ::testing::Test
class TestAllocatorFixture : public ::testing::Test
{
public:
CLASSNAME(TestAllocatorFixture, RMW_IMPLEMENTATION)() {}
TestAllocatorFixture() {}

void SetUp()
{
Expand All @@ -55,7 +48,8 @@ class CLASSNAME (TestAllocatorFixture, RMW_IMPLEMENTATION) : public ::testing::T

/* Tests the default allocator.
*/
TEST_F(CLASSNAME(TestAllocatorFixture, RMW_IMPLEMENTATION), test_default_allocator_normal) {
TEST_F(TestAllocatorFixture, test_default_allocator_normal)
{
size_t mallocs = 0;
size_t reallocs = 0;
size_t callocs = 0;
Expand Down

0 comments on commit cf3e998

Please sign in to comment.