From 19e34cf385f9b2a48de3ebf0d9cb3e9f76c5dba6 Mon Sep 17 00:00:00 2001 From: WAKAYAMA Shirou Date: Sat, 7 Mar 2015 22:06:52 +0900 Subject: [PATCH] process: test pid is wrong in Windows. --- process/process_test.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/process/process_test.go b/process/process_test.go index ca59509..0f3f308 100644 --- a/process/process_test.go +++ b/process/process_test.go @@ -10,9 +10,6 @@ import ( func testGetProcess() Process { checkPid := os.Getpid() // process.test - if runtime.GOOS == "windows" { - checkPid = 7960 - } ret, _ := NewProcess(int32(checkPid)) return *ret } @@ -42,9 +39,7 @@ func Test_Pid_exists(t *testing.T) { func Test_NewProcess(t *testing.T) { checkPid := os.Getpid() - if runtime.GOOS == "windows" { - checkPid = 0 - } + ret, err := NewProcess(int32(checkPid)) if err != nil { t.Errorf("error %v", err) @@ -60,9 +55,7 @@ func Test_NewProcess(t *testing.T) { func Test_Process_memory_maps(t *testing.T) { checkPid := os.Getpid() - if runtime.GOOS == "windows" { - checkPid = 0 - } + ret, err := NewProcess(int32(checkPid)) mmaps, err := ret.MemoryMaps(false) @@ -84,7 +77,7 @@ func Test_Process_MemoryInfo(t *testing.T) { t.Errorf("geting ppid error %v", err) } empty := MemoryInfoStat{} - if *v == empty { + if v == nil || *v == empty { t.Errorf("could not get memory info %v", v) } }