equal
deleted
inserted
replaced
67 } |
67 } |
68 } |
68 } |
69 |
69 |
70 void TestSynchronousOperation() |
70 void TestSynchronousOperation() |
71 { |
71 { |
72 test.Next(_L("TestSynchronousOperation()")); |
72 test.Next(_L("TestSynchronousOperations:")); |
73 |
73 |
74 test.Next(_L("HalfDuplexSingleWrite()")); |
74 test.Next(_L("HalfDuplexSingleWrite()")); |
75 while(1) |
|
76 TestError(testLdd.HalfDuplexSingleWrite()); |
75 TestError(testLdd.HalfDuplexSingleWrite()); |
77 |
76 |
78 test.Next(_L("HalfDuplexMultipleWrite()")); |
77 test.Next(_L("HalfDuplexMultipleWrite()")); |
79 TestError(testLdd.HalfDuplexMultipleWrite()); |
78 TestError(testLdd.HalfDuplexMultipleWrite()); |
80 |
79 |
92 |
91 |
93 test.Next(_L("FullDuplexMultiple()")); |
92 test.Next(_L("FullDuplexMultiple()")); |
94 TestError(testLdd.FullDuplexMultiple()); |
93 TestError(testLdd.FullDuplexMultiple()); |
95 } |
94 } |
96 |
95 |
|
96 void TestAsynchronousOperation() |
|
97 { |
|
98 test.Next(_L("Test_AsynchronousOperations:")); |
|
99 |
|
100 TRequestStatus status; |
|
101 |
|
102 test.Next(_L("HalfDuplexSingleWrite()")); |
|
103 testLdd.HalfDuplexSingleWrite(status); |
|
104 User::WaitForRequest(status); // wait for completion.. |
|
105 if(status != KErrNone) |
|
106 { |
|
107 test.Printf(_L("Error was %d"), status.Int()); |
|
108 test(EFalse); |
|
109 } |
|
110 |
|
111 } |
97 |
112 |
98 TInt E32Main() |
113 TInt E32Main() |
99 { |
114 { |
100 test.Title(); |
115 test.Title(); |
101 test.Start(_L("Testing SPI..")); |
116 test.Start(_L("Testing SPI..")); |
102 |
|
103 PrepareDriver(); |
117 PrepareDriver(); |
104 |
118 |
105 TestSynchronousOperation(); |
119 TestSynchronousOperation(); |
|
120 TestAsynchronousOperation(); |
106 |
121 |
107 ReleaseDriver(); |
122 ReleaseDriver(); |
108 |
|
109 test.End(); |
123 test.End(); |
110 |
|
111 return KErrNone; |
124 return KErrNone; |
112 } |
125 } |
113 |
126 |