(t *testing.T)
| 25 | ) |
| 26 | |
| 27 | func TestSysoffEstimateBasic(t *testing.T) { |
| 28 | ts1 := time.Unix(0, 1667818190552297411) |
| 29 | rt := time.Unix(0, 1667818153552297462) |
| 30 | ts2 := time.Unix(0, 1667818190552297522) |
| 31 | got := SysoffEstimateBasic(ts1, rt, ts2) |
| 32 | want := SysoffResult{ |
| 33 | SysTime: time.Unix(0, 1667818190552297466), |
| 34 | PHCTime: rt, |
| 35 | Delay: ts2.Sub(ts1), |
| 36 | Offset: time.Duration(37000000005), |
| 37 | } |
| 38 | require.Equal(t, want, got) |
| 39 | } |
| 40 | |
| 41 | func TestSysoffBestSample(t *testing.T) { |
| 42 | extended := &PTPSysOffsetExtended{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…