Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: test/cctest/test-sockets.cc

Issue 42330: Add a close method to sockets (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/platform-win32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 2
3 #include "v8.h" 3 #include "v8.h"
4 #include "platform.h" 4 #include "platform.h"
5 #include "cctest.h" 5 #include "cctest.h"
6 6
7 7
8 using namespace ::v8::internal; 8 using namespace ::v8::internal;
9 9
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 // Wait until data is received. 97 // Wait until data is received.
98 listener->Join(); 98 listener->Join();
99 99
100 // Check that data received is the same as data send. 100 // Check that data received is the same as data send.
101 for (int i = 0; i < len; i++) { 101 for (int i = 0; i < len; i++) {
102 CHECK(data[i] == listener->data()[i]); 102 CHECK(data[i] == listener->data()[i]);
103 } 103 }
104 104
105 // Close the client before the listener to avoid TIME_WAIT issues. 105 // Close the client before the listener to avoid TIME_WAIT issues.
106 client->Close();
106 delete client; 107 delete client;
107 delete listener; 108 delete listener;
108 } 109 }
109 110
110 111
111 TEST(Socket) { 112 TEST(Socket) {
112 bool ok; 113 bool ok;
113 114
114 // Initialize socket support. 115 // Initialize socket support.
115 ok = Socket::Setup(); 116 ok = Socket::Setup();
(...skipping 22 matching lines...) Expand all
138 } 139 }
139 140
140 141
141 TEST(HToNNToH) { 142 TEST(HToNNToH) {
142 uint16_t x = 1234; 143 uint16_t x = 1234;
143 CHECK_EQ(x, Socket::NToH(Socket::HToN(x))); 144 CHECK_EQ(x, Socket::NToH(Socket::HToN(x)));
144 145
145 uint32_t y = 12345678; 146 uint32_t y = 12345678;
146 CHECK(y == Socket::NToH(Socket::HToN(y))); 147 CHECK(y == Socket::NToH(Socket::HToN(y)));
147 } 148 }
OLDNEW
« no previous file with comments | « src/platform-win32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698