From 7f319a5fbd2d125d191428fae5d1907effa4f790 Mon Sep 17 00:00:00 2001 From: Bryant Date: Mon, 21 Jul 2014 23:36:46 -0700 Subject: [PATCH] Fix initialized-but-unused warnings in test code for Release builds. --- src/qgcunittest/MockMavlinkFileServer.cc | 1 + src/qgcunittest/TCPLoopBackServer.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/qgcunittest/MockMavlinkFileServer.cc b/src/qgcunittest/MockMavlinkFileServer.cc index 6577611..9a3ec9f 100644 --- a/src/qgcunittest/MockMavlinkFileServer.cc +++ b/src/qgcunittest/MockMavlinkFileServer.cc @@ -97,6 +97,7 @@ void MockMavlinkFileServer::_openCommand(QGCUASFileManager::Request* request) size_t cchPath = strnlen((char *)request->data, sizeof(request->data)); Q_ASSERT(cchPath != sizeof(request->data)); + Q_UNUSED(connected); // Fix initialized-but-not-referenced warning on release builds path = (char *)request->data; // Check path against one of our known test cases diff --git a/src/qgcunittest/TCPLoopBackServer.cc b/src/qgcunittest/TCPLoopBackServer.cc index 0198ade..d564eb8 100644 --- a/src/qgcunittest/TCPLoopBackServer.cc +++ b/src/qgcunittest/TCPLoopBackServer.cc @@ -45,6 +45,7 @@ void TCPLoopBackServer::run(void) bool connected = QObject::connect(_tcpServer, SIGNAL(newConnection()), this, SLOT(_newConnection())); Q_ASSERT(connected); + Q_UNUSED(connected); // Fix initialized-but-not-referenced warning on release builds Q_ASSERT(_tcpServer->listen(_hostAddress, _port)); @@ -59,6 +60,7 @@ void TCPLoopBackServer::_newConnection(void) Q_ASSERT(_tcpSocket); bool connected = QObject::connect(_tcpSocket, SIGNAL(readyRead()), this, SLOT(_readBytes())); Q_ASSERT(connected); + Q_UNUSED(connected); // Fix initialized-but-not-referenced warning on release builds } void TCPLoopBackServer::_readBytes(void)