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 2017/06/21 01:13:48 UTC
mesos git commit: Replaced incorrect use of `CHECK_GE`s with
`CHECK_GT`.
Repository: mesos
Updated Branches:
refs/heads/master 69187c749 -> 7e7335b5d
Replaced incorrect use of `CHECK_GE`s with `CHECK_GT`.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7e7335b5
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7e7335b5
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7e7335b5
Branch: refs/heads/master
Commit: 7e7335b5d37a67ca45252ccd22b3df0e8b8b436e
Parents: 69187c7
Author: Michael Park <mp...@apache.org>
Authored: Mon Jun 19 14:56:34 2017 -0700
Committer: Michael Park <mp...@apache.org>
Committed: Tue Jun 20 18:12:19 2017 -0700
----------------------------------------------------------------------
src/common/resources.cpp | 8 ++++----
src/v1/resources.cpp | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/7e7335b5/src/common/resources.cpp
----------------------------------------------------------------------
diff --git a/src/common/resources.cpp b/src/common/resources.cpp
index b8c5756..1d9170a 100644
--- a/src/common/resources.cpp
+++ b/src/common/resources.cpp
@@ -890,7 +890,7 @@ Option<Error> Resources::validate(const Resource& resource)
} else {
// Check for the "post-reservation-refinement" format.
- CHECK_GE(resource.reservations_size(), 0);
+ CHECK_GT(resource.reservations_size(), 0);
// Validate all of the roles in `reservations`.
foreach (
@@ -998,7 +998,7 @@ Option<Error> Resources::validate(const Resource& resource)
}
} else {
- CHECK_GE(resource.reservations_size(), 1);
+ CHECK_GT(resource.reservations_size(), 1);
if (resource.has_role()) {
return Error(
"Invalid resource format: 'Resource.role' must not be set if"
@@ -1146,7 +1146,7 @@ bool Resources::hasRefinedReservations(const Resource& resource)
const string& Resources::reservationRole(const Resource& resource)
{
- CHECK_GE(resource.reservations_size(), 0);
+ CHECK_GT(resource.reservations_size(), 0);
return resource.reservations().rbegin()->role();
}
@@ -1454,7 +1454,7 @@ Resources Resources::popReservation() const
Resources result;
foreach (Resource_ resource_, resources) {
- CHECK_GE(resource_.resource.reservations_size(), 0);
+ CHECK_GT(resource_.resource.reservations_size(), 0);
resource_.resource.mutable_reservations()->RemoveLast();
result.add(resource_);
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/7e7335b5/src/v1/resources.cpp
----------------------------------------------------------------------
diff --git a/src/v1/resources.cpp b/src/v1/resources.cpp
index b002bf7..58a00e9 100644
--- a/src/v1/resources.cpp
+++ b/src/v1/resources.cpp
@@ -921,7 +921,7 @@ Option<Error> Resources::validate(const Resource& resource)
} else {
// Check for the "post-reservation-refinement" format.
- CHECK_GE(resource.reservations_size(), 0);
+ CHECK_GT(resource.reservations_size(), 0);
// Validate all of the roles in `reservations`.
foreach (
@@ -1029,7 +1029,7 @@ Option<Error> Resources::validate(const Resource& resource)
}
} else {
- CHECK_GE(resource.reservations_size(), 1);
+ CHECK_GT(resource.reservations_size(), 1);
if (resource.has_role()) {
return Error(
"Invalid resource format: 'Resource.role' must not be set if"
@@ -1177,7 +1177,7 @@ bool Resources::hasRefinedReservations(const Resource& resource)
const string& Resources::reservationRole(const Resource& resource)
{
- CHECK_GE(resource.reservations_size(), 0);
+ CHECK_GT(resource.reservations_size(), 0);
return resource.reservations().rbegin()->role();
}
@@ -1485,7 +1485,7 @@ Resources Resources::popReservation() const
Resources result;
foreach (Resource_ resource_, resources) {
- CHECK_GE(resource_.resource.reservations_size(), 0);
+ CHECK_GT(resource_.resource.reservations_size(), 0);
resource_.resource.mutable_reservations()->RemoveLast();
result.add(resource_);
}