]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | /* |
2 | * Copyright (c) 2017 Uber Technologies, Inc. | |
3 | * | |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | ||
17 | #include "jaegertracing/Tag.h" | |
18 | #include "jaegertracing/thrift-gen/jaeger_types.h" | |
19 | #include <gtest/gtest.h> | |
20 | #include <string> | |
21 | ||
22 | namespace jaegertracing { | |
23 | ||
24 | TEST(Tag, testThriftConversion) | |
25 | { | |
26 | const Tag tags[] = { { "testBool", true }, | |
27 | { "testDouble", 0.0 }, | |
28 | { "testInt64", 0LL }, | |
29 | { "testUint64", 0ULL }, | |
30 | { "testStr", std::string{ "test" } }, | |
31 | { "testNull", nullptr }, | |
32 | { "testCStr", "test" } }; | |
33 | ||
34 | for (auto&& tag : tags) { | |
35 | thrift::Tag thriftTag; | |
36 | ASSERT_NO_THROW(tag.thrift(thriftTag)); | |
37 | } | |
38 | } | |
39 | ||
40 | } // namespace jaegertracing |