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

Function TestSysoffFromExtendedTS

phc/offset_test.go:62–76  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

60}
61
62func TestSysoffFromExtendedTS(t *testing.T) {
63 extendedTS := [3]PtpClockTime{
64 {Sec: 1667818190, Nsec: 552297411},
65 {Sec: 1667818153, Nsec: 552297462},
66 {Sec: 1667818190, Nsec: 552297522},
67 }
68 sysoff := sysoffFromExtendedTS(extendedTS)
69 want := SysoffResult{
70 SysTime: time.Unix(1667818190, 552297466),
71 PHCTime: time.Unix(1667818153, 552297462),
72 Delay: 111,
73 Offset: 37000000004,
74 }
75 require.Equal(t, want, sysoff)
76}
77
78func TestSysoffFromPrecise(t *testing.T) {
79 preciseTs := &PTPSysOffsetPrecise{

Callers

nothing calls this directly

Calls 2

sysoffFromExtendedTSFunction · 0.85
UnixMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…