Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM IncidenceEditor
Commits
1e43248a
Commit
1e43248a
authored
Aug 13, 2020
by
Volker Krause
Browse files
Replace ancient ModelTest copy by QAbstractItemModelTester
parent
000cceed
Pipeline
#31064
passed with stage
in 25 minutes and 46 seconds
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
autotests/CMakeLists.txt
View file @
1e43248a
...
...
@@ -6,7 +6,7 @@ set(grant_lib KGantt)
macro
(
IE_UNIT_TESTS
)
foreach
(
_testname
${
ARGN
}
)
add_executable
(
${
_testname
}
${
_testname
}
.cpp
modeltest.cpp
)
add_executable
(
${
_testname
}
${
_testname
}
.cpp
)
add_test
(
NAME
${
_testname
}
COMMAND
${
_testname
}
)
ecm_mark_as_test
(
${
_testname
}
)
target_link_libraries
(
${
_testname
}
...
...
@@ -23,7 +23,7 @@ endmacro()
macro
(
IE_EXECUTABLE_TESTS
)
foreach
(
_testname
${
ARGN
}
)
add_executable
(
${
_testname
}
NOGUI TEST
${
_testname
}
.cpp
modeltest.cpp
)
add_executable
(
${
_testname
}
NOGUI TEST
${
_testname
}
.cpp
)
target_link_libraries
(
${
_testname
}
KF5::CalendarCore Qt5::Test KF5::IncidenceEditor Qt5::Widgets
)
endforeach
()
endmacro
()
...
...
autotests/modeltest.cpp
deleted
100644 → 0
View file @
000cceed
This diff is collapsed.
Click to expand it.
autotests/modeltest.h
deleted
100644 → 0
View file @
000cceed
/****************************************************************************
**
** SPDX-FileCopyrightText: 2007 Trolltech ASA. All rights reserved.
**
** This file is part of the Qt Concurrent project on Trolltech Labs.
**
** SPDX-License-Identifier: GPL-2.0-only
**
****************************************************************************/
//krazy:excludeall=style
#ifndef MODELTEST_H
#define MODELTEST_H
#include <QObject>
#include <QAbstractItemModel>
#include <QStack>
class
ModelTest
:
public
QObject
{
Q_OBJECT
public:
explicit
ModelTest
(
QAbstractItemModel
*
model
,
QObject
*
parent
=
nullptr
);
private
Q_SLOTS
:
void
nonDestructiveBasicTest
();
void
rowCount
();
void
columnCount
();
void
hasIndex
();
void
index
();
void
parent
();
void
data
();
protected
Q_SLOTS
:
void
runAllTests
();
void
layoutAboutToBeChanged
();
void
layoutChanged
();
void
modelAboutToBeReset
();
void
modelReset
();
void
rowsAboutToBeInserted
(
const
QModelIndex
&
parent
,
int
start
,
int
end
);
void
rowsInserted
(
const
QModelIndex
&
parent
,
int
start
,
int
end
);
void
rowsAboutToBeRemoved
(
const
QModelIndex
&
parent
,
int
start
,
int
end
);
void
rowsRemoved
(
const
QModelIndex
&
parent
,
int
start
,
int
end
);
void
rowsAboutToBeMoved
(
const
QModelIndex
&
,
int
,
int
,
const
QModelIndex
&
,
int
);
void
rowsMoved
(
const
QModelIndex
&
,
int
,
int
,
const
QModelIndex
&
,
int
);
private:
void
checkChildren
(
const
QModelIndex
&
parent
,
int
currentDepth
=
0
);
QAbstractItemModel
*
model
=
nullptr
;
struct
Changing
{
QModelIndex
parent
;
int
oldSize
;
QVariant
last
;
QVariant
next
;
};
QStack
<
Changing
>
insert
;
QStack
<
Changing
>
remove
;
bool
fetchingMore
=
false
;
QList
<
QPersistentModelIndex
>
changing
;
};
#endif
autotests/testfreebusyganttproxymodel.cpp
View file @
1e43248a
...
...
@@ -7,7 +7,6 @@
#include "testfreebusyganttproxymodel.h"
#include "freebusyganttproxymodel.h"
#include "modeltest.h"
#include <CalendarSupport/FreeBusyItem>
#include <CalendarSupport/FreeBusyItemModel>
...
...
@@ -15,6 +14,7 @@
#include <KGantt/KGanttGraphicsView>
#include <KCalendarCore/Attendee>
#include <QAbstractItemModelTester>
#include <QTest>
#include <QStandardPaths>
QTEST_MAIN
(
FreeBusyGanttProxyModelTest
)
...
...
@@ -32,7 +32,7 @@ void FreeBusyGanttProxyModelTest::testModelValidity()
CalendarSupport
::
FreeBusyItemModel
*
fbModel
=
new
CalendarSupport
::
FreeBusyItemModel
();
FreeBusyGanttProxyModel
*
ganttModel
=
new
FreeBusyGanttProxyModel
();
ganttModel
->
setSourceModel
(
fbModel
);
ModelTest
*
modelTest
=
new
ModelTest
(
ganttModel
);
auto
*
modelTest
=
new
QAbstractItem
ModelTest
er
(
ganttModel
);
Q_UNUSED
(
modelTest
);
...
...
Write
Preview
Supports
Markdown
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