summaryrefslogtreecommitdiff
path: root/test/ConsoleFileAllocationMonitorTest.cc
blob: caaa87bc829ab8eaecdc8a8b9daf5ff34d44d0f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "ConsoleFileAllocationMonitor.h"
#include <string>
#include <cppunit/extensions/HelperMacros.h>

using namespace std;

class ConsoleFileAllocationMonitorTest:public CppUnit::TestFixture {

  CPPUNIT_TEST_SUITE(ConsoleFileAllocationMonitorTest);
  CPPUNIT_TEST(testShowProgress);
  CPPUNIT_TEST_SUITE_END();
private:

public:
  void setUp() {
  }

  void testShowProgress();
};


CPPUNIT_TEST_SUITE_REGISTRATION( ConsoleFileAllocationMonitorTest );

void ConsoleFileAllocationMonitorTest::testShowProgress() {
  ConsoleFileAllocationMonitor monitor;
  monitor.setMinValue(0);
  monitor.setMaxValue(1000000000);
  monitor.setCurrentValue(0);

  cout << endl;
  for(uint64_t i = monitor.getMinValue(); i <= monitor.getMaxValue(); i += 1234343) {
    monitor.setCurrentValue(i);
    monitor.showProgress();
  }
  monitor.setCurrentValue(monitor.getMaxValue());
  monitor.showProgress();
}