Skip to content

Commit

Permalink
MetricEventSource tests workaround .NET Framework double rounding
Browse files Browse the repository at this point in the history
Fixes #85290
Desktop .NET Framework on x86 improperly rounds double values in some circumstances. I switched the test to use a lower precision double value so that it is not impacted by the extra rounding.
  • Loading branch information
noahfalk authored May 16, 2023
1 parent 3b9b78c commit 9937f2d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ public void EventSourcePublishesAllDataTypes()
l.Add(123_456_789_012);
dec.Add(123_456_789_012_345);
f.Add(123_456.789F);
d.Add(87_654_321_987_654.4);
d.Add(5.25);

i.Add(1);
s.Add(1);
Expand All @@ -611,7 +611,7 @@ public void EventSourcePublishesAllDataTypes()
l.Add(123_456_789_012);
dec.Add(123_456_789_012_345);
f.Add(123_456.789F);
d.Add(87_654_321_987_654.4);
d.Add(5.25);

i.Add(1);
s.Add(1);
Expand All @@ -632,7 +632,7 @@ public void EventSourcePublishesAllDataTypes()
AssertCounterEventsPresent(events, meter.Name, l.Name, "", "", ("123456789013", "123456789013"), ("123456789013", "246913578026"));
AssertCounterEventsPresent(events, meter.Name, dec.Name, "", "", ("123456789012346", "123456789012346"), ("123456789012346", "246913578024692"));
AssertCounterEventsPresent(events, meter.Name, f.Name, "", "", ("123457.7890625", "123457.7890625"), ("123457.7890625", "246915.578125"));
AssertCounterEventsPresent(events, meter.Name, d.Name, "", "", ("87654321987655.4", "87654321987655.4"), ("87654321987655.4", "175308643975310.8"));
AssertCounterEventsPresent(events, meter.Name, d.Name, "", "", ("6.25", "6.25"), ("6.25", "12.5"));
AssertCollectStartStopEventsPresent(events, IntervalSecs, 3);
}

Expand Down

0 comments on commit 9937f2d

Please sign in to comment.