Commit 002d1fbd authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Add remove space test

parent 66f7ddd5
Pipeline #261417 failed with stage
in 6 minutes and 40 seconds
......@@ -190,6 +190,37 @@ TEST_CASE("Remove all spaces", "[Spacer]")
REQUIRE(TimelineFunctions::requestDeleteBlankAt(timeline, tid1, 100, false) == false);
undoStack->undo();
}
SECTION("Ensure delete blank works correctly with ungrouped clips")
{
// We have clips at 10, 80, 101 on track 1 (length 20 frames each)
// One clip at 20 on track 2
REQUIRE(TimelineFunctions::requestDeleteBlankAt(timeline, tid1, 5, false));
REQUIRE(timeline->getTrackClipsCount(tid1) == 3);
REQUIRE(timeline->getTrackClipsCount(tid2) == 1);
REQUIRE(timeline->getClipPosition(cid1) == 0);
REQUIRE(timeline->getClipPosition(cid2) == 70);
REQUIRE(timeline->getClipPosition(cid3) == 91);
REQUIRE(timeline->getClipPosition(cid4) == 20);
undoStack->undo();
REQUIRE(TimelineFunctions::requestDeleteBlankAt(timeline, tid1, 5, true));
REQUIRE(timeline->getTrackClipsCount(tid1) == 3);
REQUIRE(timeline->getTrackClipsCount(tid2) == 1);
REQUIRE(timeline->getClipPosition(cid1) == 0);
REQUIRE(timeline->getClipPosition(cid2) == 70);
REQUIRE(timeline->getClipPosition(cid3) == 91);
REQUIRE(timeline->getClipPosition(cid4) == 10);
undoStack->undo();
REQUIRE(TimelineFunctions::requestDeleteBlankAt(timeline, tid1, 60, false));
REQUIRE(timeline->getTrackClipsCount(tid1) == 3);
REQUIRE(timeline->getTrackClipsCount(tid2) == 1);
REQUIRE(timeline->getClipPosition(cid1) == 10);
REQUIRE(timeline->getClipPosition(cid2) == 30);
REQUIRE(timeline->getClipPosition(cid3) == 51);
REQUIRE(timeline->getClipPosition(cid4) == 20);
undoStack->undo();
state1();
undoStack->undo();
}
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