Modified a test to use the updated Bytes operators. This is the only test that multiplies/divides Bytes by a decimal value.
Review: https://reviews.apache.org/r/52653/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c1218239 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c1218239 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c1218239 Branch: refs/heads/master Commit: c1218239da746a8db7a79beffb6982d466a018d1 Parents: 4c79b39 Author: Joseph Wu <jos...@mesosphere.io> Authored: Wed Nov 23 13:08:43 2016 -0800 Committer: Joseph Wu <josep...@apache.org> Committed: Wed Nov 23 13:08:43 2016 -0800 ---------------------------------------------------------------------- src/tests/hierarchical_allocator_tests.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/c1218239/src/tests/hierarchical_allocator_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/hierarchical_allocator_tests.cpp b/src/tests/hierarchical_allocator_tests.cpp index edd5cea..3b0eb75 100644 --- a/src/tests/hierarchical_allocator_tests.cpp +++ b/src/tests/hierarchical_allocator_tests.cpp @@ -1061,15 +1061,15 @@ TEST_F(HierarchicalAllocatorTest, Allocatable) // Not enough memory or cpu to be considered allocatable. SlaveInfo slave1 = createSlaveInfo( - "cpus:" + stringify(MIN_CPUS / 2) + ";" - "mem:" + stringify((MIN_MEM / 2).megabytes()) + ";" + "cpus:" + stringify(MIN_CPUS / 2u) + ";" + "mem:" + stringify((MIN_MEM / 2u).megabytes()) + ";" "disk:128"); allocator->addSlave(slave1.id(), slave1, None(), slave1.resources(), {}); // Enough cpus to be considered allocatable. SlaveInfo slave2 = createSlaveInfo( "cpus:" + stringify(MIN_CPUS) + ";" - "mem:" + stringify((MIN_MEM / 2).megabytes()) + ";" + "mem:" + stringify((MIN_MEM / 2u).megabytes()) + ";" "disk:128"); allocator->addSlave(slave2.id(), slave2, None(), slave2.resources(), {}); @@ -1082,7 +1082,7 @@ TEST_F(HierarchicalAllocatorTest, Allocatable) // Enough memory to be considered allocatable. SlaveInfo slave3 = createSlaveInfo( - "cpus:" + stringify(MIN_CPUS / 2) + ";" + "cpus:" + stringify(MIN_CPUS / 2u) + ";" "mem:" + stringify((MIN_MEM).megabytes()) + ";" "disk:128"); allocator->addSlave(slave3.id(), slave3, None(), slave3.resources(), {}); @@ -1097,10 +1097,10 @@ TEST_F(HierarchicalAllocatorTest, Allocatable) // slave4 has enough cpu and memory to be considered allocatable, // but it lies across unreserved and reserved resources! SlaveInfo slave4 = createSlaveInfo( - "cpus:" + stringify(MIN_CPUS / 1.5) + ";" - "mem:" + stringify((MIN_MEM / 2).megabytes()) + ";" - "cpus(role1):" + stringify(MIN_CPUS / 1.5) + ";" - "mem(role1):" + stringify((MIN_MEM / 2).megabytes()) + ";" + "cpus:" + stringify(MIN_CPUS * 3u / 2u) + ";" + "mem:" + stringify((MIN_MEM / 2u).megabytes()) + ";" + "cpus(role1):" + stringify(MIN_CPUS * 3u / 2u) + ";" + "mem(role1):" + stringify((MIN_MEM / 2u).megabytes()) + ";" "disk:128"); allocator->addSlave(slave4.id(), slave4, None(), slave4.resources(), {});