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

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

Issue 242003: Fixed some cctest flakiness on mac. (Closed)
Patch Set: Created 11 years, 2 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
« no previous file with comments | « test/cctest/test-debug.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 24 matching lines...) Expand all
35 Socket* client_; // Single client connection used by the test. 35 Socket* client_; // Single client connection used by the test.
36 Semaphore* listening_; // Signalled when the server socket is in listen mode. 36 Semaphore* listening_; // Signalled when the server socket is in listen mode.
37 }; 37 };
38 38
39 39
40 void SocketListenerThread::Run() { 40 void SocketListenerThread::Run() {
41 bool ok; 41 bool ok;
42 42
43 // Create the server socket and bind it to the requested port. 43 // Create the server socket and bind it to the requested port.
44 server_ = OS::CreateSocket(); 44 server_ = OS::CreateSocket();
45 server_->SetReuseAddress(true);
45 CHECK(server_ != NULL); 46 CHECK(server_ != NULL);
46 ok = server_->Bind(port_); 47 ok = server_->Bind(port_);
47 CHECK(ok); 48 CHECK(ok);
48 49
49 // Listen for new connections. 50 // Listen for new connections.
50 ok = server_->Listen(1); 51 ok = server_->Listen(1);
51 CHECK(ok); 52 CHECK(ok);
52 listening_->Signal(); 53 listening_->Signal();
53 54
54 // Accept a connection. 55 // Accept a connection.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 153 }
153 154
154 155
155 TEST(HToNNToH) { 156 TEST(HToNNToH) {
156 uint16_t x = 1234; 157 uint16_t x = 1234;
157 CHECK_EQ(x, Socket::NToH(Socket::HToN(x))); 158 CHECK_EQ(x, Socket::NToH(Socket::HToN(x)));
158 159
159 uint32_t y = 12345678; 160 uint32_t y = 12345678;
160 CHECK(y == Socket::NToH(Socket::HToN(y))); 161 CHECK(y == Socket::NToH(Socket::HToN(y)));
161 } 162 }
OLDNEW
« no previous file with comments | « test/cctest/test-debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698