]> Cypherpunks.ru repositories - gostls13.git/commitdiff
net: rename test files
authorMikio Hara <mikioh.mikioh@gmail.com>
Tue, 23 Feb 2016 09:06:31 +0000 (18:06 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Wed, 24 Feb 2016 03:07:58 +0000 (03:07 +0000)
This change renames {ipraw,tcp,udp,unix}_test.go to
{ipraw,tcp,udp,unix}sock_test.go for clarification. Also moves
NSS-related system configuration test helpers into main_conf_test.go and
main_noconf_test.go.

Change-Id: I28ba1e8ceda7b182ee3aa85f0ca3321388ba45e2
Reviewed-on: https://go-review.googlesource.com/19787
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/iprawsock_test.go [moved from src/net/ipraw_test.go with 100% similarity]
src/net/main_conf_test.go [new file with mode: 0644]
src/net/main_noconf_test.go [moved from src/net/non_unix_test.go with 78% similarity]
src/net/tcpsock_test.go [moved from src/net/tcp_test.go with 100% similarity]
src/net/udpsock_test.go [moved from src/net/udp_test.go with 100% similarity]
src/net/unixsock_test.go [moved from src/net/unix_test.go with 93% similarity]

diff --git a/src/net/main_conf_test.go b/src/net/main_conf_test.go
new file mode 100644 (file)
index 0000000..ba91e8b
--- /dev/null
@@ -0,0 +1,38 @@
+// Copyright 2015 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build !nacl,!plan9,!windows
+
+package net
+
+// forceGoDNS forces the resolver configuration to use the pure Go resolver
+// and returns a fixup function to restore the old settings.
+func forceGoDNS() func() {
+       c := systemConf()
+       oldGo := c.netGo
+       oldCgo := c.netCgo
+       fixup := func() {
+               c.netGo = oldGo
+               c.netCgo = oldCgo
+       }
+       c.netGo = true
+       c.netCgo = false
+       return fixup
+}
+
+// forceCgoDNS forces the resolver configuration to use the cgo resolver
+// and returns a fixup function to restore the old settings.
+// (On non-Unix systems forceCgoDNS returns nil.)
+func forceCgoDNS() func() {
+       c := systemConf()
+       oldGo := c.netGo
+       oldCgo := c.netCgo
+       fixup := func() {
+               c.netGo = oldGo
+               c.netCgo = oldCgo
+       }
+       c.netGo = false
+       c.netCgo = true
+       return fixup
+}
similarity index 78%
rename from src/net/non_unix_test.go
rename to src/net/main_noconf_test.go
index db3427e7cb4f6fc9fc4de50cc6932f137caf5828..a3a3d6e2ee53de277ba2c9b9ba9580600d874694 100644 (file)
@@ -8,7 +8,7 @@ package net
 
 import "runtime"
 
-// See unix_test.go for what these (don't) do.
+// See main_unix_test.go for what these (don't) do.
 func forceGoDNS() func() {
        switch runtime.GOOS {
        case "plan9", "windows":
@@ -18,5 +18,5 @@ func forceGoDNS() func() {
        }
 }
 
-// See unix_test.go for what these (don't) do.
+// See main_unix_test.go for what these (don't) do.
 func forceCgoDNS() func() { return nil }
similarity index 100%
rename from src/net/tcp_test.go
rename to src/net/tcpsock_test.go
similarity index 100%
rename from src/net/udp_test.go
rename to src/net/udpsock_test.go
similarity index 93%
rename from src/net/unix_test.go
rename to src/net/unixsock_test.go
index f0c583068ec08abf6bb93965e37107b3978ae02b..f5e069a1218c1165d760a8b48d65fe9271221d7c 100644 (file)
@@ -440,34 +440,3 @@ func TestUnixUnlink(t *testing.T) {
                t.Fatal("closing unix listener did not remove unix socket")
        }
 }
-
-// forceGoDNS forces the resolver configuration to use the pure Go resolver
-// and returns a fixup function to restore the old settings.
-func forceGoDNS() func() {
-       c := systemConf()
-       oldGo := c.netGo
-       oldCgo := c.netCgo
-       fixup := func() {
-               c.netGo = oldGo
-               c.netCgo = oldCgo
-       }
-       c.netGo = true
-       c.netCgo = false
-       return fixup
-}
-
-// forceCgoDNS forces the resolver configuration to use the cgo resolver
-// and returns a fixup function to restore the old settings.
-// (On non-Unix systems forceCgoDNS returns nil.)
-func forceCgoDNS() func() {
-       c := systemConf()
-       oldGo := c.netGo
-       oldCgo := c.netCgo
-       fixup := func() {
-               c.netGo = oldGo
-               c.netCgo = oldCgo
-       }
-       c.netGo = false
-       c.netCgo = true
-       return fixup
-}