diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-21 22:01:02 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-21 22:01:02 +0000 |
commit | 39205d7701e4347f10c8c8a941304ede08f28daa (patch) | |
tree | 721640bea663ce25474d9d8f3da56fd476bf5b34 /libgo | |
parent | 1bf4f2e08d2f3a413022ea60e02b2a397781b8d4 (diff) | |
download | gcc-39205d7701e4347f10c8c8a941304ede08f28daa.tar.gz |
Fix race condition in test case.
Brought over from master repository.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169106 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/go/net/dnsname_test.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libgo/go/net/dnsname_test.go b/libgo/go/net/dnsname_test.go index f4089c5db8a..0c1a6251899 100644 --- a/libgo/go/net/dnsname_test.go +++ b/libgo/go/net/dnsname_test.go @@ -27,7 +27,7 @@ var tests = []testCase{ {"a.b..com", false}, } -func getTestCases(ch chan<- *testCase) { +func getTestCases(ch chan<- testCase) { defer close(ch) var char59 = "" var char63 = "" @@ -39,17 +39,17 @@ func getTestCases(ch chan<- *testCase) { char64 = char63 + "a" for _, tc := range tests { - ch <- &tc + ch <- tc } - ch <- &testCase{char63 + ".com", true} - ch <- &testCase{char64 + ".com", false} + ch <- testCase{char63 + ".com", true} + ch <- testCase{char64 + ".com", false} // 255 char name is fine: - ch <- &testCase{char59 + "." + char63 + "." + char63 + "." + + ch <- testCase{char59 + "." + char63 + "." + char63 + "." + char63 + ".com", true} // 256 char name is bad: - ch <- &testCase{char59 + "a." + char63 + "." + char63 + "." + + ch <- testCase{char59 + "a." + char63 + "." + char63 + "." + char63 + ".com", false} } @@ -58,7 +58,7 @@ func TestDNSNames(t *testing.T) { if runtime.GOOS == "windows" { return } - ch := make(chan *testCase) + ch := make(chan testCase) go getTestCases(ch) for tc := range ch { if isDomainName(tc.name) != tc.result { |