Skip to content

Commit d501fbe

Browse files
committed
test extract style priority
1 parent 77723e4 commit d501fbe

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

test/tracer.cpp

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -417,26 +417,38 @@ TEST_CASE("span extraction") {
417417
0xabc,
418418
0xdef,
419419
nullopt},
420-
{"Datadog and B3 style together",
420+
{"Datadog overriding B3",
421421
{PropagationStyle::DATADOG, PropagationStyle::B3},
422422
{{"x-datadog-trace-id", "255"},
423423
{"x-datadog-parent-id", "14"},
424424
{"x-datadog-sampling-priority", "0"},
425-
{"x-b3-traceid", "ff"},
426-
{"x-b3-spanid", "e"},
425+
{"x-b3-traceid", "fff"},
426+
{"x-b3-spanid", "ef"},
427427
{"x-b3-sampled", "0"}},
428428
255,
429429
14,
430430
0},
431-
{"Datadog and B3 style together without sampling priority",
431+
{"Datadog overriding B3, without sampling priority",
432432
{PropagationStyle::DATADOG, PropagationStyle::B3},
433433
{{"x-datadog-trace-id", "255"},
434434
{"x-datadog-parent-id", "14"},
435-
{"x-b3-traceid", "ff"},
436-
{"x-b3-spanid", "e"}},
435+
{"x-b3-traceid", "fff"},
436+
{"x-b3-spanid", "ef"}},
437437
255,
438438
14,
439439
nullopt},
440+
{"B3 after Datadog found no context",
441+
{PropagationStyle::DATADOG, PropagationStyle::B3},
442+
{{"x-b3-traceid", "ff"}, {"x-b3-spanid", "e"}},
443+
0xff,
444+
0xe,
445+
nullopt},
446+
{"Datadog after B3 found no context",
447+
{PropagationStyle::B3, PropagationStyle::DATADOG},
448+
{{"x-b3-traceid", "fff"}, {"x-b3-spanid", "ef"}},
449+
0xfff,
450+
0xef,
451+
nullopt},
440452
}));
441453

442454
CAPTURE(test_case.name);

0 commit comments

Comments
 (0)