(t *testing.T)
| 3982 | } |
| 3983 | |
| 3984 | func TestCCFolderNotRunning(t *testing.T) { |
| 3985 | // Create the folder, but don't start it. |
| 3986 | w, fcfg := newDefaultCfgWrapper(t) |
| 3987 | tfs := fcfg.Filesystem() |
| 3988 | m := newModel(t, w, myID, nil) |
| 3989 | defer cleanupModelAndRemoveDir(m, tfs.URI()) |
| 3990 | |
| 3991 | // A connection can happen before all the folders are started. |
| 3992 | cc, _ := m.generateClusterConfig(device1) |
| 3993 | if l := len(cc.Folders); l != 1 { |
| 3994 | t.Fatalf("Expected 1 folder in CC, got %v", l) |
| 3995 | } |
| 3996 | folder := cc.Folders[0] |
| 3997 | if id := folder.ID; id != fcfg.ID { |
| 3998 | t.Fatalf("Expected folder %v, got %v", fcfg.ID, id) |
| 3999 | } |
| 4000 | if l := len(folder.Devices); l != 2 { |
| 4001 | t.Fatalf("Expected 2 devices in CC, got %v", l) |
| 4002 | } |
| 4003 | local := folder.Devices[1] |
| 4004 | if local.ID != myID { |
| 4005 | local = folder.Devices[0] |
| 4006 | } |
| 4007 | if folder.StopReason != protocol.FolderStopReasonPaused && local.IndexID == 0 { |
| 4008 | t.Errorf("Folder isn't paused, but index-id is zero") |
| 4009 | } |
| 4010 | } |
| 4011 | |
| 4012 | func TestPendingFolder(t *testing.T) { |
| 4013 | w, _ := newDefaultCfgWrapper(t) |
nothing calls this directly
no test coverage detected