treewide: fit test untyped int literals in 32-bit
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m17s
Test / Hakurei (push) Successful in 3m15s
Test / Hpkg (push) Successful in 3m56s
Test / Sandbox (race detector) (push) Successful in 4m6s
Test / Hakurei (race detector) (push) Successful in 5m2s
Test / Flake checks (push) Successful in 1m24s
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m17s
Test / Hakurei (push) Successful in 3m15s
Test / Hpkg (push) Successful in 3m56s
Test / Sandbox (race detector) (push) Successful in 4m6s
Test / Hakurei (race detector) (push) Successful in 5m2s
Test / Flake checks (push) Successful in 1m24s
This enables hakurei test suite to run on 32-bit targets. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -13,7 +13,7 @@ var (
|
||||
type UniqueError uintptr
|
||||
|
||||
func (e UniqueError) Error() string {
|
||||
return "unique error " + strconv.Itoa(int(e)) + " injected by the test suite"
|
||||
return "unique error " + strconv.FormatUint(uint64(e), 10) + " injected by the test suite"
|
||||
}
|
||||
|
||||
func (e UniqueError) Is(target error) bool {
|
||||
|
||||
@@ -3,10 +3,10 @@ package stub
|
||||
import "testing"
|
||||
|
||||
// PanicExit is a magic panic value treated as a simulated exit.
|
||||
const PanicExit = 0xdeadbeef
|
||||
const PanicExit = 0xdead
|
||||
|
||||
const (
|
||||
panicFailNow = 0xcafe0000 + iota
|
||||
panicFailNow = 0xcafe0 + iota
|
||||
panicFatal
|
||||
panicFatalf
|
||||
)
|
||||
|
||||
@@ -53,7 +53,7 @@ func TestHandleExit(t *testing.T) {
|
||||
}
|
||||
}()
|
||||
defer stub.HandleExit(ot)
|
||||
panic(0xcafe0000)
|
||||
panic(0xcafe0)
|
||||
})
|
||||
|
||||
t.Run("Fail", func(t *testing.T) {
|
||||
@@ -66,7 +66,7 @@ func TestHandleExit(t *testing.T) {
|
||||
}
|
||||
}()
|
||||
defer handleExitNew(ot)
|
||||
panic(0xcafe0000)
|
||||
panic(0xcafe0)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -82,14 +82,14 @@ func TestHandleExit(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
defer func() {
|
||||
want := 0xcafebabe
|
||||
want := 0xcafe
|
||||
if r := recover(); r != want {
|
||||
t.Errorf("recover: %v, want %v", r, want)
|
||||
}
|
||||
|
||||
}()
|
||||
defer stub.HandleExit(t)
|
||||
panic(0xcafebabe)
|
||||
panic(0xcafe)
|
||||
})
|
||||
|
||||
t.Run("new", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user