Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Remove old irrelevant tests #12242

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions test/AnalyzeView/MavlinkLogTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,11 @@ void MavlinkLogTest::_bootLogDetectionCancel_test(void)
{
// Create a fake mavlink log
_createTempLogFile(false);

// We should get a message box, followed by a getSaveFileName dialog.
setExpectedMessageBox(QMessageBox::Ok);
setExpectedFileDialog(getSaveFileName, QStringList());

// Kick the protocol to check for lost log files and wait for signals to move through
connect(this, &MavlinkLogTest::checkForLostLogFiles, MAVLinkProtocol::instance(), &MAVLinkProtocol::checkForLostLogFiles);
emit checkForLostLogFiles();
QTest::qWait(1000);

checkExpectedMessageBox();
checkExpectedFileDialog();
}

void MavlinkLogTest::_bootLogDetectionSave_test(void)
Expand All @@ -91,19 +84,13 @@ void MavlinkLogTest::_bootLogDetectionSave_test(void)
_createTempLogFile(false);

// We should get a message box, followed by a getSaveFileName dialog.
setExpectedMessageBox(QMessageBox::Ok);
QDir logSaveDir(QStandardPaths::writableLocation(QStandardPaths::TempLocation));
QString logSaveFile(logSaveDir.filePath(_saveLogFilename));
setExpectedFileDialog(getSaveFileName, QStringList(logSaveFile));

// Kick the protocol to check for lost log files and wait for signals to move through
connect(this, &MavlinkLogTest::checkForLostLogFiles, MAVLinkProtocol::instance(), &MAVLinkProtocol::checkForLostLogFiles);
emit checkForLostLogFiles();
QTest::qWait(1000);

checkExpectedMessageBox();
checkExpectedFileDialog();

// Make sure the file is there and delete it
QCOMPARE(logSaveDir.remove(_saveLogFilename), true);
}
Expand Down Expand Up @@ -133,15 +120,11 @@ void MavlinkLogTest::_connectLogWorker(bool arm)

// On Disconnect: We should get a getSaveFileName dialog.
logSaveDir.setPath(QStandardPaths::writableLocation(QStandardPaths::TempLocation));
QString logSaveFile(logSaveDir.filePath(_saveLogFilename));
setExpectedFileDialog(getSaveFileName, QStringList(logSaveFile));
}

_disconnectMockLink();

if (arm) {
checkExpectedFileDialog();

// Make sure the file is there and delete it
QCOMPARE(logSaveDir.remove(_saveLogFilename), true);
}
Expand Down
3 changes: 0 additions & 3 deletions test/AutoPilotPlugins/RadioConfigTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,6 @@ void RadioConfigTest::cleanup(void)
Q_ASSERT(_calWidget);
delete _calWidget;

// Disconnecting the link will prompt for log file save
setExpectedFileDialog(getSaveFileName, QStringList());

UnitTest::cleanup();
}

Expand Down
12 changes: 0 additions & 12 deletions test/FactSystem/ParameterManagerTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ void ParameterManagerTest::_requestListMissingParamSuccess(void)
// Test no response to param_request_list
void ParameterManagerTest::_requestListNoResponse(void)
{
// Will pop error about request failure
setExpectedMessageBox(QMessageBox::Ok);

Q_ASSERT(!_mockLink);
_mockLink = MockLink::startPX4MockLink(false, MockConfiguration::FailParamNoReponseToRequestList);

Expand All @@ -96,18 +93,12 @@ void ParameterManagerTest::_requestListNoResponse(void)
// We should not get any progress bar updates, nor a parameter ready signal
QCOMPARE(spyProgress.wait(500), false);
QCOMPARE(spyParamsReady.wait(40000), false);

// User should have been notified
checkExpectedMessageBox();
}

