[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [5817] Test invariants in one place
From: |
Greg Chicares |
Subject: |
[lmi-commits] [5817] Test invariants in one place |
Date: |
Mon, 04 Nov 2013 18:23:32 +0000 |
Revision: 5817
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5817
Author: chicares
Date: 2013-11-04 18:23:31 +0000 (Mon, 04 Nov 2013)
Log Message:
-----------
Test invariants in one place
Modified Paths:
--------------
lmi/trunk/progress_meter.hpp
lmi/trunk/progress_meter_test.cpp
Modified: lmi/trunk/progress_meter.hpp
===================================================================
--- lmi/trunk/progress_meter.hpp 2013-11-04 13:43:36 UTC (rev 5816)
+++ lmi/trunk/progress_meter.hpp 2013-11-04 18:23:31 UTC (rev 5817)
@@ -113,8 +113,6 @@
/// incrementing the counter. Thus, it enforces the invariant expected
/// in the canonical 'for' statement
/// for(int i = 0; i < maximum; ++i) {assert(i < maximum);}
-/// Arguably this is useless, but it's quite inexpensive, and it's
-/// worth the cost if it ever finds a problem.
///
/// culminate() warns if the iteration counter hasn't been incremented
/// exactly to its maximum, unless the operation was cancelled. This
Modified: lmi/trunk/progress_meter_test.cpp
===================================================================
--- lmi/trunk/progress_meter_test.cpp 2013-11-04 13:43:36 UTC (rev 5816)
+++ lmi/trunk/progress_meter_test.cpp 2013-11-04 18:23:31 UTC (rev 5817)
@@ -78,11 +78,6 @@
("Some title...\n"
,progress_meter_unit_test_stream().str()
);
- BOOST_TEST_THROW
- (meter->reflect_progress()
- ,std::runtime_error
- ,"Progress meter maximum count exceeded."
- );
}
void progress_meter_test::test_quiet_display_mode()
@@ -159,11 +154,6 @@
("\n"
,progress_meter_unit_test_stream().str()
);
- BOOST_TEST_THROW
- (meter->reflect_progress()
- ,std::runtime_error
- ,"Progress meter maximum count exceeded."
- );
}
void progress_meter_test::test_invalid_display_mode()
@@ -219,6 +209,13 @@
<< std::endl
;
meter->culminate();
+
+ meter->reflect_progress();
+ BOOST_TEST_THROW
+ (meter->reflect_progress()
+ ,std::runtime_error
+ ,"Progress meter maximum count exceeded."
+ );
}
int test_main(int, char*[])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [5817] Test invariants in one place,
Greg Chicares <=