mirror of
https://github.com/taigrr/gopher-os
synced 2025-01-18 04:43:13 -08:00
By setting up pwd as a Go workspace, we can trim import paths from something like "github.com/achilleasa/gopher-os/kernel" to just "kernel". These changes make forking easier and also allows us to move the code to a different git hosting provider without having to rewrite the imports.
30 lines
629 B
Go
30 lines
629 B
Go
package vmm
|
|
|
|
import (
|
|
"runtime"
|
|
"testing"
|
|
)
|
|
|
|
func TestEarlyReserveAmd64(t *testing.T) {
|
|
if runtime.GOARCH != "amd64" {
|
|
t.Skip("test requires amd64 runtime; skipping")
|
|
}
|
|
|
|
defer func(origLastUsed uintptr) {
|
|
earlyReserveLastUsed = origLastUsed
|
|
}(earlyReserveLastUsed)
|
|
|
|
earlyReserveLastUsed = 4096
|
|
next, err := EarlyReserveRegion(42)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if exp := uintptr(0); next != exp {
|
|
t.Fatal("expected reservation request to be rounded to nearest page")
|
|
}
|
|
|
|
if _, err = EarlyReserveRegion(1); err != errEarlyReserveNoSpace {
|
|
t.Fatalf("expected to get errEarlyReserveNoSpace; got %v", err)
|
|
}
|
|
}
|