|
|
@ -13,7 +13,8 @@ public: |
|
|
|
|
|
|
|
private slots: |
|
|
|
void test_case1(); |
|
|
|
void dualPress_test_case(); |
|
|
|
void pressDual_test_case(); |
|
|
|
void releaseDual_test_case(); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
@ -45,7 +46,7 @@ void ConsoleTest::test_case1() |
|
|
|
} |
|
|
|
|
|
|
|
//********************************************************************************
|
|
|
|
void ConsoleTest::dualPress_test_case() |
|
|
|
void ConsoleTest::pressDual_test_case() |
|
|
|
{ |
|
|
|
Console c; |
|
|
|
auto t = new TestDataSender; |
|
|
@ -53,7 +54,6 @@ void ConsoleTest::dualPress_test_case() |
|
|
|
c.pressDual(); |
|
|
|
QByteArray arr; |
|
|
|
|
|
|
|
|
|
|
|
arr.resize(8); |
|
|
|
arr[0] = 0x00; |
|
|
|
arr[1] = 0x01; |
|
|
@ -65,7 +65,28 @@ void ConsoleTest::dualPress_test_case() |
|
|
|
arr[7] = 0x00; |
|
|
|
QCOMPARE(t->consoleData, arr); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//********************************************************************************
|
|
|
|
void ConsoleTest::releaseDual_test_case() |
|
|
|
{ |
|
|
|
Console c; |
|
|
|
auto t = new TestDataSender; |
|
|
|
c.injectDataSender(t); |
|
|
|
c.releaseDual(); |
|
|
|
QByteArray arr; |
|
|
|
|
|
|
|
arr.resize(8); |
|
|
|
arr[0] = 0x00; |
|
|
|
arr[1] = 0x01; |
|
|
|
arr[2] = 0x04; |
|
|
|
arr[3] = 0x1D; |
|
|
|
arr[4] = 0x00; |
|
|
|
arr[5] = 0x00; |
|
|
|
arr[6] = 0x00; |
|
|
|
arr[7] = 0x00; |
|
|
|
|
|
|
|
QCOMPARE(t->consoleData, arr); |
|
|
|
} |
|
|
|
|
|
|
|
QTEST_APPLESS_MAIN(ConsoleTest) |
|
|
|