diff options
Diffstat (limited to 'src/jaegertracing/opentelemetry-cpp/sdk/test/common/empty_attributes_test.cc')
-rw-r--r-- | src/jaegertracing/opentelemetry-cpp/sdk/test/common/empty_attributes_test.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/jaegertracing/opentelemetry-cpp/sdk/test/common/empty_attributes_test.cc b/src/jaegertracing/opentelemetry-cpp/sdk/test/common/empty_attributes_test.cc new file mode 100644 index 000000000..f37ea0a5c --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/sdk/test/common/empty_attributes_test.cc @@ -0,0 +1,19 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +#include "opentelemetry/sdk/common/empty_attributes.h" + +#include <gtest/gtest.h> + +TEST(EmptyAttributesTest, TestSize) +{ + EXPECT_EQ(opentelemetry::sdk::GetEmptyAttributes().size(), 0); +} + +// Test that GetEmptyAttributes() always returns the same KeyValueIterableView +TEST(EmptyAttributesTest, TestMemory) +{ + auto attributes1 = opentelemetry::sdk::GetEmptyAttributes(); + auto attributes2 = opentelemetry::sdk::GetEmptyAttributes(); + EXPECT_EQ(memcmp(&attributes1, &attributes2, sizeof(attributes1)), 0); +} |