empty_attributes_test.cc 598 B

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