(t *testing.T)
| 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 | |
| 174 | func 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 | |
| 186 | func TestTakeDataPointEmpty(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…