ConsoleFileAllocationMonitorTest.cc 894 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "ConsoleFileAllocationMonitor.h"
  2. #include <string>
  3. #include <cppunit/extensions/HelperMacros.h>
  4. using namespace std;
  5. class ConsoleFileAllocationMonitorTest:public CppUnit::TestFixture {
  6. CPPUNIT_TEST_SUITE(ConsoleFileAllocationMonitorTest);
  7. CPPUNIT_TEST(testShowProgress);
  8. CPPUNIT_TEST_SUITE_END();
  9. private:
  10. public:
  11. void setUp() {
  12. }
  13. void testShowProgress();
  14. };
  15. CPPUNIT_TEST_SUITE_REGISTRATION( ConsoleFileAllocationMonitorTest );
  16. void ConsoleFileAllocationMonitorTest::testShowProgress() {
  17. ConsoleFileAllocationMonitor monitor;
  18. monitor.setMinValue(0);
  19. monitor.setMaxValue(1000000000);
  20. monitor.setCurrentValue(0);
  21. cout << endl;
  22. for(uint64_t i = monitor.getMinValue(); i <= monitor.getMaxValue(); i += 1234343) {
  23. monitor.setCurrentValue(i);
  24. monitor.showProgress();
  25. }
  26. monitor.setCurrentValue(monitor.getMaxValue());
  27. monitor.showProgress();
  28. }