aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/syscall_windows_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/syscall_windows_test.go')
-rw-r--r--src/runtime/syscall_windows_test.go26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/runtime/syscall_windows_test.go b/src/runtime/syscall_windows_test.go
index 30630bc904..79807035cc 100644
--- a/src/runtime/syscall_windows_test.go
+++ b/src/runtime/syscall_windows_test.go
@@ -500,7 +500,7 @@ func TestOutputDebugString(t *testing.T) {
}
func TestRaiseException(t *testing.T) {
- o := executeTest(t, raiseExceptionSource, nil)
+ o := runTestProg(t, "testprog", "RaiseException")
if strings.Contains(o, "RaiseException should not return") {
t.Fatalf("RaiseException did not crash program: %v", o)
}
@@ -509,35 +509,13 @@ func TestRaiseException(t *testing.T) {
}
}
-const raiseExceptionSource = `
-package main
-import "syscall"
-func main() {
- const EXCEPTION_NONCONTINUABLE = 1
- mod := syscall.MustLoadDLL("kernel32.dll")
- proc := mod.MustFindProc("RaiseException")
- proc.Call(0xbad, EXCEPTION_NONCONTINUABLE, 0, 0)
- println("RaiseException should not return")
-}
-`
-
func TestZeroDivisionException(t *testing.T) {
- o := executeTest(t, zeroDivisionExceptionSource, nil)
+ o := runTestProg(t, "testprog", "ZeroDivisionException")
if !strings.Contains(o, "panic: runtime error: integer divide by zero") {
t.Fatalf("No stack trace: %v", o)
}
}
-const zeroDivisionExceptionSource = `
-package main
-func main() {
- x := 1
- y := 0
- z := x / y
- println(z)
-}
-`
-
func TestWERDialogue(t *testing.T) {
if os.Getenv("TESTING_WER_DIALOGUE") == "1" {
defer os.Exit(0)