@@ -35,10 +35,6 @@ class SpanTestPeer {
3535 return span->span_impl_for_test ()->parent_span_id ();
3636 }
3737
38- static void SetSampled (TraceOptions* opts, bool is_sampled) {
39- opts->SetSampled (is_sampled);
40- }
41-
4238 static exporter::SpanData ToSpanData (Span* span) {
4339 return span->span_impl_for_test ()->ToSpanData ();
4440 }
@@ -291,10 +287,8 @@ TEST(SpanTest, ChildInheritsTraceOption) {
291287 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 };
292288 constexpr uint8_t span_id[] = {1 , 0 , 0 , 0 , 0 , 0 , 0 , 11 };
293289 // Create a parent context with TraceOptions set to sampled.
294- TraceOptions trace_options;
295- SpanTestPeer::SetSampled (&trace_options, true );
296- SpanContext parent_ctx1{TraceId (trace_id), SpanId (span_id),
297- TraceOptions (trace_options)};
290+ TraceOptions trace_options = TraceOptions ().WithSampling (true );
291+ SpanContext parent_ctx1{TraceId (trace_id), SpanId (span_id), trace_options};
298292
299293 // Create a child Span with default sampling.
300294 auto span1 = Span::StartSpanWithRemoteParent (" Span1" , parent_ctx1);
0 commit comments