aboutsummaryrefslogtreecommitdiff
path: root/testLibbible.cc
diff options
context:
space:
mode:
authorYour Name <you@example.com>2020-11-18 11:38:59 -0500
committerYour Name <you@example.com>2020-11-18 11:38:59 -0500
commitdcfac3432f981191da68f14f21f5010fc4da51c0 (patch)
tree7e2a405d15f0ce4ce1c83e070d68fcb5088ed3c2 /testLibbible.cc
parent49c05187f739779a6433f75a348529c26e123e94 (diff)
downloadlibbible-dcfac3432f981191da68f14f21f5010fc4da51c0.tar.gz
libbible-dcfac3432f981191da68f14f21f5010fc4da51c0.tar.bz2
libbible-dcfac3432f981191da68f14f21f5010fc4da51c0.zip
Fixed issue with status reporting
Diffstat (limited to 'testLibbible.cc')
-rw-r--r--testLibbible.cc18
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);
}
//-----------------------------------------------------------------------------