summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gentoobrowse-api/unittests/mockDefs.cpp7
-rw-r--r--gentoobrowse-api/unittests/mockDefs.h4
-rw-r--r--gentoobrowse-api/unittests/testUsers.cpp2
3 files changed, 12 insertions, 1 deletions
diff --git a/gentoobrowse-api/unittests/mockDefs.cpp b/gentoobrowse-api/unittests/mockDefs.cpp
index 7f78b9d..883f84d 100644
--- a/gentoobrowse-api/unittests/mockDefs.cpp
+++ b/gentoobrowse-api/unittests/mockDefs.cpp
@@ -68,6 +68,13 @@ TestClient::TestClient() :
BOOST_REQUIRE(u);
}
+TestClient::~TestClient()
+{
+ if (mms) {
+ mms->clear();
+ }
+}
+
std::array<IceTray::Mime::TextPart *, 2>
TestClient::humanReadableParts(const IceTray::Mail::EmailPtr & e) const
{
diff --git a/gentoobrowse-api/unittests/mockDefs.h b/gentoobrowse-api/unittests/mockDefs.h
index 404b2a2..8284f11 100644
--- a/gentoobrowse-api/unittests/mockDefs.h
+++ b/gentoobrowse-api/unittests/mockDefs.h
@@ -3,6 +3,7 @@
#include <array>
#include <boost/test/unit_test.hpp>
+#include <c++11Helpers.h>
#include <command_fwd.h>
#include <connection.h>
#include <connection_fwd.h>
@@ -49,6 +50,9 @@ public:
class DLL_PUBLIC TestClient : public IceTray::DryIceClient {
public:
TestClient();
+ ~TestClient();
+
+ SPECIAL_MEMBERS_DELETE(TestClient);
Gentoo::MaintenancePrxPtr m;
Gentoo::PortagePrxPtr p;
diff --git a/gentoobrowse-api/unittests/testUsers.cpp b/gentoobrowse-api/unittests/testUsers.cpp
index 0f5ee9c..4af063b 100644
--- a/gentoobrowse-api/unittests/testUsers.cpp
+++ b/gentoobrowse-api/unittests/testUsers.cpp
@@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE(createAgain)
* * resend verification
*/
auto user = u->create("testuser", "testpass", "Test User", "recreate@user.com");
- BOOST_REQUIRE_EQUAL(2, mms->getSentEmails().size());
+ BOOST_REQUIRE_EQUAL(1, mms->getSentEmails().size());
BOOST_REQUIRE_EQUAL("Gentoo Browse: Welcome", mms->getSentEmails()[0]->subject);
BOOST_REQUIRE_EQUAL("test@user.com", mms->getSentEmails()[0]->to.address);
BOOST_REQUIRE_EQUAL(4, user->userid);