Commit eccd9e1f authored by Andreas Cord-Landwehr's avatar Andreas Cord-Landwehr
Browse files

Fix double delete in unit test

parent 504e65f9
......@@ -104,15 +104,15 @@ void TestCourseResource::unitAddAndRemoveHandling()
CourseResource course(QUrl::fromLocalFile(courseFile), &repository);
// begin of test
Unit unit;
unit.setId("testunit");
Unit *unit = new Unit;
unit->setId("testunit");
const int initialUnitNumber = course.unitList().count();
QCOMPARE(initialUnitNumber, 1);
QSignalSpy spyAboutToBeAdded(&course, SIGNAL(unitAboutToBeAdded(Unit*, int)));
QSignalSpy spyAdded(&course, SIGNAL(unitAdded()));
QCOMPARE(spyAboutToBeAdded.count(), 0);
QCOMPARE(spyAdded.count(), 0);
course.addUnit(&unit);
course.addUnit(unit);
QCOMPARE(course.unitList().count(), initialUnitNumber + 1);
QCOMPARE(spyAboutToBeAdded.count(), 1);
QCOMPARE(spyAdded.count(), 1);
......
......@@ -38,7 +38,7 @@
#include <QUrl>
#include <QStandardPaths>
ContributorRepository::ContributorRepository(QObject *parent)
ContributorRepository::ContributorRepository()
: IEditableRepository()
{
loadLanguageResources();
......
......@@ -51,7 +51,7 @@ class ARTIKULATECORE_EXPORT ContributorRepository : public IEditableRepository
Q_PROPERTY(QString repositoryUrl READ storageLocation NOTIFY repositoryChanged)
public:
explicit ContributorRepository(QObject *parent = nullptr);
explicit ContributorRepository();
~ContributorRepository() override;
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment