Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/clang-tidy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
matrix:
include:
- cmake_options: all-options-abiv1-preview
warning_limit: 142
warning_limit: 136
- cmake_options: all-options-abiv2-preview
warning_limit: 152
warning_limit: 147
env:
CC: /usr/bin/clang-22
CXX: /usr/bin/clang++-22
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Increment the:
namespaces
[#4303](https://github.com/open-telemetry/opentelemetry-cpp/pull/4303)

* [CODE HEALTH] Move remaining API test helpers into anonymous namespaces
[#4301](https://github.com/open-telemetry/opentelemetry-cpp/pull/4301)

* [CODE HEALTH] Move metrics storage test fixtures into anonymous namespace
[#4286](https://github.com/open-telemetry/opentelemetry-cpp/pull/4286)

Expand Down
10 changes: 5 additions & 5 deletions api/test/logs/logger_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ TEST(Logger, EventLogMethodOverloads)

#endif

namespace
{

// Define a basic Logger class
class TestLogger : public Logger
{
Expand All @@ -282,9 +285,6 @@ class TestLogger : public Logger
}
};

namespace
{

class EnablementAwareTestLogRecord : public opentelemetry::logs::LogRecord
{
public:
Expand Down Expand Up @@ -455,8 +455,6 @@ class EnablementAwareTestLogger : public Logger
bool enabled_impl_result_;
};

} // namespace

// Define a basic LoggerProvider class that returns an instance of the logger class defined above
class TestProvider : public LoggerProvider
{
Expand Down Expand Up @@ -678,3 +676,5 @@ TEST(Logger, EmitLogRecordWithTracePartsInArgsRoutesSpanContextVariantToEnabled)
EXPECT_EQ(logger.last_span_context_.trace_flags(), trace_flags);
}
#endif // OPENTELEMETRY_ABI_VERSION_NO >= 2

} // namespace
5 changes: 5 additions & 0 deletions api/test/logs/provider_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ using opentelemetry::logs::Provider;
using opentelemetry::nostd::shared_ptr;
namespace nostd = opentelemetry::nostd;

namespace
{

class TestProvider : public LoggerProvider
{
public:
Expand Down Expand Up @@ -167,3 +170,5 @@ TEST(NoopEventLoggerProvider, CreateNoopEventLogger)
# endif

#endif

} // namespace
3 changes: 2 additions & 1 deletion api/test/trace/propagation/detail/string_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const SplitStringTestData split_string_test_cases[] = {
{"foo ,bar, baz ", ',', 4, 3},
{"00-0af7651916cd43dd8448eb211c80319c-00f067aa0ba902b7-01", '-', 4, 4},
};
} // namespace

// Test fixture
class SplitStringTestFixture : public ::testing::TestWithParam<SplitStringTestData>
Expand All @@ -63,3 +62,5 @@ TEST_P(SplitStringTestFixture, SplitsAsExpected)
INSTANTIATE_TEST_SUITE_P(SplitStringTestCases,
SplitStringTestFixture,
::testing::ValuesIn(split_string_test_cases));

} // namespace
5 changes: 5 additions & 0 deletions api/test/trace/provider_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ using opentelemetry::trace::TracerProvider;

namespace nostd = opentelemetry::nostd;

namespace
{

class TestProvider : public TracerProvider
{
public:
Expand Down Expand Up @@ -49,3 +52,5 @@ TEST(Provider, SetTracerProvider)
Provider::SetTracerProvider(tf);
ASSERT_EQ(tf, Provider::GetTracerProvider());
}

} // namespace
Loading