AudioOutputTest.cc 1.42 KB
Newer Older
1 2 3 4 5 6 7 8 9
/****************************************************************************
 *
 *   (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.
 *
 ****************************************************************************/

10 11
#include "AudioOutputTest.h"
#include "AudioOutput.h"
12

13
AudioOutputTest::AudioOutputTest(void)
14 15 16 17
{

}

18
void AudioOutputTest::_testSpokenReplacements(void)
19
{
20
    QString result = AudioOutput::fixTextMessageForAudio(QStringLiteral("-10.5m, -10.5m. -10.5 m"));
21
    QCOMPARE(result, QStringLiteral(" negative 10 point 5 meters,  negative 10 point 5 meters.  negative 10 point 5  meters"));
22
    result = AudioOutput::fixTextMessageForAudio(QStringLiteral("-10m -10 m"));
23
    QCOMPARE(result, QStringLiteral(" negative 10 meters  negative 10  meters"));
24
    result = AudioOutput::fixTextMessageForAudio(QStringLiteral("foo -10m -10 m bar"));
25
    QCOMPARE(result, QStringLiteral("foo  negative 10 meters  negative 10  meters bar"));
26
    result = AudioOutput::fixTextMessageForAudio(QStringLiteral("-foom"));
27
    QCOMPARE(result, QStringLiteral("-foom"));
28
    result = AudioOutput::fixTextMessageForAudio(QStringLiteral("10 moo"));
29
    QCOMPARE(result, QStringLiteral("10 moo"));
30
    result = AudioOutput::fixTextMessageForAudio(QStringLiteral("10moo"));
31 32
    QCOMPARE(result, QStringLiteral("10moo"));
}