summaryrefslogtreecommitdiffstats
path: root/src/jaegertracing/opentelemetry-cpp/sdk/test/common/empty_attributes_test.cc
blob: f37ea0a5c4728977eb06befff85231a1fcf13ccf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
}