MCPcopy Create free account
hub / github.com/facebook/time / TestAggregateDataPointsMaxSingleEntry

Function TestAggregateDataPointsMaxSingleEntry

fbclock/daemon/state_test.go:171–183  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

169 require.Equal(t, 500.0, got.MasterOffsetNS)
170 require.Equal(t, 200.0, got.PathDelayNS)
171 require.Equal(t, 300.0, got.FreqAdjustmentPPB)
172}
173
174func TestAggregateDataPointsMaxNegativeValues(t *testing.T) {
175 s := newDaemonState(5)
176 s.pushDataPoint(&DataPoint{MasterOffsetNS: -100, PathDelayNS: -50, FreqAdjustmentPPB: -25})
177 s.pushDataPoint(&DataPoint{MasterOffsetNS: 80, PathDelayNS: 40, FreqAdjustmentPPB: 20})
178 s.pushDataPoint(&DataPoint{MasterOffsetNS: -200, PathDelayNS: -150, FreqAdjustmentPPB: -300})
179
180 got := s.aggregateDataPointsMax(5)
181 require.Equal(t, 200.0, got.MasterOffsetNS)
182 require.Equal(t, 150.0, got.PathDelayNS)
183 require.Equal(t, 300.0, got.FreqAdjustmentPPB)
184}
185
186func TestTakeDataPointEmpty(t *testing.T) {

Callers

nothing calls this directly

Calls 3

newDaemonStateFunction · 0.85
pushDataPointMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…