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

Function TestActivatePPSSourceSetPTPPeroutDoubleFailure

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

Source from the content-addressed store, hash-verified

139 // Prepare
140 _, mockDeviceController, finish := SetupMocks(t)
141 defer finish()
142 gomock.InOrder(
143 mockDeviceController.EXPECT().setPinFunc(gomock.Any(), gomock.Any(), gomock.Any()).Return(fmt.Errorf("error")),
144 mockDeviceController.EXPECT().File().Return(os.NewFile(3, "mock_file")),
145 mockDeviceController.EXPECT().Time().Return(time.Unix(1075896000, 500000000), nil),
146 mockDeviceController.EXPECT().setPTPPerout(gomock.Any()).Return(fmt.Errorf("error")),
147 mockDeviceController.EXPECT().setPTPPerout(gomock.Any()).Return(fmt.Errorf("error")),
148 )
149
150 // Act
151 ppsSource, err := ActivatePPSSource(mockDeviceController, 0)
152
153 // Assert
154 require.Error(t, err)
155 require.Nil(t, ppsSource)
156}
157
158func TestGetPPSTimestampSourceUnset(t *testing.T) {
159 _, mockDeviceController, finish := SetupMocks(t)
160 defer finish()
161 ppsSource := PPSSource{PHCDevice: mockDeviceController}
162

Callers

nothing calls this directly

Calls 9

SetupMocksFunction · 0.85
ActivatePPSSourceFunction · 0.85
UnixMethod · 0.80
setPinFuncMethod · 0.65
FileMethod · 0.65
TimeMethod · 0.65
setPTPPeroutMethod · 0.65
EXPECTMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…