You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2016/03/26 19:04:20 UTC

mesos git commit: Cleaned up libprocess gtest macros.

Repository: mesos
Updated Branches:
  refs/heads/master 5e0be20b7 -> f978d3ce9


Cleaned up libprocess gtest macros.

1. `AWAIT_EQ_FOR` have be added for completeness.
2. Missing equivalents of `EXPECT_TRUE`/`EXPECT_FALSE` have been added:
  - `AWAIT_ASSERT_TRUE_FOR`
  - `AWAIT_ASSERT_TRUE`
  - `AWAIT_ASSERT_FALSE_FOR`
  - `AWAIT_ASSERT_FALSE`
  - `AWAIT_EXPECT_TRUE_FOR`
  - `AWAIT_EXPECT_FALSE_FOR`

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


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

Branch: refs/heads/master
Commit: f978d3ce97ec22fc6f4e52a41ff8e22616c76d55
Parents: 5e0be20
Author: Yong Tang <yo...@outlook.com>
Authored: Sat Mar 26 13:37:07 2016 -0400
Committer: Michael Park <mp...@apache.org>
Committed: Sat Mar 26 13:37:07 2016 -0400

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/gtest.hpp | 32 ++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/f978d3ce/3rdparty/libprocess/include/process/gtest.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/gtest.hpp b/3rdparty/libprocess/include/process/gtest.hpp
index 049152c..30d51d3 100644
--- a/3rdparty/libprocess/include/process/gtest.hpp
+++ b/3rdparty/libprocess/include/process/gtest.hpp
@@ -292,6 +292,10 @@ template <typename T1, typename T2>
   AWAIT_ASSERT_EQ_FOR(expected, actual, Seconds(15))
 
 
+#define AWAIT_EQ_FOR(expected, actual, duration)              \
+  AWAIT_ASSERT_EQ_FOR(expected, actual, duration)
+
+
 #define AWAIT_EQ(expected, actual)              \
   AWAIT_ASSERT_EQ(expected, actual)
 
@@ -304,12 +308,36 @@ template <typename T1, typename T2>
   AWAIT_EXPECT_EQ_FOR(expected, actual, Seconds(15))
 
 
+#define AWAIT_ASSERT_TRUE_FOR(actual, duration)                 \
+  AWAIT_ASSERT_EQ_FOR(true, actual, duration)
+
+
+#define AWAIT_ASSERT_TRUE(actual)       \
+  AWAIT_ASSERT_EQ(true, actual)
+
+
+#define AWAIT_EXPECT_TRUE_FOR(actual, duration)               \
+  AWAIT_EXPECT_EQ_FOR(true, actual, duration)
+
+
 #define AWAIT_EXPECT_TRUE(actual)               \
-  AWAIT_EXPECT_EQ_FOR(true, actual, Seconds(15))
+  AWAIT_EXPECT_EQ(true, actual)
+
+
+#define AWAIT_ASSERT_FALSE_FOR(actual, duration)                 \
+  AWAIT_ASSERT_EQ_FOR(false, actual, duration)
+
+
+#define AWAIT_ASSERT_FALSE(actual)       \
+  AWAIT_ASSERT_EQ(false, actual)
+
+
+#define AWAIT_EXPECT_FALSE_FOR(actual, duration)               \
+  AWAIT_EXPECT_EQ_FOR(false, actual, duration)
 
 
 #define AWAIT_EXPECT_FALSE(actual)               \
-  AWAIT_EXPECT_EQ_FOR(false, actual, Seconds(15))
+  AWAIT_EXPECT_EQ(false, actual)
 
 
 inline ::testing::AssertionResult AwaitAssertResponseStatusEq(