(t *testing.T)
| 81 | } |
| 82 | |
| 83 | func TestDaemonStateAggregateMax(t *testing.T) { |
| 84 | s := newDaemonState(3) |
| 85 | |
| 86 | probes := []*DataPoint{ |
| 87 | { |
| 88 | MasterOffsetNS: 123.0, |
| 89 | PathDelayNS: 3, |
| 90 | FreqAdjustmentPPB: 4, |
| 91 | }, |
| 92 | { |
| 93 | MasterOffsetNS: -2000.0, |
| 94 | PathDelayNS: 300, |
| 95 | FreqAdjustmentPPB: 2, |
| 96 | }, |
| 97 | { |
| 98 | MasterOffsetNS: 1009.0, |
| 99 | PathDelayNS: 200, |
| 100 | FreqAdjustmentPPB: 5, |
| 101 | }, |
| 102 | } |
| 103 | |
| 104 | for _, tr := range probes { |
| 105 | s.pushDataPoint(tr) |
| 106 | } |
| 107 | got := s.aggregateDataPointsMax(3) |
| 108 | want := &DataPoint{ |
| 109 | MasterOffsetNS: 2000.0, |
| 110 | PathDelayNS: 300, |
| 111 | FreqAdjustmentPPB: 5, |
| 112 | } |
| 113 | require.Equal(t, want, got) |
| 114 | } |
| 115 | |
| 116 | func TestTargetsChange(t *testing.T) { |
| 117 | testCases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…