|
4 | 4 | #include "opentelemetry/sdk/trace/tracer_config.h" |
5 | 5 | #include <gtest/gtest.h> |
6 | 6 | #include <array> |
7 | | -#include <type_traits> |
| 7 | +#include <string> |
8 | 8 | #include <utility> |
9 | 9 | #include <vector> |
10 | 10 | #include "opentelemetry/common/attribute_value.h" |
@@ -38,33 +38,40 @@ TEST(TracerConfig, CheckDefaultConfigWorksAccToSpec) |
38 | 38 |
|
39 | 39 | /** Tests to verify the behavior of trace_sdk::TracerConfig::DefaultConfigurator */ |
40 | 40 |
|
41 | | -std::pair<opentelemetry::nostd::string_view, opentelemetry::common::AttributeValue> attr1 = { |
| 41 | +static std::pair<opentelemetry::nostd::string_view, opentelemetry::common::AttributeValue> attr1 = { |
42 | 42 | "accept_single_attr", true}; |
43 | | -std::pair<opentelemetry::nostd::string_view, opentelemetry::common::AttributeValue> attr2 = { |
| 43 | +static std::pair<opentelemetry::nostd::string_view, opentelemetry::common::AttributeValue> attr2 = { |
44 | 44 | "accept_second_attr", "some other attr"}; |
45 | | -std::pair<opentelemetry::nostd::string_view, opentelemetry::common::AttributeValue> attr3 = { |
| 45 | +static std::pair<opentelemetry::nostd::string_view, opentelemetry::common::AttributeValue> attr3 = { |
46 | 46 | "accept_third_attr", 3}; |
47 | 47 |
|
48 | | -const std::array<instrumentation_scope::InstrumentationScope *, 5> instrumentation_scopes = { |
49 | | - std::move(instrumentation_scope::InstrumentationScope::Create("test_scope_1")).get(), |
50 | | - std::move(instrumentation_scope::InstrumentationScope::Create("test_scope_2", "1.0")).get(), |
| 48 | +static instrumentation_scope::InstrumentationScope *test_scope_1 = |
| 49 | + std::move(instrumentation_scope::InstrumentationScope::Create("test_scope_1")).get(); |
| 50 | +static instrumentation_scope::InstrumentationScope *test_scope_2 = |
| 51 | + std::move(instrumentation_scope::InstrumentationScope::Create("test_scope_2", "1.0")).get(); |
| 52 | +static instrumentation_scope::InstrumentationScope *test_scope_3 = |
51 | 53 | std::move(instrumentation_scope::InstrumentationScope::Create( |
52 | 54 | "test_scope_3", |
53 | 55 | "0", |
54 | 56 | "https://opentelemetry.io/schemas/v1.18.0")) |
55 | | - .get(), |
| 57 | + .get(); |
| 58 | +static instrumentation_scope::InstrumentationScope *test_scope_4 = |
56 | 59 | std::move(instrumentation_scope::InstrumentationScope::Create( |
57 | | - "test_scope_3", |
| 60 | + "test_scope_4", |
58 | 61 | "0", |
59 | 62 | "https://opentelemetry.io/schemas/v1.18.0", |
60 | 63 | {attr1})) |
61 | | - .get(), |
| 64 | + .get(); |
| 65 | +static instrumentation_scope::InstrumentationScope *test_scope_5 = |
62 | 66 | std::move(instrumentation_scope::InstrumentationScope::Create( |
63 | | - "test_scope_4", |
| 67 | + "test_scope_5", |
64 | 68 | "0", |
65 | 69 | "https://opentelemetry.io/schemas/v1.18.0", |
66 | 70 | {attr1, attr2, attr3})) |
67 | | - .get(), |
| 71 | + .get(); |
| 72 | + |
| 73 | +const std::array<instrumentation_scope::InstrumentationScope *, 5> instrumentation_scopes = { |
| 74 | + test_scope_1, test_scope_2, test_scope_3, test_scope_4, test_scope_5, |
68 | 75 | }; |
69 | 76 |
|
70 | 77 | // Test fixture for VerifyDefaultConfiguratorBehavior |
|
0 commit comments