diff options
Diffstat (limited to 'src/runtime/mpagealloc_test.go')
| -rw-r--r-- | src/runtime/mpagealloc_test.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/runtime/mpagealloc_test.go b/src/runtime/mpagealloc_test.go index e09dae00a1..3625d45c4c 100644 --- a/src/runtime/mpagealloc_test.go +++ b/src/runtime/mpagealloc_test.go @@ -41,10 +41,11 @@ func checkPageAlloc(t *testing.T, want, got *PageAlloc) { } func TestPageAllocGrow(t *testing.T) { - tests := map[string]struct { + type test struct { chunks []ChunkIdx inUse []AddrRange - }{ + } + tests := map[string]test{ "One": { chunks: []ChunkIdx{ BaseChunkIdx, @@ -112,6 +113,18 @@ func TestPageAllocGrow(t *testing.T) { }, }, } + if PageAlloc64Bit != 0 { + tests["ExtremelyDiscontiguous"] = test{ + chunks: []ChunkIdx{ + BaseChunkIdx, + BaseChunkIdx + 0x100000, // constant translates to O(TiB) + }, + inUse: []AddrRange{ + {PageBase(BaseChunkIdx, 0), PageBase(BaseChunkIdx+1, 0)}, + {PageBase(BaseChunkIdx+0x100000, 0), PageBase(BaseChunkIdx+0x100001, 0)}, + }, + } + } for name, v := range tests { v := v t.Run(name, func(t *testing.T) { |
