You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2015/02/08 16:51:38 UTC

[11/20] mesos git commit: Used new std::string Socket::recv/send overloads in tests.

Used new std::string Socket::recv/send overloads in tests.

Review: https://reviews.apache.org/r/29530


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/16dc6c55
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/16dc6c55
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/16dc6c55

Branch: refs/heads/master
Commit: 16dc6c55b0c224a741fa5597a589f1c6d29a19f1
Parents: 5eba5e2
Author: Benjamin Hindman <be...@gmail.com>
Authored: Fri Dec 26 09:38:50 2014 -0800
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Sat Feb 7 14:42:46 2015 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/src/tests/http_tests.cpp    | 7 ++-----
 3rdparty/libprocess/src/tests/process_tests.cpp | 7 ++-----
 2 files changed, 4 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/16dc6c55/3rdparty/libprocess/src/tests/http_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/http_tests.cpp b/3rdparty/libprocess/src/tests/http_tests.cpp
index 83ca10e..ec64e60 100644
--- a/3rdparty/libprocess/src/tests/http_tests.cpp
+++ b/3rdparty/libprocess/src/tests/http_tests.cpp
@@ -133,14 +133,11 @@ TEST(HTTP, Endpoints)
   EXPECT_CALL(process, body(_))
     .WillOnce(Return(http::OK()));
 
-  AWAIT_EXPECT_EQ(data.size(), socket.send(data.data(), data.size()));
+  AWAIT_READY(socket.send(data));
 
   string response = "HTTP/1.1 200 OK";
 
-  char temp[response.size()];
-
-  AWAIT_EXPECT_EQ(response.size(), socket.recv(temp, response.size()));
-  ASSERT_EQ(response, string(temp, response.size()));
+  AWAIT_EXPECT_EQ(response, socket.recv(response.size()));
 
   // Now hit '/pipe' (by using http::get).
   int pipes[2];

http://git-wip-us.apache.org/repos/asf/mesos/blob/16dc6c55/3rdparty/libprocess/src/tests/process_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/process_tests.cpp b/3rdparty/libprocess/src/tests/process_tests.cpp
index 5580546..fe758ab 100644
--- a/3rdparty/libprocess/src/tests/process_tests.cpp
+++ b/3rdparty/libprocess/src/tests/process_tests.cpp
@@ -1435,7 +1435,7 @@ TEST(Process, remote)
 
   const string& data = MessageEncoder::encode(&message);
 
-  AWAIT_EXPECT_EQ(data.size(), socket.send(data.data(), data.size()));
+  AWAIT_READY(socket.send(data));
 
   AWAIT_READY(handler);
 
@@ -1533,10 +1533,7 @@ TEST(Process, http2)
 
   const string data = "POST /" + name + " HTTP/1.1";
 
-  char temp[data.size()];
-
-  AWAIT_ASSERT_EQ(data.size(), client.recv(temp, data.size()));
-  ASSERT_EQ(data, string(temp, data.size()));
+  AWAIT_EXPECT_EQ(data, client.recv(data.size()));
 
   terminate(process);
   wait(process);