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
519ee5ab
Commit
519ee5ab
authored
Jul 25, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update unit test for new log save behavior
parent
6813d2c1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
20 deletions
+45
-20
SetupViewTest.cc
src/VehicleSetup/SetupViewTest.cc
+1
-4
MockLink.h
src/comm/MockLink.h
+3
-3
MainWindowTest.cc
src/qgcunittest/MainWindowTest.cc
+0
-3
MavlinkLogTest.cc
src/qgcunittest/MavlinkLogTest.cc
+38
-9
MavlinkLogTest.h
src/qgcunittest/MavlinkLogTest.h
+3
-1
No files found.
src/VehicleSetup/SetupViewTest.cc
View file @
519ee5ab
...
...
@@ -110,14 +110,11 @@ void SetupViewTest::_clickThrough_test(void)
QTest
::
qWait
(
1000
);
}
// On MainWindow close we should get a message box telling the user to disconnect first. Disconnect will then pop
// the log file save dialog.
// On MainWindow close we should get a message box telling the user to disconnect first.
setExpectedMessageBox
(
QGCMessageBox
::
Yes
);
setExpectedFileDialog
(
getSaveFileName
,
QStringList
());
_mainWindow
->
close
();
QTest
::
qWait
(
1000
);
// Need to allow signals to move between threads
checkExpectedMessageBox
();
checkExpectedFileDialog
();
}
src/comm/MockLink.h
View file @
519ee5ab
...
...
@@ -145,7 +145,7 @@ private:
MissionList_t
_missionItems
;
uint8_t
_mavBaseMode
;
uint
8_t
_mavCustomMode
;
uint
32_t
_mavCustomMode
;
uint8_t
_mavState
;
MockConfiguration
*
_config
;
...
...
src/qgcunittest/MainWindowTest.cc
View file @
519ee5ab
...
...
@@ -100,11 +100,8 @@ void MainWindowTest::_connectWindowClose_test(MAV_AUTOPILOT autopilot)
QTest
::
qWait
(
1000
);
// Need to allow signals to move between threads
checkExpectedMessageBox
();
// We are going to disconnect the link which is going to pop a save file dialog
setExpectedFileDialog
(
getSaveFileName
,
QStringList
());
linkMgr
->
disconnectLink
(
link
);
QTest
::
qWait
(
1000
);
// Need to allow signals to move between threads
checkExpectedFileDialog
();
}
void
MainWindowTest
::
_connectWindowClosePX4_test
(
void
)
{
...
...
src/qgcunittest/MavlinkLogTest.cc
View file @
519ee5ab
...
...
@@ -31,6 +31,7 @@
#include "MockLink.h"
#include "QGCTemporaryFile.h"
#include "QGCApplication.h"
#include "UAS.h"
UT_REGISTER_TEST
(
MavlinkLogTest
)
...
...
@@ -133,7 +134,7 @@ void MavlinkLogTest::_bootLogDetectionZeroLength_test(void)
// Zero length log files should not generate any additional UI pop-ups. It should just be deleted silently.
}
void
MavlinkLogTest
::
_connectLog
_test
(
void
)
void
MavlinkLogTest
::
_connectLog
Worker
(
bool
arm
)
{
LinkManager
*
linkMgr
=
LinkManager
::
instance
();
Q_CHECK_PTR
(
linkMgr
);
...
...
@@ -142,20 +143,48 @@ void MavlinkLogTest::_connectLog_test(void)
Q_CHECK_PTR
(
link
);
LinkManager
::
instance
()
->
_addLink
(
link
);
linkMgr
->
connectLink
(
link
);
QTest
::
qWait
(
5000
);
// Give enough time for UI to settle and heartbeats to go through
// Wait for the uas to work it's way through the various threads
QSignalSpy
spyUas
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)));
QCOMPARE
(
spyUas
.
wait
(
5000
),
true
);
UASInterface
*
uasInterface
=
UASManager
::
instance
()
->
getActiveUAS
();
QVERIFY
(
uasInterface
);
UAS
*
uas
=
dynamic_cast
<
UAS
*>
(
uasInterface
);
QVERIFY
(
uas
);
QDir
logSaveDir
;
if
(
arm
)
{
uas
->
armSystem
();
QTest
::
qWait
(
1500
);
// Wait long enough for heartbeat to come through
// On Disconnect: We should get a getSaveFileName dialog.
QDir
logSaveDir
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DocumentsLocation
));
logSaveDir
.
setPath
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DocumentsLocation
));
QString
logSaveFile
(
logSaveDir
.
filePath
(
_saveLogFilename
));
setExpectedFileDialog
(
getSaveFileName
,
QStringList
(
logSaveFile
));
}
linkMgr
->
disconnectLink
(
link
);
QTest
::
qWait
(
1000
);
// Need to allow signals to move between threads
if
(
arm
)
{
checkExpectedFileDialog
();
// Make sure the file is there and delete it
QCOMPARE
(
logSaveDir
.
remove
(
_saveLogFilename
),
true
);
}
}
void
MavlinkLogTest
::
_connectLogNoArm_test
(
void
)
{
_connectLogWorker
(
false
);
}
void
MavlinkLogTest
::
_connectLogArm_test
(
void
)
{
_connectLogWorker
(
true
);
}
void
MavlinkLogTest
::
_deleteTempLogFiles_test
(
void
)
...
...
src/qgcunittest/MavlinkLogTest.h
View file @
519ee5ab
...
...
@@ -45,7 +45,8 @@ private slots:
void
_bootLogDetectionCancel_test
(
void
);
void
_bootLogDetectionSave_test
(
void
);
void
_bootLogDetectionZeroLength_test
(
void
);
void
_connectLog_test
(
void
);
void
_connectLogNoArm_test
(
void
);
void
_connectLogArm_test
(
void
);
void
_deleteTempLogFiles_test
(
void
);
signals:
...
...
@@ -53,6 +54,7 @@ signals:
private:
void
_createTempLogFile
(
bool
zeroLength
);
void
_connectLogWorker
(
bool
arm
);
static
const
char
*
_tempLogFileTemplate
;
///< Template for temporary log file
static
const
char
*
_logFileExtension
;
///< Extension for log files
...
...
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