(t *testing.T)
| 206 | } |
| 207 | |
| 208 | func TestFileReader_Pool(t *testing.T) { |
| 209 | bFile, openErr := bfs.OpenBlocksFile("testdata/test.b", bfs.DefaultBlockFileOptions) |
| 210 | if openErr != nil { |
| 211 | if os.IsNotExist(openErr) { |
| 212 | t.Log(openErr) |
| 213 | return |
| 214 | } |
| 215 | t.Fatal(openErr) |
| 216 | } |
| 217 | |
| 218 | for i := 0; i < 10; i++ { |
| 219 | reader, err := bFile.OpenFileReader(bfs.Hash("123456"), false) |
| 220 | if err != nil { |
| 221 | if os.IsNotExist(err) { |
| 222 | continue |
| 223 | } |
| 224 | t.Fatal(err) |
| 225 | } |
| 226 | |
| 227 | go func() { |
| 228 | err = reader.Close() |
| 229 | if err != nil { |
| 230 | t.Log(err) |
| 231 | } |
| 232 | }() |
| 233 | } |
| 234 | |
| 235 | time.Sleep(100 * time.Millisecond) |
| 236 | t.Log(len(bFile.TestReaderPool())) |
| 237 | } |
nothing calls this directly
no test coverage detected