Commit f5f413b0 authored by Tusooa Zhu's avatar Tusooa Zhu

Fix libs-stroke-kis_simple_stroke_strategy_test

parent f87e8696
......@@ -56,40 +56,42 @@ KisStrokeId MockStrokesFacade::startStroke(KisStrokeStrategy *strokeStrategy)
{
KisStrokeSP stroke(new KisStroke(strokeStrategy));
m_strokes.append(stroke);
// initializing will lead to a job added
doOneJob(stroke);
return stroke.toWeakRef();
}
void MockStrokesFacade::addJob(KisStrokeId id, KisStrokeJobData *data)
{
KisStrokeSP stroke = id.toStrongRef();
KIS_ASSERT_RECOVER_NOOP(m_strokes.indexOf(stroke));
KIS_ASSERT_RECOVER_NOOP(m_strokes.indexOf(stroke) != -1);
stroke->addJob(data);
doOneJob(id);
doOneJob(stroke);
}
void MockStrokesFacade::endStroke(KisStrokeId id)
{
KisStrokeSP stroke = id.toStrongRef();
int index = m_strokes.indexOf(stroke);
KIS_ASSERT_RECOVER_NOOP(index);
KIS_ASSERT_RECOVER_NOOP(index != -1);
m_strokes.takeAt(index);
stroke->endStroke();
doOneJob(id);
doOneJob(stroke);
}
bool MockStrokesFacade::cancelStroke(KisStrokeId id)
{
KisStrokeSP stroke = id.toStrongRef();
int index = m_strokes.indexOf(stroke);
KIS_ASSERT_RECOVER_NOOP(index);
KIS_ASSERT_RECOVER_NOOP(index != -1);
m_strokes.takeAt(index);
stroke->cancelStroke();
doOneJob(id);
doOneJob(stroke);
return true;
}
......
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