(t *testing.T)
| 142 | } |
| 143 | |
| 144 | func TestFreelistHashmap_GetFreePageIDs(t *testing.T) { |
| 145 | f := newTestHashMapFreelist() |
| 146 | |
| 147 | N := int32(100000) |
| 148 | fm := make(map[common.Pgid]uint64) |
| 149 | i := int32(0) |
| 150 | val := int32(0) |
| 151 | for i = 0; i < N; { |
| 152 | val = rand.Int31n(1000) |
| 153 | fm[common.Pgid(i)] = uint64(val) |
| 154 | i += val |
| 155 | f.freePagesCount += uint64(val) |
| 156 | } |
| 157 | |
| 158 | f.forwardMap = fm |
| 159 | res := f.freePageIds() |
| 160 | |
| 161 | if !sort.SliceIsSorted(res, func(i, j int) bool { return res[i] < res[j] }) { |
| 162 | t.Fatalf("pgids not sorted") |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | func Test_Freelist_Hashmap_Rollback(t *testing.T) { |
| 167 | f := newTestHashMapFreelist() |
nothing calls this directly
no test coverage detected