(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func TestNewMetaFile_Memory(t *testing.T) { |
| 52 | var count = 2 |
| 53 | |
| 54 | if testutils.IsSingleTesting() { |
| 55 | count = 100 |
| 56 | } |
| 57 | |
| 58 | var stat1 = testutils.ReadMemoryStat() |
| 59 | |
| 60 | var mFiles []*bfs.MetaFile |
| 61 | |
| 62 | for i := 0; i < count; i++ { |
| 63 | mFile, err := bfs.OpenMetaFile("testdata/test2.m", &sync.RWMutex{}) |
| 64 | if err != nil { |
| 65 | if bfs.IsNotExist(err) { |
| 66 | continue |
| 67 | } |
| 68 | t.Fatal(err) |
| 69 | } |
| 70 | |
| 71 | _ = mFile.Close() |
| 72 | mFiles = append(mFiles, mFile) |
| 73 | } |
| 74 | |
| 75 | var stat2 = testutils.ReadMemoryStat() |
| 76 | t.Log((stat2.HeapInuse-stat1.HeapInuse)>>20, "MiB") |
| 77 | } |
| 78 | |
| 79 | func TestMetaFile_FileHeaders(t *testing.T) { |
| 80 | mFile, openErr := bfs.OpenMetaFile("testdata/test2.m", &sync.RWMutex{}) |
nothing calls this directly
no test coverage detected