(b *testing.B)
| 231 | } |
| 232 | |
| 233 | func BenchmarkRequestInSingleFile(b *testing.B) { |
| 234 | w, cancel := newConfigWrapper(defaultCfg) |
| 235 | defer cancel() |
| 236 | ffs := w.FolderList()[0].Filesystem() |
| 237 | m := setupModel(b, w) |
| 238 | defer cleanupModel(m) |
| 239 | |
| 240 | buf := make([]byte, 128<<10) |
| 241 | srand.Read(buf) |
| 242 | must(b, ffs.MkdirAll("request/for/a/file/in/a/couple/of/dirs", 0o755)) |
| 243 | writeFile(b, ffs, "request/for/a/file/in/a/couple/of/dirs/128k", buf) |
| 244 | |
| 245 | b.ResetTimer() |
| 246 | |
| 247 | for i := 0; i < b.N; i++ { |
| 248 | if _, err := m.Request(device1Conn, &protocol.Request{Folder: "default", Name: "request/for/a/file/in/a/couple/of/dirs/128k", Size: 128 << 10}); err != nil { |
| 249 | b.Error(err) |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | b.SetBytes(128 << 10) |
| 254 | } |
| 255 | |
| 256 | func TestDeviceRename(t *testing.T) { |
| 257 | hello := protocol.Hello{ |
nothing calls this directly
no test coverage detected