| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Tests socket exceptions. | 5 // Tests socket exceptions. |
| 6 | 6 |
| 7 #import("dart:io"); |
| 8 |
| 7 class SocketExceptionTest { | 9 class SocketExceptionTest { |
| 8 | 10 |
| 9 static final PORT = 0; | 11 static final PORT = 0; |
| 10 static final HOST = "127.0.0.1"; | 12 static final HOST = "127.0.0.1"; |
| 11 | 13 |
| 12 static void serverSocketExceptionTest() { | 14 static void serverSocketExceptionTest() { |
| 13 bool exceptionCaught = false; | 15 bool exceptionCaught = false; |
| 14 bool wrongExceptionCaught = false; | 16 bool wrongExceptionCaught = false; |
| 15 | 17 |
| 16 ServerSocket server = new ServerSocket(HOST, PORT, 10); | 18 ServerSocket server = new ServerSocket(HOST, PORT, 10); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 static void testMain() { | 171 static void testMain() { |
| 170 serverSocketExceptionTest(); | 172 serverSocketExceptionTest(); |
| 171 clientSocketExceptionTest(); | 173 clientSocketExceptionTest(); |
| 172 indexOutOfRangeExceptionTest(); | 174 indexOutOfRangeExceptionTest(); |
| 173 } | 175 } |
| 174 } | 176 } |
| 175 | 177 |
| 176 main() { | 178 main() { |
| 177 SocketExceptionTest.testMain(); | 179 SocketExceptionTest.testMain(); |
| 178 } | 180 } |
| OLD | NEW |