Commit 685c75ce authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Add test for insert space (WIP)

parent 07b8f53b
......@@ -219,8 +219,43 @@ TEST_CASE("Remove all spaces", "[Spacer]")
REQUIRE(timeline->getClipPosition(cid4) == 20);
undoStack->undo();
state1();
}
SECTION("Insert space test with ungrouped clips")
{
// We have clips at 10, 80, 101 on track 1 (length 20 frames each)
// One clip at 20 on track 2
// operation on one track (tid1)
std::pair<int, int> spacerOp = TimelineFunctions::requestSpacerStartOperation(timeline, tid1, 40);
int cid = spacerOp.first;
REQUIRE(cid > -1);
Fun undo = []() { return true; };
Fun redo = []() { return true; };
int start = timeline->getItemPosition(cid);
REQUIRE(TimelineFunctions::requestSpacerEndOperation(timeline, cid, start, start + 100, tid1, false, undo, redo));
REQUIRE(timeline->getTrackClipsCount(tid1) == 3);
REQUIRE(timeline->getTrackClipsCount(tid2) == 1);
REQUIRE(timeline->getClipPosition(cid1) == 10);
REQUIRE(timeline->getClipPosition(cid2) == 180);
REQUIRE(timeline->getClipPosition(cid3) == 201);
REQUIRE(timeline->getClipPosition(cid4) == 20);
undoStack->undo();
state1();
// operation on all tracks
/*spacerOp = TimelineFunctions::requestSpacerStartOperation(timeline, -1, 35);
cid = spacerOp.first;
REQUIRE(cid > -1);
start = timeline->getItemPosition(cid);
REQUIRE(TimelineFunctions::requestSpacerEndOperation(timeline, cid, start, start + 100, -1, false, undo, redo));
REQUIRE(timeline->getTrackClipsCount(tid1) == 3);
REQUIRE(timeline->getTrackClipsCount(tid2) == 1);
REQUIRE(timeline->getClipPosition(cid1) == 10);
REQUIRE(timeline->getClipPosition(cid2) == 180);
REQUIRE(timeline->getClipPosition(cid3) == 201);
REQUIRE(timeline->getClipPosition(cid4) == 120);
undoStack->undo();
state1();*/
}
binModel->clean();
pCore->m_projectManager = nullptr;
}
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