summaryrefslogtreecommitdiffstats
path: root/sigmod/CoinListItem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sigmod/CoinListItem.cpp')
-rw-r--r--sigmod/CoinListItem.cpp8
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