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

Function TestActivatePPSSourceIgnoreSetPinFailure

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

Source from the content-addressed store, hash-verified

88}
89
90func TestActivatePPSSourceIgnoreSetPinFailure(t *testing.T) {
91 // Prepare
92 _, mockDeviceController, finish := SetupMocks(t)
93 defer finish()
94 gomock.InOrder(
95 // If ioctl set pin fails, we continue bravely on...
96 mockDeviceController.EXPECT().setPinFunc(gomock.Any(), gomock.Any(), gomock.Any()).Return(fmt.Errorf("error")),
97 mockDeviceController.EXPECT().File().Return(os.NewFile(3, "mock_file")),
98 mockDeviceController.EXPECT().Time().Return(time.Unix(1075896000, 500000000), nil),
99 mockDeviceController.EXPECT().setPTPPerout(gomock.Any()).Return(nil),
100 )
101
102 // Act
103 ppsSource, err := ActivatePPSSource(mockDeviceController, 0)
104
105 // Assert
106 require.NoError(t, err)
107 require.Equal(t, PPSSet, ppsSource.state)
108}
109
110func TestActivatePPSSourceSetPTPPeroutFailure(t *testing.T) {
111 // Prepare

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…