MCPcopy
hub / github.com/syncthing/syncthing / pauseDevice

Function pauseDevice

lib/model/testutils_test.go:337–347  ·  view source on GitHub ↗
(t testing.TB, w config.Wrapper, id protocol.DeviceID, paused bool)

Source from the content-addressed store, hash-verified

335}
336
337func pauseDevice(t testing.TB, w config.Wrapper, id protocol.DeviceID, paused bool) {
338 t.Helper()
339 waiter, err := w.Modify(func(cfg *config.Configuration) {
340 _, i, _ := cfg.Device(id)
341 cfg.Devices[i].Paused = paused
342 })
343 if err != nil {
344 t.Fatal(err)
345 }
346 waiter.Wait()
347}
348
349func setDevice(t testing.TB, w config.Wrapper, device config.DeviceConfiguration) {
350 t.Helper()

Callers 1

TestDevicePauseFunction · 0.85

Calls 5

HelperMethod · 0.80
FatalMethod · 0.80
ModifyMethod · 0.65
DeviceMethod · 0.65
WaitMethod · 0.65

Tested by

no test coverage detected