Added a precision test for Resources.

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


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

Branch: refs/heads/master
Commit: 2e40c67ecf68bd818b789d5dd17baf5e00c43e2b
Parents: e74853e
Author: Jie Yu <[email protected]>
Authored: Wed Jun 24 15:09:08 2015 -0700
Committer: Jie Yu <[email protected]>
Committed: Thu Jun 25 10:25:44 2015 -0700

----------------------------------------------------------------------
 src/tests/resources_tests.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2e40c67e/src/tests/resources_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/resources_tests.cpp b/src/tests/resources_tests.cpp
index 9f96b14..30c10f3 100644
--- a/src/tests/resources_tests.cpp
+++ b/src/tests/resources_tests.cpp
@@ -933,6 +933,18 @@ TEST(ResourcesTest, Types)
 }
 
 
+// NOTE: This is disabled due to MESOS-1187.
+TEST(ResourcesTest, DISABLED_Precision)
+{
+  Resources cpu = Resources::parse("cpus:0.1").get();
+
+  Resources r1 = cpu + cpu + cpu - cpu - cpu;
+  Resources r2 = cpu;
+
+  EXPECT_EQ(r1, r2);
+}
+
+
 // Helper for creating a reserved resource.
 static Resource createReservedResource(
     const string& name,

Reply via email to