MCPcopy
hub / github.com/syncthing/syncthing / TestIndexesForUnknownDevicesDropped

Function TestIndexesForUnknownDevicesDropped

lib/model/model_test.go:2194–2214  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2192}
2193
2194func TestIndexesForUnknownDevicesDropped(t *testing.T) {
2195 m := newModel(t, defaultCfgWrapper, myID, nil)
2196
2197 m.sdb.DropAllFiles("default", device1)
2198 m.sdb.Update("default", device1, genFiles(1))
2199 m.sdb.DropAllFiles("default", device2)
2200 m.sdb.Update("default", device2, genFiles(1))
2201
2202 if devs, err := m.sdb.ListDevicesForFolder("default"); err != nil || len(devs) != 2 {
2203 t.Log(devs, err)
2204 t.Error("expected two devices")
2205 }
2206
2207 m.newFolder(defaultFolderConfig, false)
2208 defer cleanupModel(m)
2209
2210 if devs, err := m.sdb.ListDevicesForFolder("default"); err != nil || len(devs) != 1 {
2211 t.Log(devs, err)
2212 t.Error("expected one device")
2213 }
2214}
2215
2216func TestSharedWithClearedOnDisconnect(t *testing.T) {
2217 wcfg, cancel := newConfigWrapper(defaultCfg)

Callers

nothing calls this directly

Calls 9

newModelFunction · 0.85
genFilesFunction · 0.85
cleanupModelFunction · 0.85
newFolderMethod · 0.80
DropAllFilesMethod · 0.65
UpdateMethod · 0.65
ListDevicesForFolderMethod · 0.65
LogMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected