7 changed files with 72 additions and 9 deletions
@ -0,0 +1,32 @@ |
|||||||
|
/****************************************************************************
|
||||||
|
* |
||||||
|
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
|
||||||
|
* |
||||||
|
* QGroundControl is licensed according to the terms in the file |
||||||
|
* COPYING.md in the root of the source code directory. |
||||||
|
* |
||||||
|
****************************************************************************/ |
||||||
|
|
||||||
|
#include "QGCAudioWorkerTest.h" |
||||||
|
#include "QGCAudioWorker.h" |
||||||
|
|
||||||
|
QGCAudioWorkerTest::QGCAudioWorkerTest(void) |
||||||
|
{ |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
void QGCAudioWorkerTest::_testSpokenReplacements(void) |
||||||
|
{ |
||||||
|
QString result = QGCAudioWorker::fixTextMessageForAudio(QStringLiteral("-10.5m, -10.5m. -10.5 m")); |
||||||
|
QCOMPARE(result, QStringLiteral(" negative 10.5 meters, negative 10.5 meters. negative 10.5 meters")); |
||||||
|
result = QGCAudioWorker::fixTextMessageForAudio(QStringLiteral("-10m -10 m")); |
||||||
|
QCOMPARE(result, QStringLiteral(" negative 10 meters negative 10 meters")); |
||||||
|
result = QGCAudioWorker::fixTextMessageForAudio(QStringLiteral("foo -10m -10 m bar")); |
||||||
|
QCOMPARE(result, QStringLiteral("foo negative 10 meters negative 10 meters bar")); |
||||||
|
result = QGCAudioWorker::fixTextMessageForAudio(QStringLiteral("-foom")); |
||||||
|
QCOMPARE(result, QStringLiteral("-foom")); |
||||||
|
result = QGCAudioWorker::fixTextMessageForAudio(QStringLiteral("10 moo")); |
||||||
|
QCOMPARE(result, QStringLiteral("10 moo")); |
||||||
|
result = QGCAudioWorker::fixTextMessageForAudio(QStringLiteral("10moo")); |
||||||
|
QCOMPARE(result, QStringLiteral("10moo")); |
||||||
|
} |
@ -0,0 +1,23 @@ |
|||||||
|
/****************************************************************************
|
||||||
|
* |
||||||
|
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
|
||||||
|
* |
||||||
|
* QGroundControl is licensed according to the terms in the file |
||||||
|
* COPYING.md in the root of the source code directory. |
||||||
|
* |
||||||
|
****************************************************************************/ |
||||||
|
|
||||||
|
#pragma once |
||||||
|
|
||||||
|
#include "UnitTest.h" |
||||||
|
|
||||||
|
class QGCAudioWorkerTest : public UnitTest |
||||||
|
{ |
||||||
|
Q_OBJECT |
||||||
|
|
||||||
|
public: |
||||||
|
QGCAudioWorkerTest(void); |
||||||
|
|
||||||
|
private slots: |
||||||
|
void _testSpokenReplacements(void); |
||||||
|
}; |
Loading…
Reference in new issue