You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bb...@apache.org on 2018/05/31 08:27:51 UTC

[2/3] mesos git commit: Used `*_SOME` macro for checking `Try` values in stout.

Used `*_SOME` macro for checking `Try` values in stout.

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


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

Branch: refs/heads/master
Commit: 4760a777ee36312f3fa8da484a6d93db6bf40416
Parents: 0f6ce84
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Thu May 31 10:10:49 2018 +0200
Committer: Benjamin Bannier <bb...@apache.org>
Committed: Thu May 31 10:17:35 2018 +0200

----------------------------------------------------------------------
 3rdparty/stout/tests/none_tests.cpp        | 18 +++++++++++-------
 3rdparty/stout/tests/os/sendfile_tests.cpp |  3 +--
 2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/4760a777/3rdparty/stout/tests/none_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/none_tests.cpp b/3rdparty/stout/tests/none_tests.cpp
index b6bbb88..1c7f646 100644
--- a/3rdparty/stout/tests/none_tests.cpp
+++ b/3rdparty/stout/tests/none_tests.cpp
@@ -12,10 +12,9 @@
 
 #include <string>
 
-#include <gtest/gtest.h>
-
 #include <gmock/gmock.h>
 
+#include <stout/gtest.hpp>
 #include <stout/none.hpp>
 #include <stout/option.hpp>
 #include <stout/result.hpp>
@@ -57,15 +56,20 @@ TEST(NoneTest, Test)
 {
   Option<string> o = none1();
   EXPECT_TRUE(o.isNone());
+  EXPECT_NONE(o);
+
   o = none2();
-  EXPECT_TRUE(o.isNone());
+  EXPECT_NONE(o);
+
   o = none3(none1());
-  EXPECT_TRUE(o.isNone());
+  EXPECT_NONE(o);
 
   Result<string> r = none1();
-  EXPECT_TRUE(r.isNone());
+  EXPECT_NONE(r);
+
   r = none4();
-  EXPECT_TRUE(r.isNone());
+  EXPECT_NONE(r);
+
   r = none5(none1());
-  EXPECT_TRUE(r.isNone());
+  EXPECT_NONE(r);
 }

http://git-wip-us.apache.org/repos/asf/mesos/blob/4760a777/3rdparty/stout/tests/os/sendfile_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/os/sendfile_tests.cpp b/3rdparty/stout/tests/os/sendfile_tests.cpp
index 2a85683..cc1fa11 100644
--- a/3rdparty/stout/tests/os/sendfile_tests.cpp
+++ b/3rdparty/stout/tests/os/sendfile_tests.cpp
@@ -153,8 +153,7 @@ TEST_F(OsSendfileTest, Sendfile)
 
   Try<ssize_t, SocketError> length =
     os::sendfile(s[0], fd.get(), 0, LOREM_IPSUM.size());
-  ASSERT_TRUE(length.isSome());
-  ASSERT_EQ(static_cast<ssize_t>(LOREM_IPSUM.size()), length.get());
+  ASSERT_SOME_EQ(static_cast<ssize_t>(LOREM_IPSUM.size()), length);
 
   char* buffer = new char[LOREM_IPSUM.size()];
   ASSERT_EQ(static_cast<ssize_t>(LOREM_IPSUM.size()),