diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-12-24 09:27:36 -0500 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-12-24 09:27:36 -0500 |
| commit | 32f051a248617409abadbcfe2ffeec6c4192d5fb (patch) | |
| tree | 9ec47a8b512c78b145e29924e150d5322909f50a | |
| parent | 22d1b0237ecbecad8beb6013aa773731210bab9c (diff) | |
CoinListItem cost should not be zero; added checks
| -rw-r--r-- | sigmod/CoinListItem.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sigmod/CoinListItem.cpp b/sigmod/CoinListItem.cpp index f531f3a1..f68d3daf 100644 --- a/sigmod/CoinListItem.cpp +++ b/sigmod/CoinListItem.cpp @@ -34,7 +34,7 @@ Sigmod::CoinListItem::CoinListItem(const CoinListItem& item) : Sigmod::CoinListItem::CoinListItem(const CoinList* parent, const int id) : Object(parent, id), m_type(Item), - m_object(INT_MAX), + m_object(-1), m_cost(0) { } @@ -56,6 +56,7 @@ void Sigmod::CoinListItem::validate() { TEST_BEGIN(); TEST(setObject, object); + TEST(setCost, cost); TEST_END(); } @@ -91,7 +92,10 @@ void Sigmod::CoinListItem::setObject(const int object) void Sigmod::CoinListItem::setCost(const int cost) { - CHECK(cost); + if (!cost) + emit(error(bounds("cost"))); + else + CHECK(cost); } Sigmod::CoinListItem::Type Sigmod::CoinListItem::type() const |