// MockLink will fail to send a param on initial request, it will also fail to send it on subsequent
// param_read requests.
void ParameterManagerTest::_requestListMissingParamFail(void)
{
// Will pop error about missing params
setExpectedMessageBox(QMessageBox::Ok);

Q_ASSERT(!_mockLink);
_mockLink = MockLink::startPX4MockLink(false, MockConfiguration::FailMissingParamOnAllRequests);

Expand Down Expand Up @@ -137,9 +128,6 @@ void ParameterManagerTest::_requestListMissingParamFail(void)
// We should get a parameters ready signal, but Vehicle should indicate missing params
QCOMPARE(spyParamsReady.wait(40000), true);
QCOMPARE(vehicle->parameterManager()->missingParameters(), true);

// User should have been notified
checkExpectedMessageBox();
}

void ParameterManagerTest::_FTPnoFailure()
Expand Down
20 changes: 6 additions & 14 deletions test/MissionManager/MissionManagerTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ void MissionManagerTest::_writeItems(MockLinkMissionItemHandler::FailureMode_t f
if (shouldFail) {
// This should be a failed run

setExpectedMessageBox(QMessageBox::Ok);

// Wait for write sequence to complete. We should get:
// inProgressChanged(false) signal
// error(errorCode, QString) signal
Expand All @@ -89,9 +87,7 @@ void MissionManagerTest::_writeItems(MockLinkMissionItemHandler::FailureMode_t f
QSignalSpy* spy = _multiSpyMissionManager->getSpyByIndex(errorSignalIndex);
QList<QVariant> signalArgs = spy->takeFirst();
QCOMPARE(signalArgs.count(), 2);
qDebug() << signalArgs[1].toString();

checkExpectedMessageBox();
qCDebug(UnitTestLog) << signalArgs[1].toString();
} else {
// This should be clean run

Expand Down Expand Up @@ -137,8 +133,6 @@ void MissionManagerTest::_roundTripItems(MockLinkMissionItemHandler::FailureMode
if (shouldFail) {
// This should be a failed run

setExpectedMessageBox(QMessageBox::Ok);

// Wait for read sequence to complete. We should get:
// inProgressChanged(false) signal to signal completion
// error(errorCode, QString) signal
Expand All @@ -153,9 +147,7 @@ void MissionManagerTest::_roundTripItems(MockLinkMissionItemHandler::FailureMode
QSignalSpy* spy = _multiSpyMissionManager->getSpyByIndex(errorSignalIndex);
QList<QVariant> signalArgs = spy->takeFirst();
QCOMPARE(signalArgs.count(), 2);
qDebug() << signalArgs[1].toString();

checkExpectedMessageBox();
qCDebug(UnitTestLog) << signalArgs[1].toString();
} else {
// This should be clean run

Expand Down Expand Up @@ -203,7 +195,7 @@ void MissionManagerTest::_roundTripItems(MockLinkMissionItemHandler::FailureMode

MissionItem* actual = _missionManager->missionItems()[actualItemIndex];

qDebug() << "Test case" << testCaseIndex;
qCDebug(UnitTestLog) << "Test case" << testCaseIndex;
QCOMPARE(actual->sequenceNumber(), expectedSequenceNumber);
QCOMPARE(actual->coordinate().latitude(), testCase->expectedItem.coordinate.latitude());
QCOMPARE(actual->coordinate().longitude(), testCase->expectedItem.coordinate.longitude());
Expand Down Expand Up @@ -256,7 +248,7 @@ void MissionManagerTest::_testWriteFailureHandlingWorker(void)

for (size_t i=0; i<sizeof(rgTestCases)/sizeof(rgTestCases[0]); i++) {
const WriteTestCase_t* pCase = &rgTestCases[i];
qDebug() << "TEST CASE _testWriteFailureHandlingWorker" << pCase->failureText;
qCDebug(UnitTestLog) << "TEST CASE _testWriteFailureHandlingWorker" << pCase->failureText;
_writeItems(pCase->failureMode, MAV_MISSION_ERROR, pCase->shouldFail);
_mockLink->resetMissionItemHandler();
}
Expand Down Expand Up @@ -301,7 +293,7 @@ void MissionManagerTest::_testReadFailureHandlingWorker(void)

for (size_t i=0; i<sizeof(rgTestCases)/sizeof(rgTestCases[0]); i++) {
const ReadTestCase_t* pCase = &rgTestCases[i];
qDebug() << "TEST CASE _testReadFailureHandlingWorker" << pCase->failureText;
qCDebug(UnitTestLog) << "TEST CASE _testReadFailureHandlingWorker" << pCase->failureText;
_roundTripItems(pCase->failureMode, MAV_MISSION_ERROR, pCase->shouldFail);
_mockLink->resetMissionItemHandler();
_multiSpyMissionManager->clearAllSignals();
Expand Down Expand Up @@ -357,7 +349,7 @@ void MissionManagerTest::_testErrorAckFailureStrings(void)

for (size_t i=0; i<sizeof(rgTestCases)/sizeof(rgTestCases[0]); i++) {
const ErrorStringTestCase_t* pCase = &rgTestCases[i];
qDebug() << "TEST CASE _testErrorAckFailureStrings" << pCase->ackResultStr;
qCDebug(UnitTestLog) << "TEST CASE _testErrorAckFailureStrings" << pCase->ackResultStr;
_writeItems(MockLinkMissionItemHandler::FailWriteRequest1ErrorAck, pCase->ackResult, true /* shouldFail */);
_mockLink->resetMissionItemHandler();
}
Expand Down
6 changes: 0 additions & 6 deletions test/MissionManager/QGCMapPolygonTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,11 @@ void QGCMapPolygonTest::_testKMLLoad(void)
{
QVERIFY(_mapPolygon->loadKMLOrSHPFile(QStringLiteral(":/unittest/PolygonGood.kml")));

setExpectedMessageBox(QMessageBox::Ok);
QVERIFY(!_mapPolygon->loadKMLOrSHPFile(QStringLiteral(":/unittest/PolygonBadXml.kml")));
checkExpectedMessageBox();

setExpectedMessageBox(QMessageBox::Ok);
QVERIFY(!_mapPolygon->loadKMLOrSHPFile(QStringLiteral(":/unittest/PolygonMissingNode.kml")));
checkExpectedMessageBox();

setExpectedMessageBox(QMessageBox::Ok);
QVERIFY(!_mapPolygon->loadKMLOrSHPFile(QStringLiteral(":/unittest/PolygonBadCoordinatesNode.kml")));
checkExpectedMessageBox();
}

void QGCMapPolygonTest::_testSelectVertex(void)
Expand Down
6 changes: 0 additions & 6 deletions test/UnitTestList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@
// qgcunittest
#include "ComponentInformationCacheTest.h"
#include "ComponentInformationTranslationTest.h"
// #include "FileDialogTest.h"
// #include "MainWindowTest.h"
// #include "MessageBoxTest.h"

// QmlControls

Expand Down Expand Up @@ -183,9 +180,6 @@ int runTests(bool stress, QStringView unitTestOptions)
// UT_REGISTER_TEST(VisualMissionItemTest)

// qgcunittest
// UT_REGISTER_TEST(FileDialogTest)
// UT_REGISTER_TEST(MainWindowTest)
// UT_REGISTER_TEST(MessageBoxTest)

// QmlControls

Expand Down
9 changes: 1 addition & 8 deletions test/qgcunittest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
find_package(Qt6 REQUIRED COMPONENTS Core Positioning Test Widgets)
find_package(Qt6 REQUIRED COMPONENTS Core Positioning Test)

qt_add_library(qgcunittest
STATIC
# FileDialogTest.cc
# FileDialogTest.h
# MainWindowTest.cc
# MainWindowTest.h
# MessageBoxTest.cc
# MessageBoxTest.h
MultiSignalSpy.cc
MultiSignalSpy.h
MultiSignalSpyV2.cc
Expand All @@ -27,7 +21,6 @@ target_link_libraries(qgcunittest
Qt6::Core
Qt6::Positioning
Qt6::Test
Qt6::Widgets
MAVLink
MockLink
)
Expand Down
98 changes: 0 additions & 98 deletions test/qgcunittest/FileDialogTest.cc

This file was deleted.

34 changes: 0 additions & 34 deletions test/qgcunittest/FileDialogTest.h

This file was deleted.

Loading
Loading