Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
c8441884
Commit
c8441884
authored
Dec 02, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1050 from DonLakeFlyer/ToolbarClickThrough
Test all views on the toolbar
parents
61dd6f09
027e9675
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
MainWindowTest.cc
src/qgcunittest/MainWindowTest.cc
+17
-6
MainWindowTest.h
src/qgcunittest/MainWindowTest.h
+5
-1
No files found.
src/qgcunittest/MainWindowTest.cc
View file @
c8441884
...
...
@@ -27,7 +27,7 @@
/// @author Don Gagne <don@thegagnes.com>
#include "MainWindowTest.h"
#include "
MainWindow
.h"
#include "
QGCToolBar
.h"
UT_REGISTER_TEST
(
MainWindowTest
)
...
...
@@ -39,19 +39,30 @@ MainWindowTest::MainWindowTest(void)
void
MainWindowTest
::
init
(
void
)
{
UnitTest
::
init
();
_mainWindow
=
MainWindow
::
_create
(
NULL
,
MainWindow
::
CUSTOM_MODE_PX4
);
Q_CHECK_PTR
(
_mainWindow
);
}
void
MainWindowTest
::
cleanup
(
void
)
{
_mainWindow
->
close
();
delete
_mainWindow
;
UnitTest
::
cleanup
();
}
void
MainWindowTest
::
_
simpleDisplay
_test
(
void
)
void
MainWindowTest
::
_
clickThrough
_test
(
void
)
{
MainWindow
*
mainWindow
=
MainWindow
::
_create
(
NULL
,
MainWindow
::
CUSTOM_MODE_PX4
);
Q_
CHECK_PTR
(
mainWindow
);
QGCToolBar
*
toolbar
=
_mainWindow
->
findChild
<
QGCToolBar
*>
(
);
Q_
ASSERT
(
toolbar
);
mainWindow
->
close
();
QList
<
QToolButton
*>
buttons
=
toolbar
->
findChildren
<
QToolButton
*>
();
foreach
(
QToolButton
*
button
,
buttons
)
{
if
(
!
button
->
menu
())
{
QTest
::
mouseClick
(
button
,
Qt
::
LeftButton
);
QTest
::
qWait
(
1000
);
}
}
delete
mainWindow
;
}
src/qgcunittest/MainWindowTest.h
View file @
c8441884
...
...
@@ -30,6 +30,7 @@
#define MAINWINDOWTEST_H
#include "UnitTest.h"
#include "MainWindow.h"
class
MainWindowTest
:
public
UnitTest
{
...
...
@@ -42,7 +43,10 @@ private slots:
void
init
(
void
);
void
cleanup
(
void
);
void
_simpleDisplay_test
(
void
);
void
_clickThrough_test
(
void
);
private:
MainWindow
*
_mainWindow
;
};
#endif
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