148 void windowGroupActionCancel( WindowGroupActionType, QList<long int> ); |
148 void windowGroupActionCancel( WindowGroupActionType, QList<long int> ); |
149 |
149 |
150 }; |
150 }; |
151 |
151 |
152 // ======== MEMBER FUNCTIONS ======== |
152 // ======== MEMBER FUNCTIONS ======== |
153 void TestXqKeyCapture::initTestCase() |
153 void TestXQKeyCapture::initTestCase() |
154 { |
154 { |
155 bool ret = connect( MyTestWindowGroup::Instance(), SIGNAL( windowGroupAction( WindowGroupActionType, QList<unsigned int> )), |
155 bool ret = connect( MyTestWindowGroup::Instance(), SIGNAL( windowGroupAction( WindowGroupActionType, QList<unsigned int> )), |
156 this, SLOT( windowGroupAction( WindowGroupActionType, QList<unsigned int> ) ) ); |
156 this, SLOT( windowGroupAction( WindowGroupActionType, QList<unsigned int> ) ) ); |
157 QVERIFY( ret ); |
157 QVERIFY( ret ); |
158 ret = connect( MyTestWindowGroup::Instance(), SIGNAL( windowGroupActionCancel( WindowGroupActionType, QList<long int> )), |
158 ret = connect( MyTestWindowGroup::Instance(), SIGNAL( windowGroupActionCancel( WindowGroupActionType, QList<long int> )), |
159 this, SLOT( windowGroupActionCancel( WindowGroupActionType, QList<long int> ) ) ); |
159 this, SLOT( windowGroupActionCancel( WindowGroupActionType, QList<long int> ) ) ); |
160 QVERIFY( ret ); |
160 QVERIFY( ret ); |
161 |
161 |
162 } |
162 } |
163 |
163 |
164 void TestXqKeyCapture::cleanupTestCase() |
164 void TestXQKeyCapture::cleanupTestCase() |
165 { |
165 { |
166 //delete MyTestWindowGroup::Instance(); |
166 //delete MyTestWindowGroup::Instance(); |
167 } |
167 } |
168 |
168 |
169 void TestXqKeyCapture::init() |
169 void TestXQKeyCapture::init() |
170 { |
170 { |
171 keyCapture = new XqKeyCapture(); |
171 keyCapture = new XQKeyCapture(); |
172 } |
172 } |
173 |
173 |
174 void TestXqKeyCapture::cleanup() |
174 void TestXQKeyCapture::cleanup() |
175 { |
175 { |
176 delete keyCapture; |
176 delete keyCapture; |
177 } |
177 } |
178 |
178 |
179 void TestXqKeyCapture::testCreateAndDestroy() |
179 void TestXQKeyCapture::testCreateAndDestroy() |
180 { |
180 { |
181 //empty, all done in init and cleanup |
181 //empty, all done in init and cleanup |
182 } |
182 } |
183 |
183 |
184 //////////////////////////////////////////////////////////////// |
184 //////////////////////////////////////////////////////////////// |
185 // CAPTURE |
185 // CAPTURE |
186 //Capture Key |
186 //Capture Key |
187 //////////////////////////////////////////////////////////////// |
187 //////////////////////////////////////////////////////////////// |
188 void TestXqKeyCapture::testCaptureKey_data() |
188 void TestXQKeyCapture::testCaptureKey_data() |
189 { |
189 { |
190 QTest::addColumn<unsigned int>("qtKey"); |
190 QTest::addColumn<unsigned int>("qtKey"); |
191 QTest::addColumn<unsigned int>("qtMask"); |
191 QTest::addColumn<unsigned int>("qtMask"); |
192 QTest::addColumn<unsigned int>("qtModifier"); |
192 QTest::addColumn<unsigned int>("qtModifier"); |
193 |
193 |
296 keyCapture->captureKey( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
296 keyCapture->captureKey( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
297 |
297 |
298 // keyCapture->captureKey( QList<Qt::Key>() << static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
298 // keyCapture->captureKey( QList<Qt::Key>() << static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
299 } |
299 } |
300 |
300 |
301 void TestXqKeyCapture::testCaptureKeyList_data() |
301 void TestXQKeyCapture::testCaptureKeyList_data() |
302 { |
302 { |
303 testCaptureKey_data(); |
303 testCaptureKey_data(); |
304 } |
304 } |
305 |
305 |
306 void TestXqKeyCapture::testCaptureKeyList() |
306 void TestXQKeyCapture::testCaptureKeyList() |
307 { |
307 { |
308 numOfArgs = 3; |
308 numOfArgs = 3; |
309 actionType = WGATCaptureKey; |
309 actionType = WGATCaptureKey; |
310 additionalResult = false; |
310 additionalResult = false; |
311 ignoreWindowGroupAction = false; |
311 ignoreWindowGroupAction = false; |
338 |
338 |
339 //////////////////////////////////////////////////////////////// |
339 //////////////////////////////////////////////////////////////// |
340 //Capture Key Up And Downs |
340 //Capture Key Up And Downs |
341 //////////////////////////////////////////////////////////////// |
341 //////////////////////////////////////////////////////////////// |
342 |
342 |
343 void TestXqKeyCapture::testCaptureKey_S60_data() |
343 void TestXQKeyCapture::testCaptureKey_S60_data() |
344 { |
344 { |
345 QTest::addColumn<unsigned int>("s60Key"); |
345 QTest::addColumn<unsigned int>("s60Key"); |
346 QTest::addColumn<unsigned int>("qtMask"); |
346 QTest::addColumn<unsigned int>("qtMask"); |
347 QTest::addColumn<unsigned int>("qtModifier"); |
347 QTest::addColumn<unsigned int>("qtModifier"); |
348 |
348 |
448 |
448 |
449 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
449 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
450 keyCapture->captureKey( static_cast<TUint> (s60Key), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
450 keyCapture->captureKey( static_cast<TUint> (s60Key), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
451 } |
451 } |
452 |
452 |
453 void TestXqKeyCapture::testCaptureKeyList_S60_data() |
453 void TestXQKeyCapture::testCaptureKeyList_S60_data() |
454 { |
454 { |
455 testCaptureKey_S60_data(); |
455 testCaptureKey_S60_data(); |
456 } |
456 } |
457 |
457 |
458 void TestXqKeyCapture::testCaptureKeyList_S60() |
458 void TestXQKeyCapture::testCaptureKeyList_S60() |
459 { |
459 { |
460 numOfArgs = 3; |
460 numOfArgs = 3; |
461 actionType = WGATCaptureKey; |
461 actionType = WGATCaptureKey; |
462 additionalResult = false; |
462 additionalResult = false; |
463 ignoreWindowGroupAction = false; |
463 ignoreWindowGroupAction = false; |
488 } |
488 } |
489 |
489 |
490 //////////////////////////////////////////////////////////////// |
490 //////////////////////////////////////////////////////////////// |
491 //Capture Key Up And Downs |
491 //Capture Key Up And Downs |
492 //////////////////////////////////////////////////////////////// |
492 //////////////////////////////////////////////////////////////// |
493 void TestXqKeyCapture::testCaptureKeyUpAndDowns_data() |
493 void TestXQKeyCapture::testCaptureKeyUpAndDowns_data() |
494 { |
494 { |
495 QTest::addColumn<unsigned int>("qtKey"); |
495 QTest::addColumn<unsigned int>("qtKey"); |
496 QTest::addColumn<unsigned int>("qtMask"); |
496 QTest::addColumn<unsigned int>("qtMask"); |
497 QTest::addColumn<unsigned int>("qtModifier"); |
497 QTest::addColumn<unsigned int>("qtModifier"); |
498 |
498 |
546 |
546 |
547 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
547 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
548 keyCapture->captureKeyUpAndDowns( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
548 keyCapture->captureKeyUpAndDowns( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
549 } |
549 } |
550 |
550 |
551 void TestXqKeyCapture::testCaptureKeyUpAndDownsList_data() |
551 void TestXQKeyCapture::testCaptureKeyUpAndDownsList_data() |
552 { |
552 { |
553 testCaptureKeyUpAndDowns_data(); |
553 testCaptureKeyUpAndDowns_data(); |
554 } |
554 } |
555 |
555 |
556 void TestXqKeyCapture::testCaptureKeyUpAndDownsList() |
556 void TestXQKeyCapture::testCaptureKeyUpAndDownsList() |
557 { |
557 { |
558 numOfArgs = 3; |
558 numOfArgs = 3; |
559 actionType = WGATCaptureKeyUpAndDowns; |
559 actionType = WGATCaptureKeyUpAndDowns; |
560 additionalResult = false; |
560 additionalResult = false; |
561 ignoreWindowGroupAction = false; |
561 ignoreWindowGroupAction = false; |
586 } |
586 } |
587 |
587 |
588 //////////////////////////////////////////////////////////////// |
588 //////////////////////////////////////////////////////////////// |
589 //Capture Key Up And Downs |
589 //Capture Key Up And Downs |
590 //////////////////////////////////////////////////////////////// |
590 //////////////////////////////////////////////////////////////// |
591 void TestXqKeyCapture::testCaptureKeyUpAndDowns_S60_data() |
591 void TestXQKeyCapture::testCaptureKeyUpAndDowns_S60_data() |
592 { |
592 { |
593 QTest::addColumn<unsigned int>("qtKey"); |
593 QTest::addColumn<unsigned int>("qtKey"); |
594 QTest::addColumn<unsigned int>("qtMask"); |
594 QTest::addColumn<unsigned int>("qtMask"); |
595 QTest::addColumn<unsigned int>("qtModifier"); |
595 QTest::addColumn<unsigned int>("qtModifier"); |
596 |
596 |
644 |
644 |
645 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
645 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
646 keyCapture->captureKeyUpAndDowns( static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
646 keyCapture->captureKeyUpAndDowns( static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
647 } |
647 } |
648 |
648 |
649 void TestXqKeyCapture::testCaptureKeyUpAndDownsList_S60_data() |
649 void TestXQKeyCapture::testCaptureKeyUpAndDownsList_S60_data() |
650 { |
650 { |
651 testCaptureKeyUpAndDowns_S60_data(); |
651 testCaptureKeyUpAndDowns_S60_data(); |
652 } |
652 } |
653 |
653 |
654 void TestXqKeyCapture::testCaptureKeyUpAndDownsList_S60() |
654 void TestXQKeyCapture::testCaptureKeyUpAndDownsList_S60() |
655 { |
655 { |
656 numOfArgs = 3; |
656 numOfArgs = 3; |
657 actionType = WGATCaptureKeyUpAndDowns; |
657 actionType = WGATCaptureKeyUpAndDowns; |
658 additionalResult = false; |
658 additionalResult = false; |
659 ignoreWindowGroupAction = false; |
659 ignoreWindowGroupAction = false; |
684 } |
684 } |
685 |
685 |
686 //////////////////////////////////////////////////////////////// |
686 //////////////////////////////////////////////////////////////// |
687 //Capture Long Key |
687 //Capture Long Key |
688 //////////////////////////////////////////////////////////////// |
688 //////////////////////////////////////////////////////////////// |
689 void TestXqKeyCapture::testCaptureLongKey_data() |
689 void TestXQKeyCapture::testCaptureLongKey_data() |
690 { |
690 { |
691 QTest::addColumn<unsigned int>("qtKey"); |
691 QTest::addColumn<unsigned int>("qtKey"); |
692 QTest::addColumn<unsigned int>("qtMask"); |
692 QTest::addColumn<unsigned int>("qtMask"); |
693 QTest::addColumn<unsigned int>("qtModifier"); |
693 QTest::addColumn<unsigned int>("qtModifier"); |
694 QTest::addColumn<int>("longFlags"); |
694 QTest::addColumn<int>("longFlags"); |
706 |
706 |
707 |
707 |
708 QTest::newRow("esc_key") << static_cast<unsigned int> ( Qt::Key_Escape ) |
708 QTest::newRow("esc_key") << static_cast<unsigned int> ( Qt::Key_Escape ) |
709 << static_cast<unsigned int> ( Qt::NoModifier ) |
709 << static_cast<unsigned int> ( Qt::NoModifier ) |
710 << static_cast<unsigned int> ( Qt::NoModifier ) |
710 << static_cast<unsigned int> ( Qt::NoModifier ) |
711 << static_cast<int> ( XqKeyCapture::LongNormal ) |
711 << static_cast<int> ( XQKeyCapture::LongNormal ) |
712 << static_cast<unsigned int> ( EKeyEscape ) |
712 << static_cast<unsigned int> ( EKeyEscape ) |
713 << static_cast<unsigned int> ( 0 ) |
713 << static_cast<unsigned int> ( 0 ) |
714 << static_cast<unsigned int> ( 0 ) |
714 << static_cast<unsigned int> ( 0 ) |
715 << static_cast<int> ( 0 ) //priority |
715 << static_cast<int> ( 0 ) //priority |
716 << static_cast<int> ( XqKeyCapture::LongNormal ) |
716 << static_cast<int> ( XQKeyCapture::LongNormal ) |
717 << static_cast<long int> ( 12 ) |
717 << static_cast<long int> ( 12 ) |
718 << false |
718 << false |
719 << static_cast<unsigned int> ( 0 ); |
719 << static_cast<unsigned int> ( 0 ); |
720 |
720 |
721 } |
721 } |
722 |
722 |
723 void TestXqKeyCapture::testCaptureLongKey() |
723 void TestXQKeyCapture::testCaptureLongKey() |
724 { |
724 { |
725 numOfArgs = 6; |
725 numOfArgs = 6; |
726 actionType = WGATCaptureLongKey; |
726 actionType = WGATCaptureLongKey; |
727 additionalResult = false; |
727 additionalResult = false; |
728 ignoreWindowGroupAction = false; |
728 ignoreWindowGroupAction = false; |
750 |
750 |
751 additionalResults.clear(); |
751 additionalResults.clear(); |
752 additionalResults << additionalSymbianKey << symbianMask << symbianModifier << symbianPriority << symbianLongFlags; |
752 additionalResults << additionalSymbianKey << symbianMask << symbianModifier << symbianPriority << symbianLongFlags; |
753 |
753 |
754 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
754 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
755 keyCapture->captureLongKey( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XqKeyCapture::LongFlags> (longFlags) ); |
755 keyCapture->captureLongKey( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XQKeyCapture::LongFlags> (longFlags) ); |
756 } |
756 } |
757 |
757 |
758 void TestXqKeyCapture::testCaptureLongKeyList_data() |
758 void TestXQKeyCapture::testCaptureLongKeyList_data() |
759 { |
759 { |
760 testCaptureLongKey_data(); |
760 testCaptureLongKey_data(); |
761 } |
761 } |
762 |
762 |
763 void TestXqKeyCapture::testCaptureLongKeyList() |
763 void TestXQKeyCapture::testCaptureLongKeyList() |
764 { |
764 { |
765 numOfArgs = 6; |
765 numOfArgs = 6; |
766 actionType = WGATCaptureLongKey; |
766 actionType = WGATCaptureLongKey; |
767 additionalResult = false; |
767 additionalResult = false; |
768 ignoreWindowGroupAction = false; |
768 ignoreWindowGroupAction = false; |
790 |
790 |
791 additionalResults.clear(); |
791 additionalResults.clear(); |
792 additionalResults << additionalSymbianKey << symbianMask << symbianModifier << symbianPriority << symbianLongFlags; |
792 additionalResults << additionalSymbianKey << symbianMask << symbianModifier << symbianPriority << symbianLongFlags; |
793 |
793 |
794 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
794 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
795 keyCapture->captureLongKey( QList<Qt::Key>() << static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XqKeyCapture::LongFlags> (longFlags) ); |
795 keyCapture->captureLongKey( QList<Qt::Key>() << static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XQKeyCapture::LongFlags> (longFlags) ); |
796 } |
796 } |
797 |
797 |
798 //////////////////////////////////////////////////////////////// |
798 //////////////////////////////////////////////////////////////// |
799 //Capture Long Key |
799 //Capture Long Key |
800 //////////////////////////////////////////////////////////////// |
800 //////////////////////////////////////////////////////////////// |
801 void TestXqKeyCapture::testCaptureLongKey_S60_data() |
801 void TestXQKeyCapture::testCaptureLongKey_S60_data() |
802 { |
802 { |
803 QTest::addColumn<unsigned int>("qtKey"); |
803 QTest::addColumn<unsigned int>("qtKey"); |
804 QTest::addColumn<unsigned int>("qtMask"); |
804 QTest::addColumn<unsigned int>("qtMask"); |
805 QTest::addColumn<unsigned int>("qtModifier"); |
805 QTest::addColumn<unsigned int>("qtModifier"); |
806 QTest::addColumn<int>("longFlags"); |
806 QTest::addColumn<int>("longFlags"); |
818 |
818 |
819 |
819 |
820 QTest::newRow("esc_key") << static_cast<unsigned int> ( EKeyEscape ) |
820 QTest::newRow("esc_key") << static_cast<unsigned int> ( EKeyEscape ) |
821 << static_cast<unsigned int> ( Qt::NoModifier ) |
821 << static_cast<unsigned int> ( Qt::NoModifier ) |
822 << static_cast<unsigned int> ( Qt::NoModifier ) |
822 << static_cast<unsigned int> ( Qt::NoModifier ) |
823 << static_cast<int> ( XqKeyCapture::LongNormal ) |
823 << static_cast<int> ( XQKeyCapture::LongNormal ) |
824 << static_cast<unsigned int> ( EKeyEscape ) |
824 << static_cast<unsigned int> ( EKeyEscape ) |
825 << static_cast<unsigned int> ( 0 ) |
825 << static_cast<unsigned int> ( 0 ) |
826 << static_cast<unsigned int> ( 0 ) |
826 << static_cast<unsigned int> ( 0 ) |
827 << static_cast<int> ( 0 ) //priority |
827 << static_cast<int> ( 0 ) //priority |
828 << static_cast<int> ( XqKeyCapture::LongNormal ) |
828 << static_cast<int> ( XQKeyCapture::LongNormal ) |
829 << static_cast<long int> ( 12 ) |
829 << static_cast<long int> ( 12 ) |
830 << false |
830 << false |
831 << static_cast<unsigned int> ( 0 ); |
831 << static_cast<unsigned int> ( 0 ); |
832 |
832 |
833 } |
833 } |
834 |
834 |
835 void TestXqKeyCapture::testCaptureLongKey_S60() |
835 void TestXQKeyCapture::testCaptureLongKey_S60() |
836 { |
836 { |
837 numOfArgs = 6; |
837 numOfArgs = 6; |
838 actionType = WGATCaptureLongKey; |
838 actionType = WGATCaptureLongKey; |
839 additionalResult = false; |
839 additionalResult = false; |
840 ignoreWindowGroupAction = false; |
840 ignoreWindowGroupAction = false; |
862 |
862 |
863 additionalResults.clear(); |
863 additionalResults.clear(); |
864 additionalResults << additionalSymbianKey << symbianMask << symbianModifier << symbianPriority << symbianLongFlags; |
864 additionalResults << additionalSymbianKey << symbianMask << symbianModifier << symbianPriority << symbianLongFlags; |
865 |
865 |
866 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
866 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
867 keyCapture->captureLongKey( static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XqKeyCapture::LongFlags> (longFlags) ); |
867 keyCapture->captureLongKey( static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XQKeyCapture::LongFlags> (longFlags) ); |
868 } |
868 } |
869 |
869 |
870 void TestXqKeyCapture::testCaptureLongKeyList_S60_data() |
870 void TestXQKeyCapture::testCaptureLongKeyList_S60_data() |
871 { |
871 { |
872 testCaptureLongKey_S60_data(); |
872 testCaptureLongKey_S60_data(); |
873 } |
873 } |
874 |
874 |
875 void TestXqKeyCapture::testCaptureLongKeyList_S60() |
875 void TestXQKeyCapture::testCaptureLongKeyList_S60() |
876 { |
876 { |
877 numOfArgs = 6; |
877 numOfArgs = 6; |
878 actionType = WGATCaptureLongKey; |
878 actionType = WGATCaptureLongKey; |
879 additionalResult = false; |
879 additionalResult = false; |
880 ignoreWindowGroupAction = false; |
880 ignoreWindowGroupAction = false; |
902 |
902 |
903 additionalResults.clear(); |
903 additionalResults.clear(); |
904 additionalResults << additionalSymbianKey << symbianMask << symbianModifier << symbianPriority << symbianLongFlags; |
904 additionalResults << additionalSymbianKey << symbianMask << symbianModifier << symbianPriority << symbianLongFlags; |
905 |
905 |
906 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
906 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
907 keyCapture->captureLongKey( QList<TUint>() << static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XqKeyCapture::LongFlags> (longFlags) ); |
907 keyCapture->captureLongKey( QList<TUint>() << static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XQKeyCapture::LongFlags> (longFlags) ); |
908 } |
908 } |
909 |
909 |
910 //////////////////////////////////////////////////////////////// |
910 //////////////////////////////////////////////////////////////// |
911 // CANCEL |
911 // CANCEL |
912 //Cancel Capture Key |
912 //Cancel Capture Key |
913 //////////////////////////////////////////////////////////////// |
913 //////////////////////////////////////////////////////////////// |
914 void TestXqKeyCapture::testCancelCaptureKey_data() |
914 void TestXQKeyCapture::testCancelCaptureKey_data() |
915 { |
915 { |
916 QTest::addColumn<unsigned int>("qtKey"); |
916 QTest::addColumn<unsigned int>("qtKey"); |
917 QTest::addColumn<unsigned int>("qtMask"); |
917 QTest::addColumn<unsigned int>("qtMask"); |
918 QTest::addColumn<unsigned int>("qtModifier"); |
918 QTest::addColumn<unsigned int>("qtModifier"); |
919 |
919 |
997 ignoreWindowGroupAction = false; |
997 ignoreWindowGroupAction = false; |
998 willBeAdditionalRequest = additional; |
998 willBeAdditionalRequest = additional; |
999 keyCapture->cancelCaptureKey( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
999 keyCapture->cancelCaptureKey( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
1000 } |
1000 } |
1001 |
1001 |
1002 void TestXqKeyCapture::testCancelCaptureKeyList_data() |
1002 void TestXQKeyCapture::testCancelCaptureKeyList_data() |
1003 { |
1003 { |
1004 testCancelCaptureKey_data(); |
1004 testCancelCaptureKey_data(); |
1005 } |
1005 } |
1006 |
1006 |
1007 void TestXqKeyCapture::testCancelCaptureKeyList() |
1007 void TestXQKeyCapture::testCancelCaptureKeyList() |
1008 { |
1008 { |
1009 numOfArgs = 1; |
1009 numOfArgs = 1; |
1010 actionType = WGATCancelCaptureKey; |
1010 actionType = WGATCancelCaptureKey; |
1011 additionalResult = false; |
1011 additionalResult = false; |
1012 |
1012 |
1038 |
1038 |
1039 //////////////////////////////////////////////////////////////// |
1039 //////////////////////////////////////////////////////////////// |
1040 // CANCEL |
1040 // CANCEL |
1041 //Cancel Capture Key |
1041 //Cancel Capture Key |
1042 //////////////////////////////////////////////////////////////// |
1042 //////////////////////////////////////////////////////////////// |
1043 void TestXqKeyCapture::testCancelCaptureKey_S60_data() |
1043 void TestXQKeyCapture::testCancelCaptureKey_S60_data() |
1044 { |
1044 { |
1045 QTest::addColumn<unsigned int>("qtKey"); |
1045 QTest::addColumn<unsigned int>("qtKey"); |
1046 QTest::addColumn<unsigned int>("qtMask"); |
1046 QTest::addColumn<unsigned int>("qtMask"); |
1047 QTest::addColumn<unsigned int>("qtModifier"); |
1047 QTest::addColumn<unsigned int>("qtModifier"); |
1048 |
1048 |
1126 ignoreWindowGroupAction = false; |
1126 ignoreWindowGroupAction = false; |
1127 willBeAdditionalRequest = additional; |
1127 willBeAdditionalRequest = additional; |
1128 keyCapture->cancelCaptureKey( static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
1128 keyCapture->cancelCaptureKey( static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
1129 } |
1129 } |
1130 |
1130 |
1131 void TestXqKeyCapture::testCancelCaptureKeyList_S60_data() |
1131 void TestXQKeyCapture::testCancelCaptureKeyList_S60_data() |
1132 { |
1132 { |
1133 testCancelCaptureKey_S60_data(); |
1133 testCancelCaptureKey_S60_data(); |
1134 } |
1134 } |
1135 |
1135 |
1136 void TestXqKeyCapture::testCancelCaptureKeyList_S60() |
1136 void TestXQKeyCapture::testCancelCaptureKeyList_S60() |
1137 { |
1137 { |
1138 numOfArgs = 1; |
1138 numOfArgs = 1; |
1139 actionType = WGATCancelCaptureKey; |
1139 actionType = WGATCancelCaptureKey; |
1140 additionalResult = false; |
1140 additionalResult = false; |
1141 |
1141 |
1166 } |
1166 } |
1167 |
1167 |
1168 //////////////////////////////////////////////////////////////// |
1168 //////////////////////////////////////////////////////////////// |
1169 //Cancel Capture Key Up And Downs |
1169 //Cancel Capture Key Up And Downs |
1170 //////////////////////////////////////////////////////////////// |
1170 //////////////////////////////////////////////////////////////// |
1171 void TestXqKeyCapture::testCancelCaptureKeyUpAndDowns_data() |
1171 void TestXQKeyCapture::testCancelCaptureKeyUpAndDowns_data() |
1172 { |
1172 { |
1173 QTest::addColumn<unsigned int>("qtKey"); |
1173 QTest::addColumn<unsigned int>("qtKey"); |
1174 QTest::addColumn<unsigned int>("qtMask"); |
1174 QTest::addColumn<unsigned int>("qtMask"); |
1175 QTest::addColumn<unsigned int>("qtModifier"); |
1175 QTest::addColumn<unsigned int>("qtModifier"); |
1176 |
1176 |
1218 ignoreWindowGroupAction = false; |
1218 ignoreWindowGroupAction = false; |
1219 willBeAdditionalRequest = additional; |
1219 willBeAdditionalRequest = additional; |
1220 keyCapture->cancelCaptureKeyUpAndDowns( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
1220 keyCapture->cancelCaptureKeyUpAndDowns( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
1221 } |
1221 } |
1222 |
1222 |
1223 void TestXqKeyCapture::testCancelCaptureKeyUpAndDownsList_data() |
1223 void TestXQKeyCapture::testCancelCaptureKeyUpAndDownsList_data() |
1224 { |
1224 { |
1225 testCancelCaptureKeyUpAndDowns_data(); |
1225 testCancelCaptureKeyUpAndDowns_data(); |
1226 } |
1226 } |
1227 |
1227 |
1228 void TestXqKeyCapture::testCancelCaptureKeyUpAndDownsList() |
1228 void TestXQKeyCapture::testCancelCaptureKeyUpAndDownsList() |
1229 { |
1229 { |
1230 numOfArgs = 1; |
1230 numOfArgs = 1; |
1231 actionType = WGATCancelCaptureKeyUpAndDowns; |
1231 actionType = WGATCancelCaptureKeyUpAndDowns; |
1232 additionalResult = false; |
1232 additionalResult = false; |
1233 |
1233 |
1258 } |
1258 } |
1259 |
1259 |
1260 //////////////////////////////////////////////////////////////// |
1260 //////////////////////////////////////////////////////////////// |
1261 //Cancel Capture Key Up And Downs |
1261 //Cancel Capture Key Up And Downs |
1262 //////////////////////////////////////////////////////////////// |
1262 //////////////////////////////////////////////////////////////// |
1263 void TestXqKeyCapture::testCancelCaptureKeyUpAndDowns_S60_data() |
1263 void TestXQKeyCapture::testCancelCaptureKeyUpAndDowns_S60_data() |
1264 { |
1264 { |
1265 QTest::addColumn<unsigned int>("qtKey"); |
1265 QTest::addColumn<unsigned int>("qtKey"); |
1266 QTest::addColumn<unsigned int>("qtMask"); |
1266 QTest::addColumn<unsigned int>("qtMask"); |
1267 QTest::addColumn<unsigned int>("qtModifier"); |
1267 QTest::addColumn<unsigned int>("qtModifier"); |
1268 |
1268 |
1310 ignoreWindowGroupAction = false; |
1310 ignoreWindowGroupAction = false; |
1311 willBeAdditionalRequest = additional; |
1311 willBeAdditionalRequest = additional; |
1312 keyCapture->cancelCaptureKeyUpAndDowns( static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
1312 keyCapture->cancelCaptureKeyUpAndDowns( static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ) ); |
1313 } |
1313 } |
1314 |
1314 |
1315 void TestXqKeyCapture::testCancelCaptureKeyUpAndDownsList_S60_data() |
1315 void TestXQKeyCapture::testCancelCaptureKeyUpAndDownsList_S60_data() |
1316 { |
1316 { |
1317 testCancelCaptureKeyUpAndDowns_S60_data(); |
1317 testCancelCaptureKeyUpAndDowns_S60_data(); |
1318 } |
1318 } |
1319 |
1319 |
1320 void TestXqKeyCapture::testCancelCaptureKeyUpAndDownsList_S60() |
1320 void TestXQKeyCapture::testCancelCaptureKeyUpAndDownsList_S60() |
1321 { |
1321 { |
1322 numOfArgs = 1; |
1322 numOfArgs = 1; |
1323 actionType = WGATCancelCaptureKeyUpAndDowns; |
1323 actionType = WGATCancelCaptureKeyUpAndDowns; |
1324 additionalResult = false; |
1324 additionalResult = false; |
1325 |
1325 |
1350 } |
1350 } |
1351 |
1351 |
1352 //////////////////////////////////////////////////////////////// |
1352 //////////////////////////////////////////////////////////////// |
1353 //Cancel Capture Long Key |
1353 //Cancel Capture Long Key |
1354 //////////////////////////////////////////////////////////////// |
1354 //////////////////////////////////////////////////////////////// |
1355 void TestXqKeyCapture::testCancelCaptureLongKey_data() |
1355 void TestXQKeyCapture::testCancelCaptureLongKey_data() |
1356 { |
1356 { |
1357 QTest::addColumn<unsigned int>("qtKey"); |
1357 QTest::addColumn<unsigned int>("qtKey"); |
1358 QTest::addColumn<unsigned int>("qtMask"); |
1358 QTest::addColumn<unsigned int>("qtMask"); |
1359 QTest::addColumn<unsigned int>("qtModifier"); |
1359 QTest::addColumn<unsigned int>("qtModifier"); |
1360 QTest::addColumn<int>("longFlags"); |
1360 QTest::addColumn<int>("longFlags"); |
1365 QTest::addColumn<long int>("additionalReqNum"); |
1365 QTest::addColumn<long int>("additionalReqNum"); |
1366 |
1366 |
1367 QTest::newRow("esc_key") << static_cast<unsigned int> ( Qt::Key_Escape ) |
1367 QTest::newRow("esc_key") << static_cast<unsigned int> ( Qt::Key_Escape ) |
1368 << static_cast<unsigned int> ( Qt::NoModifier ) |
1368 << static_cast<unsigned int> ( Qt::NoModifier ) |
1369 << static_cast<unsigned int> ( Qt::NoModifier ) |
1369 << static_cast<unsigned int> ( Qt::NoModifier ) |
1370 << static_cast<int> ( XqKeyCapture::LongNormal ) |
1370 << static_cast<int> ( XQKeyCapture::LongNormal ) |
1371 << static_cast<long int> ( 22 ) |
1371 << static_cast<long int> ( 22 ) |
1372 << false |
1372 << false |
1373 << static_cast<long int> ( 23 ); |
1373 << static_cast<long int> ( 23 ); |
1374 |
1374 |
1375 |
1375 |
1376 |
1376 |
1377 |
1377 |
1378 |
1378 |
1379 } |
1379 } |
1380 |
1380 |
1381 void TestXqKeyCapture::testCancelCaptureLongKey() |
1381 void TestXQKeyCapture::testCancelCaptureLongKey() |
1382 { |
1382 { |
1383 numOfArgs = 1; |
1383 numOfArgs = 1; |
1384 actionType = WGATCancelCaptureLongKey; |
1384 actionType = WGATCancelCaptureLongKey; |
1385 additionalResult = false; |
1385 additionalResult = false; |
1386 |
1386 |
1403 cancelAdditionalResults.clear(); |
1403 cancelAdditionalResults.clear(); |
1404 cancelAdditionalResults << additionalReqNum; |
1404 cancelAdditionalResults << additionalReqNum; |
1405 |
1405 |
1406 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
1406 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
1407 ignoreWindowGroupAction = true; |
1407 ignoreWindowGroupAction = true; |
1408 keyCapture->captureLongKey( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XqKeyCapture::LongFlags> (longFlags) ); |
1408 keyCapture->captureLongKey( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XQKeyCapture::LongFlags> (longFlags) ); |
1409 ignoreWindowGroupAction = false; |
1409 ignoreWindowGroupAction = false; |
1410 willBeAdditionalRequest = additional; |
1410 willBeAdditionalRequest = additional; |
1411 keyCapture->cancelCaptureLongKey( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XqKeyCapture::LongFlags> (longFlags) ); |
1411 keyCapture->cancelCaptureLongKey( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XQKeyCapture::LongFlags> (longFlags) ); |
1412 } |
1412 } |
1413 |
1413 |
1414 void TestXqKeyCapture::testCancelCaptureLongKeyList_data() |
1414 void TestXQKeyCapture::testCancelCaptureLongKeyList_data() |
1415 { |
1415 { |
1416 testCancelCaptureLongKey_data(); |
1416 testCancelCaptureLongKey_data(); |
1417 } |
1417 } |
1418 |
1418 |
1419 void TestXqKeyCapture::testCancelCaptureLongKeyList() |
1419 void TestXQKeyCapture::testCancelCaptureLongKeyList() |
1420 { |
1420 { |
1421 numOfArgs = 1; |
1421 numOfArgs = 1; |
1422 actionType = WGATCancelCaptureLongKey; |
1422 actionType = WGATCancelCaptureLongKey; |
1423 additionalResult = false; |
1423 additionalResult = false; |
1424 |
1424 |
1441 cancelAdditionalResults.clear(); |
1441 cancelAdditionalResults.clear(); |
1442 cancelAdditionalResults << additionalReqNum; |
1442 cancelAdditionalResults << additionalReqNum; |
1443 |
1443 |
1444 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
1444 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
1445 ignoreWindowGroupAction = true; |
1445 ignoreWindowGroupAction = true; |
1446 keyCapture->captureLongKey( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XqKeyCapture::LongFlags> (longFlags) ); |
1446 keyCapture->captureLongKey( static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XQKeyCapture::LongFlags> (longFlags) ); |
1447 ignoreWindowGroupAction = false; |
1447 ignoreWindowGroupAction = false; |
1448 willBeAdditionalRequest = additional; |
1448 willBeAdditionalRequest = additional; |
1449 keyCapture->cancelCaptureLongKey( QList<Qt::Key>() << static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XqKeyCapture::LongFlags> (longFlags) ); |
1449 keyCapture->cancelCaptureLongKey( QList<Qt::Key>() << static_cast<Qt::Key> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XQKeyCapture::LongFlags> (longFlags) ); |
1450 } |
1450 } |
1451 |
1451 |
1452 //////////////////////////////////////////////////////////////// |
1452 //////////////////////////////////////////////////////////////// |
1453 //Cancel Capture Long Key |
1453 //Cancel Capture Long Key |
1454 //////////////////////////////////////////////////////////////// |
1454 //////////////////////////////////////////////////////////////// |
1455 void TestXqKeyCapture::testCancelCaptureLongKey_S60_data() |
1455 void TestXQKeyCapture::testCancelCaptureLongKey_S60_data() |
1456 { |
1456 { |
1457 QTest::addColumn<unsigned int>("qtKey"); |
1457 QTest::addColumn<unsigned int>("qtKey"); |
1458 QTest::addColumn<unsigned int>("qtMask"); |
1458 QTest::addColumn<unsigned int>("qtMask"); |
1459 QTest::addColumn<unsigned int>("qtModifier"); |
1459 QTest::addColumn<unsigned int>("qtModifier"); |
1460 QTest::addColumn<int>("longFlags"); |
1460 QTest::addColumn<int>("longFlags"); |
1465 QTest::addColumn<long int>("additionalReqNum"); |
1465 QTest::addColumn<long int>("additionalReqNum"); |
1466 |
1466 |
1467 QTest::newRow("esc_key") << static_cast<unsigned int> ( EKeyEscape ) |
1467 QTest::newRow("esc_key") << static_cast<unsigned int> ( EKeyEscape ) |
1468 << static_cast<unsigned int> ( Qt::NoModifier ) |
1468 << static_cast<unsigned int> ( Qt::NoModifier ) |
1469 << static_cast<unsigned int> ( Qt::NoModifier ) |
1469 << static_cast<unsigned int> ( Qt::NoModifier ) |
1470 << static_cast<int> ( XqKeyCapture::LongNormal ) |
1470 << static_cast<int> ( XQKeyCapture::LongNormal ) |
1471 << static_cast<long int> ( 22 ) |
1471 << static_cast<long int> ( 22 ) |
1472 << false |
1472 << false |
1473 << static_cast<long int> ( 23 ); |
1473 << static_cast<long int> ( 23 ); |
1474 |
1474 |
1475 |
1475 |
1476 |
1476 |
1477 |
1477 |
1478 |
1478 |
1479 } |
1479 } |
1480 |
1480 |
1481 void TestXqKeyCapture::testCancelCaptureLongKey_S60() |
1481 void TestXQKeyCapture::testCancelCaptureLongKey_S60() |
1482 { |
1482 { |
1483 numOfArgs = 1; |
1483 numOfArgs = 1; |
1484 actionType = WGATCancelCaptureLongKey; |
1484 actionType = WGATCancelCaptureLongKey; |
1485 additionalResult = false; |
1485 additionalResult = false; |
1486 |
1486 |
1503 cancelAdditionalResults.clear(); |
1503 cancelAdditionalResults.clear(); |
1504 cancelAdditionalResults << additionalReqNum; |
1504 cancelAdditionalResults << additionalReqNum; |
1505 |
1505 |
1506 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
1506 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
1507 ignoreWindowGroupAction = true; |
1507 ignoreWindowGroupAction = true; |
1508 keyCapture->captureLongKey( static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XqKeyCapture::LongFlags> (longFlags) ); |
1508 keyCapture->captureLongKey( static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XQKeyCapture::LongFlags> (longFlags) ); |
1509 ignoreWindowGroupAction = false; |
1509 ignoreWindowGroupAction = false; |
1510 willBeAdditionalRequest = additional; |
1510 willBeAdditionalRequest = additional; |
1511 keyCapture->cancelCaptureLongKey( static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XqKeyCapture::LongFlags> (longFlags) ); |
1511 keyCapture->cancelCaptureLongKey( static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XQKeyCapture::LongFlags> (longFlags) ); |
1512 } |
1512 } |
1513 |
1513 |
1514 void TestXqKeyCapture::testCancelCaptureLongKeyList_S60_data() |
1514 void TestXQKeyCapture::testCancelCaptureLongKeyList_S60_data() |
1515 { |
1515 { |
1516 testCancelCaptureLongKey_S60_data(); |
1516 testCancelCaptureLongKey_S60_data(); |
1517 } |
1517 } |
1518 |
1518 |
1519 void TestXqKeyCapture::testCancelCaptureLongKeyList_S60() |
1519 void TestXQKeyCapture::testCancelCaptureLongKeyList_S60() |
1520 { |
1520 { |
1521 numOfArgs = 1; |
1521 numOfArgs = 1; |
1522 actionType = WGATCancelCaptureLongKey; |
1522 actionType = WGATCancelCaptureLongKey; |
1523 additionalResult = false; |
1523 additionalResult = false; |
1524 |
1524 |
1541 cancelAdditionalResults.clear(); |
1541 cancelAdditionalResults.clear(); |
1542 cancelAdditionalResults << additionalReqNum; |
1542 cancelAdditionalResults << additionalReqNum; |
1543 |
1543 |
1544 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
1544 MyTestWindowGroup::Instance()->setRequestNumber(reqNum); |
1545 ignoreWindowGroupAction = true; |
1545 ignoreWindowGroupAction = true; |
1546 keyCapture->captureLongKey( static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XqKeyCapture::LongFlags> (longFlags) ); |
1546 keyCapture->captureLongKey( static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XQKeyCapture::LongFlags> (longFlags) ); |
1547 ignoreWindowGroupAction = false; |
1547 ignoreWindowGroupAction = false; |
1548 willBeAdditionalRequest = additional; |
1548 willBeAdditionalRequest = additional; |
1549 keyCapture->cancelCaptureLongKey(QList<TUint>() << static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XqKeyCapture::LongFlags> (longFlags) ); |
1549 keyCapture->cancelCaptureLongKey(QList<TUint>() << static_cast<TUint> (qtKey), Qt::KeyboardModifier( qtMask ), Qt::KeyboardModifier( qtModifier ), static_cast<XQKeyCapture::LongFlags> (longFlags) ); |
1550 } |
1550 } |
1551 |
1551 |
1552 |
1552 |
1553 |
1553 |
1554 //////////////////////////////////////////////////////////////// |
1554 //////////////////////////////////////////////////////////////// |
1555 // ERRORS |
1555 // ERRORS |
1556 //errorString |
1556 //errorString |
1557 //////////////////////////////////////////////////////////////// |
1557 //////////////////////////////////////////////////////////////// |
1558 void TestXqKeyCapture::testErrorString() |
1558 void TestXQKeyCapture::testErrorString() |
1559 { |
1559 { |
1560 keyCapture->errorString(); |
1560 keyCapture->errorString(); |
1561 } |
1561 } |
1562 |
1562 |
1563 //////////////////////////////////////////////////////////////// |
1563 //////////////////////////////////////////////////////////////// |
1564 // ERRORS |
1564 // ERRORS |
1565 //errorId |
1565 //errorId |
1566 //////////////////////////////////////////////////////////////// |
1566 //////////////////////////////////////////////////////////////// |
1567 void TestXqKeyCapture::testErrorId() |
1567 void TestXQKeyCapture::testErrorId() |
1568 { |
1568 { |
1569 keyCapture->errorId(); |
1569 keyCapture->errorId(); |
1570 } |
1570 } |
1571 |
1571 |
1572 QString TestXqKeyCapture::clearString(const QString& line, const QString& prefix, const QString& comment) { |
1572 QString TestXQKeyCapture::clearString(const QString& line, const QString& prefix, const QString& comment) { |
1573 QString s(line); |
1573 QString s(line); |
1574 s.replace(prefix, comment); |
1574 s.replace(prefix, comment); |
1575 s.replace(" ", ""); |
1575 s.replace(" ", ""); |
1576 s.replace("\t", ""); |
1576 s.replace("\t", ""); |
1577 return s.trimmed(); |
1577 return s.trimmed(); |
1578 } |
1578 } |
1579 |
1579 |
1580 //////////////////////////////////////////////////////////////// |
1580 //////////////////////////////////////////////////////////////// |
1581 // TEST KEY MAPPER FILE |
1581 // TEST KEY MAPPER FILE |
1582 //////////////////////////////////////////////////////////////// |
1582 //////////////////////////////////////////////////////////////// |
1583 void TestXqKeyCapture::testKeyMapperFile() |
1583 void TestXQKeyCapture::testKeyMapperFile() |
1584 { |
1584 { |
1585 QString prefix(" keyMapping.append(KeyMapping("); |
1585 QString prefix(" keyMapping.append(KeyMapping("); |
1586 QString comment("//"); |
1586 QString comment("//"); |
1587 |
1587 |
1588 QStringList qt; |
1588 QStringList qt; |
1626 |
1626 |
1627 //////////////////////////////////////////////////////////////// |
1627 //////////////////////////////////////////////////////////////// |
1628 // REQUEST SLOT |
1628 // REQUEST SLOT |
1629 //windowGroupAction |
1629 //windowGroupAction |
1630 //////////////////////////////////////////////////////////////// |
1630 //////////////////////////////////////////////////////////////// |
1631 void TestXqKeyCapture::windowGroupAction( WindowGroupActionType wgat, QList<unsigned int> paramList ) |
1631 void TestXQKeyCapture::windowGroupAction( WindowGroupActionType wgat, QList<unsigned int> paramList ) |
1632 { |
1632 { |
1633 if( !ignoreWindowGroupAction ) |
1633 if( !ignoreWindowGroupAction ) |
1634 { |
1634 { |
1635 QVERIFY( wgat == actionType ); |
1635 QVERIFY( wgat == actionType ); |
1636 QVERIFY( paramList.count() == numOfArgs ); |
1636 QVERIFY( paramList.count() == numOfArgs ); |
1650 } |
1650 } |
1651 |
1651 |
1652 //////////////////////////////////////////////////////////////// |
1652 //////////////////////////////////////////////////////////////// |
1653 //windowGroupActionCancel |
1653 //windowGroupActionCancel |
1654 //////////////////////////////////////////////////////////////// |
1654 //////////////////////////////////////////////////////////////// |
1655 void TestXqKeyCapture::windowGroupActionCancel( WindowGroupActionType wgat, QList<long int> paramList ) |
1655 void TestXQKeyCapture::windowGroupActionCancel( WindowGroupActionType wgat, QList<long int> paramList ) |
1656 { |
1656 { |
1657 QVERIFY( wgat == actionType ); |
1657 QVERIFY( wgat == actionType ); |
1658 QVERIFY( paramList.count() == numOfArgs ); |
1658 QVERIFY( paramList.count() == numOfArgs ); |
1659 |
1659 |
1660 for( int i = 0; i < numOfArgs; i++) |
1660 for( int i = 0; i < numOfArgs; i++) |
1677 |
1677 |
1678 #ifdef _XQKEYCAPTURE_UNITTEST_LOG_TO_C_ |
1678 #ifdef _XQKEYCAPTURE_UNITTEST_LOG_TO_C_ |
1679 main (int argc, char* argv[]) |
1679 main (int argc, char* argv[]) |
1680 { |
1680 { |
1681 QApplication app(argc, argv); |
1681 QApplication app(argc, argv); |
1682 TestXqKeyCapture tc; |
1682 TestXQKeyCapture tc; |
1683 int c = 3; |
1683 int c = 3; |
1684 char* v[] = {argv[0], "-o", "c:/test.txt"}; |
1684 char* v[] = {argv[0], "-o", "c:/test.txt"}; |
1685 return QTest::qExec(&tc, c, v); |
1685 return QTest::qExec(&tc, c, v); |
1686 } |
1686 } |
1687 #else |
1687 #else |
1688 QTEST_MAIN(TestXqKeyCapture) |
1688 QTEST_MAIN(TestXQKeyCapture) |
1689 #endif |
1689 #endif |
1690 |
1690 |
1691 #include "test_xqkeycapture.moc" |
1691 #include "test_xqkeycapture.moc" |