271
|
1 |
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// e32test\digitiser\t_kerneldigitisertest.cpp
|
|
15 |
// Overview:
|
|
16 |
// Test the TRawEvent APIS and events associated with the Digitiser and also verify the BTRACEs (manually)
|
|
17 |
// Tests kernel side functions
|
|
18 |
// API Information:
|
|
19 |
// TRawEvent
|
|
20 |
// Details:
|
|
21 |
// - Test the following 6 Events types
|
|
22 |
// 1. EPointerMove
|
|
23 |
// 2. EPointer3DInRange,
|
|
24 |
// 3. EPointer3DOutOfRange,
|
|
25 |
// 4. EPointer3DTilt,
|
|
26 |
// 5. EPointer3DRotation,
|
|
27 |
// 6. EPointer3DTiltAndMove,
|
|
28 |
// Platforms/Drives/Compatibility:
|
|
29 |
// All.
|
|
30 |
// Assumptions/Requirement/Pre-requisites:
|
|
31 |
// Failures and causes:
|
|
32 |
//
|
|
33 |
//
|
|
34 |
#define __E32TEST_EXTENSION__
|
|
35 |
|
|
36 |
#include <e32test.h>
|
|
37 |
#include <e32svr.h>
|
|
38 |
#include <e32cmn.h>
|
|
39 |
#include <e32cmn_private.h>
|
|
40 |
#include "d_kerneldigitisertest.h"
|
|
41 |
|
|
42 |
LOCAL_D RTest test(_L("T_KernelDigitiserTest"));
|
|
43 |
|
|
44 |
RTestDigitiserLdd gLdd;
|
|
45 |
|
|
46 |
//
|
|
47 |
// class TestTRawDigitiserEvent user side constructor
|
|
48 |
//
|
|
49 |
|
|
50 |
TestTRawDigitiserEvent::TestTRawDigitiserEvent(TRawEvent::TType aType,TInt aX,TInt aY,TInt aZ,TInt aScanCode,TInt aPhi,TInt aTheta,TInt aAlpha,TUint8 aPointerNumber,TUint8 aTip)
|
|
51 |
:iType(aType),iX(aX),iY(aY),iZ(aZ),iScanCode(aScanCode),iPhi(aPhi),iTheta(aTheta),iAlpha(aAlpha),iPointerNumber(aPointerNumber),iTip(aTip)
|
|
52 |
{}
|
|
53 |
|
|
54 |
|
|
55 |
//
|
|
56 |
// other functions
|
|
57 |
//
|
|
58 |
void LoadDeviceDriver()
|
|
59 |
{
|
|
60 |
test_KErrNone(User::LoadLogicalDevice(KLddName));
|
|
61 |
test_KErrNone(gLdd.Open());
|
|
62 |
}
|
|
63 |
|
|
64 |
void UnloadDeviceDriver()
|
|
65 |
{
|
|
66 |
gLdd.Close();
|
|
67 |
test_KErrNone(User::FreeLogicalDevice(KLddName));
|
|
68 |
}
|
|
69 |
|
|
70 |
|
|
71 |
GLDEF_C TInt E32Main()
|
|
72 |
//
|
|
73 |
//
|
|
74 |
{
|
|
75 |
__UHEAP_MARK;
|
|
76 |
test.Title();
|
|
77 |
|
|
78 |
test.Start(_L("Testing kernel side digitiser events"));
|
|
79 |
|
|
80 |
TestTRawDigitiserEvent kDigitiserEvent1(TRawEvent::EPointerMove, -890,-123, -823,455,2563,156,62,3,1);
|
|
81 |
TestTRawDigitiserEvent kDigitiserEvent2(TRawEvent::EPointer3DInRange, 23,45,23,1,2,6,4,2,1);
|
|
82 |
TestTRawDigitiserEvent kDigitiserEvent3(TRawEvent::EPointer3DOutOfRange, 23,45,23,1,2,6,4,2,0);
|
|
83 |
TestTRawDigitiserEvent kDigitiserEvent4(TRawEvent::EPointer3DTilt, 23,45,23,1,2,6,4,2,1);
|
|
84 |
TestTRawDigitiserEvent kDigitiserEvent5(TRawEvent::EPointer3DRotation, 23,45,23,1,2,6,4,2,1);
|
|
85 |
TestTRawDigitiserEvent kDigitiserEvent6(TRawEvent::EPointer3DTiltAndMove, 23,45,23,1,2,6,4,2,0);
|
|
86 |
|
|
87 |
LoadDeviceDriver();
|
|
88 |
|
|
89 |
test.Printf(_L("kDigitiserEvent1"));
|
|
90 |
test_KErrNone(gLdd.StartTest(kDigitiserEvent1));
|
|
91 |
|
|
92 |
test.Printf(_L("kDigitiserEvent2"));
|
|
93 |
test_KErrNone(gLdd.StartTest(kDigitiserEvent2));
|
|
94 |
|
|
95 |
test.Printf(_L("kDigitiserEvent3"));
|
|
96 |
test_KErrNone(gLdd.StartTest(kDigitiserEvent3));
|
|
97 |
|
|
98 |
test.Printf(_L("kDigitiserEvent4"));
|
|
99 |
test_KErrNone(gLdd.StartTest(kDigitiserEvent4));
|
|
100 |
|
|
101 |
test.Printf(_L("kDigitiserEvent5"));
|
|
102 |
test_KErrNone(gLdd.StartTest(kDigitiserEvent5));
|
|
103 |
|
|
104 |
test.Printf(_L("kDigitiserEvent6"));
|
|
105 |
test_KErrNone(gLdd.StartTest(kDigitiserEvent6));
|
|
106 |
|
|
107 |
UnloadDeviceDriver();
|
|
108 |
|
|
109 |
test.Printf(_L("T_KERNELDIGITISERTEST: Successfully Completed\n"));
|
|
110 |
|
|
111 |
test.End();
|
|
112 |
test.Close();
|
|
113 |
|
|
114 |
__UHEAP_MARKEND;
|
|
115 |
return KErrNone;
|
|
116 |
}
|