Commit bfc33ff4 authored by David Fairbrother's avatar David Fairbrother Committed by Peterson, Peter
Browse files

Add virtual d'tor to MockAlgorithmProgress*

These classes cannot be marked final as a Nice/Strict mock inherits from the original mock class, rather than holding it as a member.
This means that we need to mark the mocks with a virtual d'tor as we (unintentionally) have them as part of an inheritance chain
parent 01efe729
......@@ -24,18 +24,6 @@ class QWidget;
class MockAlgorithmProgressDialogWidget : public IAlgorithmProgressDialogWidget {
public:
MockAlgorithmProgressDialogWidget() {
mainProgressBar = std::make_shared<MockAlgorithmProgressWidget>();
auto pres = mainProgressBar->m_presenter.get();
m_presenter =
std::make_shared<AlgorithmProgressDialogPresenter>(static_cast<QWidget *>(nullptr), this, pres->model());
}
virtual ~MockAlgorithmProgressDialogWidget() {}
MOCK_METHOD1(addAlgorithm, std::pair<QTreeWidgetItem *, QProgressBar *>(Mantid::API::IAlgorithm_sptr));
std::shared_ptr<AlgorithmProgressDialogPresenter> m_presenter;
// This is the mocked main progress bar,
// always shown on the Workbench GUI
std::shared_ptr<MockAlgorithmProgressWidget> mainProgressBar;
};
\ No newline at end of file
virtual ~MockAlgorithmProgressDialogWidget() = default;
MOCK_METHOD((std::pair<QTreeWidgetItem *, QProgressBar *>), addAlgorithm, (Mantid::API::IAlgorithm_sptr), (override));
};
......@@ -23,15 +23,9 @@ class QWidget;
class MockAlgorithmProgressWidget : public IAlgorithmProgressWidget {
public:
MockAlgorithmProgressWidget() {
m_presenter = std::make_shared<AlgorithmProgressPresenter>(static_cast<QWidget *>(nullptr), this);
}
virtual ~MockAlgorithmProgressWidget() {}
MOCK_METHOD0(algorithmStarted, void());
MOCK_METHOD0(algorithmEnded, void());
MOCK_METHOD4(updateProgress, void(const double, const QString &, const double, const int));
MOCK_METHOD0(showDetailsDialog, void());
std::shared_ptr<AlgorithmProgressPresenter> m_presenter;
};
\ No newline at end of file
virtual ~MockAlgorithmProgressWidget() = default;
MOCK_METHOD(void, algorithmStarted, (), (override));
MOCK_METHOD(void, algorithmEnded, (), (override));
MOCK_METHOD(void, updateProgress, (const double, const QString &, const double, const int), (override));
MOCK_METHOD(void, showDetailsDialog, (), (override));
};
Supports Markdown
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