You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/03/02 07:52:21 UTC

[2/3] mesos git commit: Refactored test helper code.

Refactored test helper code.

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


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

Branch: refs/heads/master
Commit: 2db9095ee831145b01e311a0c0dad6ea7d040dbf
Parents: 7ba56d2
Author: Neil Conway <ne...@gmail.com>
Authored: Tue Mar 1 22:51:17 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Tue Mar 1 22:52:12 2016 -0800

----------------------------------------------------------------------
 src/tests/mesos.hpp           | 16 ++++++++++++++++
 src/tests/resources_tests.cpp | 17 -----------------
 2 files changed, 16 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2db9095e/src/tests/mesos.hpp
----------------------------------------------------------------------
diff --git a/src/tests/mesos.hpp b/src/tests/mesos.hpp
index 5f29085..1d4f075 100644
--- a/src/tests/mesos.hpp
+++ b/src/tests/mesos.hpp
@@ -508,6 +508,22 @@ inline Resource::ReservationInfo createReservationInfo(
 }
 
 
+inline Resource createReservedResource(
+    const std::string& name,
+    const std::string& value,
+    const std::string& role,
+    const Option<Resource::ReservationInfo>& reservation)
+{
+  Resource resource = Resources::parse(name, value, role).get();
+
+  if (reservation.isSome()) {
+    resource.mutable_reservation()->CopyFrom(reservation.get());
+  }
+
+  return resource;
+}
+
+
 // NOTE: We only set the volume in DiskInfo if 'containerPath' is set.
 // If volume mode is not specified, Volume::RW will be used (assuming
 // 'containerPath' is set).

http://git-wip-us.apache.org/repos/asf/mesos/blob/2db9095e/src/tests/resources_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/resources_tests.cpp b/src/tests/resources_tests.cpp
index a545100..e7525a0 100644
--- a/src/tests/resources_tests.cpp
+++ b/src/tests/resources_tests.cpp
@@ -1648,23 +1648,6 @@ TEST(ResourcesTest, PrecisionRounding)
 }
 
 
-// Helper for creating a reserved resource.
-static Resource createReservedResource(
-    const string& name,
-    const string& value,
-    const string& role,
-    const Option<Resource::ReservationInfo>& reservation)
-{
-  Resource resource = Resources::parse(name, value, role).get();
-
-  if (reservation.isSome()) {
-    resource.mutable_reservation()->CopyFrom(reservation.get());
-  }
-
-  return resource;
-}
-
-
 TEST(ReservedResourcesTest, Validation)
 {
   // Unreserved.