|
|
@ -15,6 +15,8 @@ private slots: |
|
|
|
void test_case1(); |
|
|
|
void pressDual_test_case(); |
|
|
|
void releaseDual_test_case(); |
|
|
|
void pressQuad_test_case(); |
|
|
|
void releaseQuad_test_case(); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
@ -89,6 +91,49 @@ void ConsoleTest::releaseDual_test_case() |
|
|
|
QCOMPARE(t->consoleData, arr); |
|
|
|
} |
|
|
|
|
|
|
|
//********************************************************************************
|
|
|
|
void ConsoleTest::pressQuad_test_case() |
|
|
|
{ |
|
|
|
Console c; |
|
|
|
auto t = new TestDataSender; |
|
|
|
c.injectDataSender(t); |
|
|
|
c.pressQuad(); |
|
|
|
QByteArray arr; |
|
|
|
|
|
|
|
arr.resize(8); |
|
|
|
arr[0] = 0x00; |
|
|
|
arr[1] = 0x01; |
|
|
|
arr[2] = 0x04; |
|
|
|
arr[3] = 0x1C; |
|
|
|
arr[4] = 0x01; |
|
|
|
arr[5] = 0x00; |
|
|
|
arr[6] = 0x00; |
|
|
|
arr[7] = 0x00; |
|
|
|
QCOMPARE(t->consoleData, arr); |
|
|
|
} |
|
|
|
|
|
|
|
//********************************************************************************
|
|
|
|
void ConsoleTest::releaseQuad_test_case() |
|
|
|
{ |
|
|
|
Console c; |
|
|
|
auto t = new TestDataSender; |
|
|
|
c.injectDataSender(t); |
|
|
|
c.releaseQuad(); |
|
|
|
QByteArray arr; |
|
|
|
|
|
|
|
arr.resize(8); |
|
|
|
arr[0] = 0x00; |
|
|
|
arr[1] = 0x01; |
|
|
|
arr[2] = 0x04; |
|
|
|
arr[3] = 0x1C; |
|
|
|
arr[4] = 0x00; |
|
|
|
arr[5] = 0x00; |
|
|
|
arr[6] = 0x00; |
|
|
|
arr[7] = 0x00; |
|
|
|
|
|
|
|
QCOMPARE(t->consoleData, arr); |
|
|
|
} |
|
|
|
|
|
|
|
QTEST_APPLESS_MAIN(ConsoleTest) |
|
|
|
|
|
|
|
#include "tst_console.moc" |
|
|
|