kutils: test KSpeech::jobStateChanged() signal

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-10-16 14:02:06 +03:00
parent 15027904d8
commit e4b722622d

View file

@ -20,6 +20,8 @@
#include "kspeech.h"
#include "kdebug.h"
#include <QSignalSpy>
class KSpeechTest : public QObject
{
Q_OBJECT
@ -59,7 +61,10 @@ void KSpeechTest::say()
QFETCH(QString, saystr);
KSpeech kspeech(this);
QSignalSpy spyJobStateChanged(&kspeech, SIGNAL(jobStateChanged(int,int)));
QVERIFY(kspeech.say(saystr) != 0);
QTest::qWait(3000);
QVERIFY(spyJobStateChanged.count() == 2);
}
void KSpeechTest::setters_and_getters_data()