diff options
Diffstat (limited to 'testLibbible.cc')
-rw-r--r-- | testLibbible.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testLibbible.cc b/testLibbible.cc index 3850aa0..8a7f468 100644 --- a/testLibbible.cc +++ b/testLibbible.cc @@ -47,6 +47,19 @@ class TestLibbible : public CppUnit::TestFixture //----------------------------------------------------------------------------- +class StatusTester : public libbible::Status +{ + public: + virtual void update(unsigned long totalBytes, unsigned long completedBytes, string message); + bool hasBeenUpdated = false; +}; + +void StatusTester::update(unsigned long totalBytes, unsigned long completedBytes, string message) { + hasBeenUpdated = true; +} + +//----------------------------------------------------------------------------- + void TestLibbible::testGetModules(void) { map<string, vector<string>> mods = libbible::getModules(); for(auto pair : mods) { @@ -175,7 +188,11 @@ void TestLibbible::testSettings(void) { } void TestLibbible::testDownload(void) { + StatusTester status; + libbible::setStatusReporter(status); map<string, vector<string>> modsAvailable = libbible::downloadModsAvailable(); + //CPPUNIT_ASSERT(status.hasBeenUpdated); + status.hasBeenUpdated = false; // We try installing the first available one string language; string name; @@ -192,6 +209,7 @@ void TestLibbible::testDownload(void) { libbible::installModFromInternet(language, name); mods = libbible::getModules(); CPPUNIT_ASSERT(mods.find(name) != mods.end()); + CPPUNIT_ASSERT(status.hasBeenUpdated); } //----------------------------------------------------------------------------- |