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