99
qDebug() << Q_FUNC_INFO << "Create jobBefore";
99
101
auto jobBefore = QSharedPointer<PrinterJob>(new PrinterJob("test-printer", m_backend, 1));
103
qDebug() << Q_FUNC_INFO << "Add jobBefore to m_jobs";
101
105
m_backend->m_jobs << jobBefore;
107
qDebug() << Q_FUNC_INFO << "Emit mockJobCreated";
102
109
m_backend->mockJobCreated("", "", "", 1, "", true, 100, 1, "", "", 1);
111
qDebug() << Q_FUNC_INFO << "Model Count" << m_model->count();
113
qDebug() << Q_FUNC_INFO << "Create jobAfter";
104
115
auto jobAfter = QSharedPointer<PrinterJob>(new PrinterJob("test-printer", m_backend, 1));
117
qDebug() << Q_FUNC_INFO << "Set copies value";
105
119
jobAfter->setCopies(100);
121
qDebug() << Q_FUNC_INFO << "Replace jobBefore in m_jobs with jobAfter";
106
123
m_backend->m_jobs.replace(0, jobAfter);
125
qDebug() << Q_FUNC_INFO << "Setup spy";
108
127
// Triggers a change.
109
128
QSignalSpy changedSpy(m_model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QVector<int>&)));
130
qDebug() << Q_FUNC_INFO << "Emit mockJobCreated";
110
132
m_backend->mockJobCreated("", "", "", 1, "", true, 100, 1, "", "", 1);
134
qDebug() << Q_FUNC_INFO << "Compare spy count";
111
136
QCOMPARE(changedSpy.count(), 1);
138
qDebug() << Q_FUNC_INFO << "End";