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

Function TestGetPPSTimestampSourceUnset

phc/pps_source_test.go:161–171  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

159 _, mockDeviceController, finish := SetupMocks(t)
160 defer finish()
161 ppsSource := PPSSource{PHCDevice: mockDeviceController}
162
163 // Act
164 _, err := ppsSource.Timestamp()
165
166 // Assert
167 require.Error(t, err)
168}
169
170func TestGetPPSTimestampMoreThanHalfSecondShouldRemoveNanosseconds(t *testing.T) {
171 _, mockDeviceController, finish := SetupMocks(t)
172 defer finish()
173 ppsSource := PPSSource{PHCDevice: mockDeviceController, state: PPSSet, peroutPhase: 23312}
174 mockDeviceController.EXPECT().Time().Return(time.Unix(1075896000, 500023313), nil)

Callers

nothing calls this directly

Calls 3

TimestampMethod · 0.95
SetupMocksFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…