Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
252
Issues
252
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
487ce84f
Commit
487ce84f
authored
Jun 21, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
c97b7fdf
Pipeline
#4491
passed with stage
in 16 minutes and 13 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
18 deletions
+26
-18
src/timeline2/model/clipmodel.cpp
src/timeline2/model/clipmodel.cpp
+2
-2
src/timeline2/model/compositionmodel.cpp
src/timeline2/model/compositionmodel.cpp
+10
-6
src/timeline2/model/timelinemodel.cpp
src/timeline2/model/timelinemodel.cpp
+1
-0
tests/modeltest.cpp
tests/modeltest.cpp
+7
-5
tests/regressions.cpp
tests/regressions.cpp
+2
-1
tests/test_utils.hpp
tests/test_utils.hpp
+4
-4
No files found.
src/timeline2/model/clipmodel.cpp
View file @
487ce84f
...
...
@@ -204,7 +204,7 @@ bool ClipModel::requestResize(int size, bool right, Fun &undo, Fun &redo, bool l
if
(
m_currentTrackId
>
-
1
)
{
if
(
auto
ptr
=
m_parent
.
lock
())
{
QModelIndex
ix
=
ptr
->
makeClipIndexFromID
(
m_id
);
ptr
->
dataChanged
(
ix
,
ix
,
roles
);
ptr
->
notifyChange
(
ix
,
ix
,
roles
);
}
}
return
true
;
...
...
@@ -224,7 +224,7 @@ bool ClipModel::requestResize(int size, bool right, Fun &undo, Fun &redo, bool l
if
(
m_currentTrackId
>
-
1
)
{
if
(
auto
ptr
=
m_parent
.
lock
())
{
QModelIndex
ix
=
ptr
->
makeClipIndexFromID
(
m_id
);
ptr
->
dataChanged
(
ix
,
ix
,
roles
);
ptr
->
notifyChange
(
ix
,
ix
,
roles
);
}
}
return
true
;
...
...
src/timeline2/model/compositionmodel.cpp
View file @
487ce84f
...
...
@@ -123,9 +123,11 @@ bool CompositionModel::requestResize(int size, bool right, Fun &undo, Fun &redo,
Fun
operation
=
[
this
,
track_operation
,
roles
]()
{
if
(
track_operation
())
{
// we send a list of roles to be updated
if
(
auto
ptr
=
m_parent
.
lock
())
{
QModelIndex
ix
=
ptr
->
makeCompositionIndexFromID
(
m_id
);
ptr
->
dataChanged
(
ix
,
ix
,
roles
);
if
(
m_currentTrackId
!=
-
1
)
{
if
(
auto
ptr
=
m_parent
.
lock
())
{
QModelIndex
ix
=
ptr
->
makeCompositionIndexFromID
(
m_id
);
ptr
->
notifyChange
(
ix
,
ix
,
roles
);
}
}
return
true
;
}
...
...
@@ -140,9 +142,11 @@ bool CompositionModel::requestResize(int size, bool right, Fun &undo, Fun &redo,
}
Fun
reverse
=
[
this
,
track_reverse
,
roles
]()
{
if
(
track_reverse
())
{
if
(
auto
ptr
=
m_parent
.
lock
())
{
QModelIndex
ix
=
ptr
->
makeCompositionIndexFromID
(
m_id
);
ptr
->
dataChanged
(
ix
,
ix
,
roles
);
if
(
m_currentTrackId
!=
-
1
)
{
if
(
auto
ptr
=
m_parent
.
lock
())
{
QModelIndex
ix
=
ptr
->
makeCompositionIndexFromID
(
m_id
);
ptr
->
notifyChange
(
ix
,
ix
,
roles
);
}
}
return
true
;
}
...
...
src/timeline2/model/timelinemodel.cpp
View file @
487ce84f
...
...
@@ -3365,3 +3365,4 @@ std::unordered_set<int> TimelineModel::getAllTracksIds() const
std
::
transform
(
m_iteratorTable
.
begin
(),
m_iteratorTable
.
end
(),
std
::
inserter
(
result
,
result
.
begin
()),
[
&
](
const
auto
&
track
)
{
return
track
.
first
;
});
return
result
;
}
tests/modeltest.cpp
View file @
487ce84f
...
...
@@ -84,10 +84,11 @@ TEST_CASE("Basic creation/deletion of a track", "[TrackModel]")
Verify
(
Method
(
timMock
,
_resetView
)).
Exactly
(
Once
);
RESET
(
timMock
);
REQUIRE
(
timeline
->
requestTrackDeletion
(
id2
));
// We are not allowed to delete the last track
REQUIRE_FALSE
(
timeline
->
requestTrackDeletion
(
id2
));
REQUIRE
(
timeline
->
checkConsistency
());
REQUIRE
(
timeline
->
getTracksCount
()
==
0
);
Verify
(
Method
(
timMock
,
_resetView
)).
Exactly
(
Once
);
REQUIRE
(
timeline
->
getTracksCount
()
==
1
);
Verify
(
Method
(
timMock
,
_resetView
)).
Exactly
(
0
);
RESET
(
timMock
);
SECTION
(
"Delete a track with groups"
)
...
...
@@ -106,7 +107,7 @@ TEST_CASE("Basic creation/deletion of a track", "[TrackModel]")
REQUIRE
(
timeline
->
requestClipInsertion
(
binId
,
tid2
,
2
*
length
,
cid4
));
REQUIRE
(
timeline
->
checkConsistency
());
REQUIRE
(
timeline
->
getClipsCount
()
==
4
);
REQUIRE
(
timeline
->
getTracksCount
()
==
2
);
REQUIRE
(
timeline
->
getTracksCount
()
==
3
);
auto
g1
=
std
::
unordered_set
<
int
>
({
cid1
,
cid3
});
auto
g2
=
std
::
unordered_set
<
int
>
({
cid2
,
cid4
});
...
...
@@ -118,7 +119,7 @@ TEST_CASE("Basic creation/deletion of a track", "[TrackModel]")
REQUIRE
(
timeline
->
requestTrackDeletion
(
tid1
));
REQUIRE
(
timeline
->
getClipsCount
()
==
3
);
REQUIRE
(
timeline
->
getTracksCount
()
==
1
);
REQUIRE
(
timeline
->
getTracksCount
()
==
2
);
REQUIRE
(
timeline
->
checkConsistency
());
}
binModel
->
clean
();
...
...
@@ -2070,6 +2071,7 @@ TEST_CASE("Operations under locked tracks", "[Locked]")
REQUIRE
(
timeline
->
requestItemResize
(
compo
,
17
,
true
)
==
17
);
check
(
17
);
}
binModel
->
clean
();
pCore
->
m_projectManager
=
nullptr
;
Logger
::
print_trace
();
...
...
tests/regressions.cpp
View file @
487ce84f
...
...
@@ -463,7 +463,8 @@ TEST_CASE("FuzzBug1")
REQUIRE
(
timeline_0
->
checkConsistency
());
{
bool
res
=
timeline_0
->
requestTrackDeletion
(
1
);
REQUIRE
(
res
==
true
);
// Cannot delete last track
REQUIRE
(
res
==
false
);
}
REQUIRE
(
timeline_0
->
checkConsistency
());
undoStack
->
undo
();
...
...
tests/test_utils.hpp
View file @
487ce84f
...
...
@@ -39,7 +39,7 @@
#include "transitions/transitionsrepository.hpp"
using
namespace
fakeit
;
#define RESET(mock)
\
#define RESET(mock) \
mock.Reset(); \
Fake(Method(mock, adjustAssetRange)); \
Spy(Method(mock, _resetView)); \
...
...
@@ -56,8 +56,8 @@ using namespace fakeit;
VerifyNoOtherInvocations(Method(timMock, _beginInsertRows)); \
VerifyNoOtherInvocations(Method(timMock, _endRemoveRows)); \
VerifyNoOtherInvocations(Method(timMock, _endInsertRows)); \
VerifyNoOtherInvocations(OverloadedMethod(timMock, notifyChange, void(const QModelIndex &, const QModelIndex &, bool, bool, bool)));
\
VerifyNoOtherInvocations(OverloadedMethod(timMock, notifyChange, void(const QModelIndex &, const QModelIndex &, const QVector<int> &))); \
VerifyNoOtherInvocations(OverloadedMethod(timMock, notifyChange, void(const QModelIndex &, const QModelIndex &, bool, bool, bool))); \
VerifyNoOtherInvocations(OverloadedMethod(timMock, notifyChange, void(const QModelIndex &, const QModelIndex &, const QVector<int> &)));
\
RESET(timMock);
#define CHECK_MOVE(times) \
...
...
@@ -74,7 +74,7 @@ using namespace fakeit;
NO_OTHERS();
#define CHECK_RESIZE(times) \
Verify(OverloadedMethod(timMock, notifyChange, void(const QModelIndex &, const QModelIndex &,
bool, bool, bool))).Exactly(times);
\
Verify(OverloadedMethod(timMock, notifyChange, void(const QModelIndex &, const QModelIndex &,
const QVector<int> &))).Exactly(times);
\
NO_OTHERS();
#define CHECK_UPDATE(role) \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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