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

Function TestPrepareMathParameters

fbclock/daemon/helpers_test.go:82–96  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

80}
81
82func TestPrepareMathParameters(t *testing.T) {
83 dataPoints := []*DataPoint{
84 {MasterOffsetNS: 10.0, PathDelayNS: 100.0, FreqAdjustmentPPB: 1000.0, ClockAccuracyNS: 25.0},
85 {MasterOffsetNS: 20.0, PathDelayNS: 200.0, FreqAdjustmentPPB: 1500.0, ClockAccuracyNS: 50.0},
86 {MasterOffsetNS: 30.0, PathDelayNS: 300.0, FreqAdjustmentPPB: 1200.0, ClockAccuracyNS: 75.0},
87 }
88
89 got := prepareMathParameters(dataPoints)
90 require.Equal(t, []float64{10.0, 20.0, 30.0}, got["offset"])
91 require.Equal(t, []float64{100.0, 200.0, 300.0}, got["delay"])
92 require.Equal(t, []float64{1000.0, 1500.0, 1200.0}, got["freq"])
93 require.Equal(t, []float64{25.0, 50.0, 75.0}, got["clockaccuracy"])
94 require.Equal(t, []float64{500.0, -300.0}, got["freqchange"])
95 require.Equal(t, []float64{500.0, 300.0}, got["freqchangeabs"])
96}
97
98func TestPrepareMathParametersSinglePoint(t *testing.T) {
99 dataPoints := []*DataPoint{

Callers

nothing calls this directly

Calls 1

prepareMathParametersFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…