Repository: mesos Updated Branches: refs/heads/master e042aa071 -> 9536dbc09
Used double comparison in an allocator test. Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9536dbc0 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9536dbc0 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9536dbc0 Branch: refs/heads/master Commit: 9536dbc090116e5695069639adfde4878d69870f Parents: e042aa0 Author: Alexander Rukletsov <al...@apache.org> Authored: Thu Sep 29 20:24:29 2016 +0200 Committer: Alexander Rukletsov <al...@apache.org> Committed: Thu Sep 29 20:24:29 2016 +0200 ---------------------------------------------------------------------- src/tests/hierarchical_allocator_tests.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/9536dbc0/src/tests/hierarchical_allocator_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/hierarchical_allocator_tests.cpp b/src/tests/hierarchical_allocator_tests.cpp index ed4d26c..7957873 100644 --- a/src/tests/hierarchical_allocator_tests.cpp +++ b/src/tests/hierarchical_allocator_tests.cpp @@ -1780,7 +1780,10 @@ TEST_F(HierarchicalAllocatorTest, NoDoubleAccounting) JSON::Object metrics = Metrics(); string metric1 = "allocator/mesos/roles/" + ROLE1 + "/shares/dominant"; string metric2 = "allocator/mesos/roles/" + ROLE2 + "/shares/dominant"; - EXPECT_EQ(metrics.values[metric1], metrics.values[metric2]); + + double share1 = metrics.values[metric1].as<JSON::Number>().as<double>(); + double share2 = metrics.values[metric2].as<JSON::Number>().as<double>(); + EXPECT_DOUBLE_EQ(share1, share2); }