Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
a5351b85
Commit
a5351b85
authored
Sep 17, 2022
by
Julius Künzel
💬
Browse files
Add test for bin clip deletion with instance on locked track
CCBUG: 459260
parent
8b8687d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/modeltest.cpp
View file @
a5351b85
...
...
@@ -2153,6 +2153,40 @@ TEST_CASE("Operations under locked tracks", "[Locked]")
REQUIRE
(
timeline
->
requestItemResize
(
compo
,
17
,
true
)
==
17
);
check
(
17
);
}
SECTION
(
"Can't remove clip contained in locked track"
)
{
std
::
function
<
bool
(
void
)
>
undo
=
[]()
{
return
true
;
};
std
::
function
<
bool
(
void
)
>
redo
=
[]()
{
return
true
;
};
// insert a clip to the track
int
cid1
=
-
1
;
REQUIRE
(
timeline
->
requestClipInsertion
(
binId
,
tid1
,
2
,
cid1
));
REQUIRE
(
timeline
->
getClipsCount
()
==
1
);
REQUIRE
(
timeline
->
checkConsistency
());
REQUIRE
(
timeline
->
getClipTrackId
(
cid1
)
==
tid1
);
REQUIRE
(
timeline
->
getClipPosition
(
cid1
)
==
2
);
// lock the track
timeline
->
setTrackLockedState
(
tid1
,
true
);
REQUIRE
(
timeline
->
getTrackById
(
tid1
)
->
isLocked
());
REQUIRE
(
timeline
->
checkConsistency
());
REQUIRE
(
timeline
->
getClipTrackId
(
cid1
)
==
tid1
);
// try to delete bin clip, this should not work
REQUIRE_FALSE
(
binModel
->
requestBinClipDeletion
(
binModel
->
getClipByBinID
(
binId
),
undo
,
redo
));
REQUIRE
(
timeline
->
checkConsistency
());
REQUIRE
(
timeline
->
getClipsCount
()
==
1
);
REQUIRE
(
timeline
->
getClipTrackId
(
cid1
)
==
tid1
);
REQUIRE
(
timeline
->
getClipPosition
(
cid1
)
==
2
);
// unlock track, bin clip deletion should work now
timeline
->
setTrackLockedState
(
tid1
,
false
);
REQUIRE_FALSE
(
timeline
->
getTrackById
(
tid1
)
->
isLocked
());
REQUIRE
(
binModel
->
requestBinClipDeletion
(
binModel
->
getClipByBinID
(
binId
),
undo
,
redo
));
REQUIRE
(
timeline
->
checkConsistency
());
REQUIRE
(
timeline
->
getClipsCount
()
==
0
);
REQUIRE
(
timeline
->
checkConsistency
());
}
binModel
->
clean
();
pCore
->
m_projectManager
=
nullptr
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment