(t *testing.T)
| 88 | } |
| 89 | |
| 90 | func 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 | |
| 110 | func TestActivatePPSSourceSetPTPPeroutFailure(t *testing.T) { |
| 111 | // Prepare |
nothing calls this directly
no test coverage detected
searching dependent graphs…