]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/pprof: use switch for GOOS check in testCPUProfile
authorTobias Klauser <tklauser@distanz.ch>
Wed, 1 Nov 2017 16:06:52 +0000 (17:06 +0100)
committerTobias Klauser <tobias.klauser@gmail.com>
Thu, 2 Nov 2017 07:21:28 +0000 (07:21 +0000)
Since CL 33071, testCPUProfile is only one user of the badOS map.
Replace it by the corresponding switch, with the "plan9" case removed
because it is already checked earlier in the same function.

Change-Id: Id647b8ee1fd37516bb702b35b3c9296a4f56b61b
Reviewed-on: https://go-review.googlesource.com/75110
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/pprof/pprof_test.go

index 81c44af2b7c683eae1def7072437002cfe4eb37f..b138420728b7a0550a6a7caa83e29a45cdd3ff62 100644 (file)
@@ -177,7 +177,8 @@ func testCPUProfile(t *testing.T, need []string, f func(dur time.Duration)) {
                }
        }
 
-       if badOS[runtime.GOOS] {
+       switch runtime.GOOS {
+       case "darwin", "dragonfly", "netbsd", "solaris":
                t.Skipf("ignoring failure on %s; see golang.org/issue/13841", runtime.GOOS)
        }
        // Ignore the failure if the tests are running in a QEMU-based emulator,
@@ -392,15 +393,6 @@ func TestMathBigDivide(t *testing.T) {
        })
 }
 
-// Operating systems that are expected to fail the tests. See issue 13841.
-var badOS = map[string]bool{
-       "darwin":    true,
-       "netbsd":    true,
-       "plan9":     true,
-       "dragonfly": true,
-       "solaris":   true,
-}
-
 func TestBlockProfile(t *testing.T) {
        type TestCase struct {
                name string