]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | // Copyright The OpenTelemetry Authors |
2 | // SPDX-License-Identifier: Apache-2.0 | |
3 | ||
4 | #include "opentelemetry/sdk/common/empty_attributes.h" | |
5 | ||
6 | #include <gtest/gtest.h> | |
7 | ||
8 | TEST(EmptyAttributesTest, TestSize) | |
9 | { | |
10 | EXPECT_EQ(opentelemetry::sdk::GetEmptyAttributes().size(), 0); | |
11 | } | |
12 | ||
13 | // Test that GetEmptyAttributes() always returns the same KeyValueIterableView | |
14 | TEST(EmptyAttributesTest, TestMemory) | |
15 | { | |
16 | auto attributes1 = opentelemetry::sdk::GetEmptyAttributes(); | |
17 | auto attributes2 = opentelemetry::sdk::GetEmptyAttributes(); | |
18 | EXPECT_EQ(memcmp(&attributes1, &attributes2, sizeof(attributes1)), 0); | |
19 | } |