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/12/13 19:24:41 UTC

mesos git commit: Windows: Fix build break in libprocess tests.

Repository: mesos
Updated Branches:
  refs/heads/master f542c2940 -> 6cee5cb0e


Windows: Fix build break in libprocess tests.

Commit f61f321b calls a macro, `INSTANTIATE_TEST_CASE_P`, with some
arguments `#ifdef`'d. This breaks MSVC 1900 build; the specification
does not require the text a macro expands to be processed, which means
that the un-processed `#ifdef` ends up in the expansion of
`INSTANTIATE_TEST_CASE_P`, which causes a build-time error.

This commit will resolve this problem by moving the `#ifdef` to surround
the invocation of `INSTANTIATE_TEST_CASE_P` instead of being around the
arguments to the macro.

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


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

Branch: refs/heads/master
Commit: 6cee5cb0ed181b3e68bc4d51a80a85562fbc2510
Parents: f542c29
Author: Alex Clemmer <cl...@gmail.com>
Authored: Tue Dec 13 11:17:07 2016 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Tue Dec 13 11:24:36 2016 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/src/tests/http_tests.cpp | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/6cee5cb0/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 38b8778..d168ad1 100644
--- a/3rdparty/libprocess/src/tests/http_tests.cpp
+++ b/3rdparty/libprocess/src/tests/http_tests.cpp
@@ -200,14 +200,23 @@ public:
 };
 
 
+// NOTE: We don't simply `#ifdef` out the `string("https")` argument inside
+// the `INSTANTIATE_TEST_CASE_P` because the `#ifdef` would not be required
+// to expand. In particular, it would break the build with MSVC.
+#ifdef USE_SSL_SOCKET
 INSTANTIATE_TEST_CASE_P(
     Scheme,
     HTTPTest,
     ::testing::Values(
-#ifdef USE_SSL_SOCKET
         string("https"),
-#endif // USE_SSL_SOCKET
         string("http")));
+#else
+INSTANTIATE_TEST_CASE_P(
+    Scheme,
+    HTTPTest,
+    ::testing::Values(
+        string("http")));
+#endif // USE_SSL_SOCKET
 
 
 // TODO(vinod): Use AWAIT_EXPECT_RESPONSE_STATUS_EQ in the tests.