sl@0
|
1 |
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// e32test\buffer\t_que.cpp
|
sl@0
|
15 |
// Overview:
|
sl@0
|
16 |
// Test double linked list functionality.
|
sl@0
|
17 |
// API Information:
|
sl@0
|
18 |
// TDblQueLinkBase, TDeltaQueLink, TDblQueLink, TPriQueLink,
|
sl@0
|
19 |
// TDblQueIterBase, TDblQueIter
|
sl@0
|
20 |
// Details:
|
sl@0
|
21 |
// - Create many TDblQueLinkBase links, insert links at specified locations
|
sl@0
|
22 |
// and check previous and next links are as expected.
|
sl@0
|
23 |
// - Create many TDeltaQueLink links, insert these links at specified locations
|
sl@0
|
24 |
// and check previous and next links are as expected.
|
sl@0
|
25 |
// - Create many TDblQueLink links, insert, remove these links at specified
|
sl@0
|
26 |
// locations and check previous and next links are as expected.
|
sl@0
|
27 |
// - Create many TPriQueLink links, insert, remove these links at specified
|
sl@0
|
28 |
// locations and check previous and next links are as expected.
|
sl@0
|
29 |
// - Create TDblQueBase based object without offset, with specified offset
|
sl@0
|
30 |
// and check it is constructed as expected.
|
sl@0
|
31 |
// - Create TDblQueBase based object, insert and remove TPriQueLink list
|
sl@0
|
32 |
// element, set priorities of TPriQueLink list elements, call IsEmpty
|
sl@0
|
33 |
// and Reset methods.
|
sl@0
|
34 |
// - Create TDblQueBase based object without, with offset and check
|
sl@0
|
35 |
// it is constructed as expected
|
sl@0
|
36 |
// - Create TDblQueBase based object, insert TDblQueLink links at
|
sl@0
|
37 |
// specified locations and check that they are added as expected.
|
sl@0
|
38 |
// - Initialise TPriQueLink link with different priorities, insert
|
sl@0
|
39 |
// the elements in priority order and check that they are added
|
sl@0
|
40 |
// as expected.
|
sl@0
|
41 |
// - Create TDblQueBase based object, check the double linked list for empty
|
sl@0
|
42 |
// before inserting, after inserting, before/after Deque, before/after Enque,
|
sl@0
|
43 |
// after Reset. Verify that results are as expected.
|
sl@0
|
44 |
// - Create TDeltaQueBase object without offset, with specified offset
|
sl@0
|
45 |
// and check it is constructed as expected. Insert TDeltaQueLink list
|
sl@0
|
46 |
// elements at specified distance from the zero point, remove the elements
|
sl@0
|
47 |
// at specified distance, decrement the delta value.
|
sl@0
|
48 |
// - Create TDeltaQueBase based object, insert TDblQueLink link at specified
|
sl@0
|
49 |
// locations and check the previous, next link are as expected.
|
sl@0
|
50 |
// - Check the linked list for empty before inserting, after inserting,
|
sl@0
|
51 |
// before/after Deque, before/after Enque, after Reset. Verify that results
|
sl@0
|
52 |
// are as expected.
|
sl@0
|
53 |
// - Create TDeltaQueBase based object, insert links using DoAddDelta method,
|
sl@0
|
54 |
// check that links are as expected. Delete links using DoRemove and
|
sl@0
|
55 |
// DoRemoveFirst methods and check that links are as expected.
|
sl@0
|
56 |
// - Create TDeltaQueBase based object, insert links using DoAddDelta method,
|
sl@0
|
57 |
// check the return value of CountDown is as expected. Delete links using
|
sl@0
|
58 |
// DoRemoveFirst method and check the return value of CountDown is as expected.
|
sl@0
|
59 |
// - Create TDblQue based object, insert links at front and last, call IsHead,
|
sl@0
|
60 |
// IsFirst, IsLast, First and Last methods.
|
sl@0
|
61 |
// - Create TDblQue object, check list for empty before inserting, after
|
sl@0
|
62 |
// inserting, before/after Deque, before/after Enque, after Reset.
|
sl@0
|
63 |
// Verify that results are as expected.
|
sl@0
|
64 |
// - Create TDblQue based object with offset constructor, insert links at
|
sl@0
|
65 |
// specified locations and check it is added as specified.
|
sl@0
|
66 |
// - Create TDblQue based object, insert links using AddFirst and AddLast and
|
sl@0
|
67 |
// check the links are as expected.
|
sl@0
|
68 |
// - Create TDblQue based object, insert links using AddFirst and AddLast and
|
sl@0
|
69 |
// check the result of the IsHead, IsFirst and IsLast methods are as expected.
|
sl@0
|
70 |
// - Create TDblQue based object, insert links using AddFirst and AddLast, check
|
sl@0
|
71 |
// the results are as expected.
|
sl@0
|
72 |
// - Create TPriQueLink list without offset, with different offset, check the
|
sl@0
|
73 |
// construction is as expected.
|
sl@0
|
74 |
// - Create TPriQueLink list and insert many links at different specified location
|
sl@0
|
75 |
// and check it is added as specified.
|
sl@0
|
76 |
// - Create TPriQueLink link with different priorities, insert the elements in
|
sl@0
|
77 |
// priority order and check that they are added as expected.
|
sl@0
|
78 |
// - Create TPriQueLink list, check the double linked list for empty before
|
sl@0
|
79 |
// inserting, after inserting, before/after Deque, before/after Enque, after Reset.
|
sl@0
|
80 |
// Verify that results are as expected.
|
sl@0
|
81 |
// - Create TPriQueLink list with different offset, get the list offset and check it
|
sl@0
|
82 |
// is as expected.
|
sl@0
|
83 |
// - Create TPriQueLink list, insert many links with different priorities check it is
|
sl@0
|
84 |
// as expected.
|
sl@0
|
85 |
// - Create TDeltaQueLink list, add ,remove links and check the links and check
|
sl@0
|
86 |
// it is as expected.
|
sl@0
|
87 |
// - Create TDeltaQueLink list and insert many links at different specified location
|
sl@0
|
88 |
// and check it is added as specified.
|
sl@0
|
89 |
// - Create TDeltaQueLink list, check the double linked list for empty before, after
|
sl@0
|
90 |
// inserting, before Deque, after Enque, Reset method call is as expected.
|
sl@0
|
91 |
// - Create TDeltaQueLink list, insert links using DoAddDelta method,check that
|
sl@0
|
92 |
// links are as expected. Delete links using DoRemove and DoRemoveFirst methods
|
sl@0
|
93 |
// and check that links are as expected.
|
sl@0
|
94 |
// - Create TDeltaQueLink based object, insert links using DoAddDelta method,
|
sl@0
|
95 |
// check the return value of CountDown is as expected. Delete links using
|
sl@0
|
96 |
// DoRemoveFirst method and check the return value of CountDown is as expected.
|
sl@0
|
97 |
// - Create TDeltaQueLink list with different offset, get and check the offset is
|
sl@0
|
98 |
// as expected.
|
sl@0
|
99 |
// - Create TDeltaQueLink list, add, remove links at different specified location
|
sl@0
|
100 |
// and check it is added and removed successfully.
|
sl@0
|
101 |
// - Initialaize TDblQueIterBase based iterator, get the current item in the queue,
|
sl@0
|
102 |
// move the current position forward, backward, set the iterator to point to the
|
sl@0
|
103 |
// first element, last item and check it is as expected.
|
sl@0
|
104 |
// - Create TDblQueIterBase object with offset constructor, insert links at
|
sl@0
|
105 |
// specified locations and check it is added as specified.
|
sl@0
|
106 |
// - Create TDblQueIterBase object, iterate the list using operators, DoPostInc,
|
sl@0
|
107 |
// DoPostDec, DoCurrent and check it is as expected.
|
sl@0
|
108 |
// - Create TDblQue based link with specified offset, initialize TDblQueIter
|
sl@0
|
109 |
// based iterator, iterate the link and check the offset is as expected.
|
sl@0
|
110 |
// - Create TDblQueIter object with offset constructor, insert links at
|
sl@0
|
111 |
// specified locations and check it is added as specified.
|
sl@0
|
112 |
// - Create TDblQueIter object, iterate the list using operators, DoPostInc,
|
sl@0
|
113 |
// DoPostDec, DoCurrent and check it is as expected.
|
sl@0
|
114 |
// - Create TDblQueIter based object, insert links using AddFirst and SetToLast,
|
sl@0
|
115 |
// using IsHead, check the results are as expected.
|
sl@0
|
116 |
// Platforms/Drives/Compatibility:
|
sl@0
|
117 |
// All
|
sl@0
|
118 |
// Assumptions/Requirement/Pre-requisites:
|
sl@0
|
119 |
// Failures and causes:
|
sl@0
|
120 |
// Base Port information:
|
sl@0
|
121 |
//
|
sl@0
|
122 |
//
|
sl@0
|
123 |
|
sl@0
|
124 |
#include <e32test.h>
|
sl@0
|
125 |
|
sl@0
|
126 |
LOCAL_D RTest test(_L("T_QUE"));
|
sl@0
|
127 |
|
sl@0
|
128 |
#ifndef _DEBUG
|
sl@0
|
129 |
#pragma warning(disable : 4710) //fuction not expanded
|
sl@0
|
130 |
#endif
|
sl@0
|
131 |
|
sl@0
|
132 |
#define SIZE 10
|
sl@0
|
133 |
#define MAX_OFFSET 10
|
sl@0
|
134 |
|
sl@0
|
135 |
struct Item
|
sl@0
|
136 |
{
|
sl@0
|
137 |
TDblQueLink iLink;
|
sl@0
|
138 |
TInt iSpace[MAX_OFFSET]; // Reserve some space
|
sl@0
|
139 |
};
|
sl@0
|
140 |
|
sl@0
|
141 |
class CItem : public CBase
|
sl@0
|
142 |
{
|
sl@0
|
143 |
public:
|
sl@0
|
144 |
TDblQueLink iLink;
|
sl@0
|
145 |
//int iSpac[MAX_OFFSET]; // Reserve some space
|
sl@0
|
146 |
};
|
sl@0
|
147 |
|
sl@0
|
148 |
template<class T>
|
sl@0
|
149 |
class TestTQueLink
|
sl@0
|
150 |
{
|
sl@0
|
151 |
public:
|
sl@0
|
152 |
void TestQueLinkBase(); // Calls Test: 1.
|
sl@0
|
153 |
void TestQueLink(); // Calls Test: 1,2.
|
sl@0
|
154 |
void Test1(); // Test Enque
|
sl@0
|
155 |
void Test2(); // Test Deque
|
sl@0
|
156 |
protected:
|
sl@0
|
157 |
void CreateObjects(TInt aBaseLink);
|
sl@0
|
158 |
void DestroyObjects();
|
sl@0
|
159 |
private:
|
sl@0
|
160 |
void CallTest1();
|
sl@0
|
161 |
T* iLink[SIZE];
|
sl@0
|
162 |
};
|
sl@0
|
163 |
|
sl@0
|
164 |
template<class T>
|
sl@0
|
165 |
void TestTQueLink<T>::CallTest1()
|
sl@0
|
166 |
{
|
sl@0
|
167 |
test.Start(_L("Test Enque"));
|
sl@0
|
168 |
Test1();
|
sl@0
|
169 |
}
|
sl@0
|
170 |
|
sl@0
|
171 |
template<class T>
|
sl@0
|
172 |
void TestTQueLink<T>::CreateObjects(TInt aBaseLink)
|
sl@0
|
173 |
{
|
sl@0
|
174 |
TInt i;
|
sl@0
|
175 |
|
sl@0
|
176 |
for (i=0;i<SIZE;i++)
|
sl@0
|
177 |
iLink[i]=new T;
|
sl@0
|
178 |
if (aBaseLink>=0&&aBaseLink<SIZE)
|
sl@0
|
179 |
(iLink[aBaseLink])->iNext=(iLink[aBaseLink])->iPrev=iLink[aBaseLink];
|
sl@0
|
180 |
}
|
sl@0
|
181 |
|
sl@0
|
182 |
template<class T>
|
sl@0
|
183 |
void TestTQueLink<T>::DestroyObjects()
|
sl@0
|
184 |
{
|
sl@0
|
185 |
TInt i;
|
sl@0
|
186 |
|
sl@0
|
187 |
for (i=0;i<SIZE;i++)
|
sl@0
|
188 |
delete iLink[i];
|
sl@0
|
189 |
}
|
sl@0
|
190 |
|
sl@0
|
191 |
template<class T>
|
sl@0
|
192 |
void TestTQueLink<T>::TestQueLinkBase()
|
sl@0
|
193 |
{
|
sl@0
|
194 |
CallTest1();
|
sl@0
|
195 |
test.Next(_L("Finished"));
|
sl@0
|
196 |
test.End();
|
sl@0
|
197 |
}
|
sl@0
|
198 |
|
sl@0
|
199 |
template <class T>
|
sl@0
|
200 |
void TestTQueLink<T>::TestQueLink()
|
sl@0
|
201 |
{
|
sl@0
|
202 |
CallTest1();
|
sl@0
|
203 |
test.Next(_L("Text Deque"));
|
sl@0
|
204 |
Test2();
|
sl@0
|
205 |
test.Next(_L("Finished"));
|
sl@0
|
206 |
test.End();
|
sl@0
|
207 |
}
|
sl@0
|
208 |
|
sl@0
|
209 |
template<class T>
|
sl@0
|
210 |
void TestTQueLink<T>::Test1()
|
sl@0
|
211 |
{
|
sl@0
|
212 |
CreateObjects(1);
|
sl@0
|
213 |
test.Start(_L("Check Next and Prev pointers set corectly."));
|
sl@0
|
214 |
iLink[2]->Enque(iLink[1]);
|
sl@0
|
215 |
test(iLink[1]->iPrev==iLink[2]);
|
sl@0
|
216 |
test(iLink[1]->iNext==iLink[2]);
|
sl@0
|
217 |
test(iLink[2]->iPrev==iLink[1]);
|
sl@0
|
218 |
test(iLink[2]->iNext==iLink[1]);
|
sl@0
|
219 |
iLink[3]->Enque(iLink[2]);
|
sl@0
|
220 |
test(iLink[1]->iPrev==iLink[3]);
|
sl@0
|
221 |
test(iLink[1]->iNext==iLink[2]);
|
sl@0
|
222 |
test(iLink[2]->iPrev==iLink[1]);
|
sl@0
|
223 |
test(iLink[2]->iNext==iLink[3]);
|
sl@0
|
224 |
test(iLink[3]->iPrev==iLink[2]);
|
sl@0
|
225 |
test(iLink[3]->iNext==iLink[1]);
|
sl@0
|
226 |
iLink[4]->Enque(iLink[3]);
|
sl@0
|
227 |
test(iLink[1]->iPrev==iLink[4]);
|
sl@0
|
228 |
test(iLink[1]->iNext==iLink[2]);
|
sl@0
|
229 |
test(iLink[2]->iPrev==iLink[1]);
|
sl@0
|
230 |
test(iLink[2]->iNext==iLink[3]);
|
sl@0
|
231 |
test(iLink[3]->iPrev==iLink[2]);
|
sl@0
|
232 |
test(iLink[3]->iNext==iLink[4]);
|
sl@0
|
233 |
test(iLink[4]->iPrev==iLink[3]);
|
sl@0
|
234 |
test(iLink[4]->iNext==iLink[1]);
|
sl@0
|
235 |
iLink[5]->Enque(iLink[2]);
|
sl@0
|
236 |
test(iLink[1]->iPrev==iLink[4]);
|
sl@0
|
237 |
test(iLink[1]->iNext==iLink[2]);
|
sl@0
|
238 |
test(iLink[2]->iPrev==iLink[1]);
|
sl@0
|
239 |
test(iLink[2]->iNext==iLink[5]);
|
sl@0
|
240 |
test(iLink[5]->iPrev==iLink[2]);
|
sl@0
|
241 |
test(iLink[5]->iNext==iLink[3]);
|
sl@0
|
242 |
test(iLink[3]->iPrev==iLink[5]);
|
sl@0
|
243 |
test(iLink[3]->iNext==iLink[4]);
|
sl@0
|
244 |
test(iLink[4]->iPrev==iLink[3]);
|
sl@0
|
245 |
test(iLink[4]->iNext==iLink[1]);
|
sl@0
|
246 |
test.Next(_L("Finished"));
|
sl@0
|
247 |
DestroyObjects();
|
sl@0
|
248 |
test.End();
|
sl@0
|
249 |
}
|
sl@0
|
250 |
|
sl@0
|
251 |
template<class T>
|
sl@0
|
252 |
void TestTQueLink<T>::Test2()
|
sl@0
|
253 |
{
|
sl@0
|
254 |
CreateObjects(1);
|
sl@0
|
255 |
test.Start(_L("Check Next and Prev pointers set corectly"));
|
sl@0
|
256 |
iLink[2]->Enque(iLink[1]);
|
sl@0
|
257 |
iLink[3]->Enque(iLink[2]);
|
sl@0
|
258 |
iLink[4]->Enque(iLink[3]);
|
sl@0
|
259 |
iLink[5]->Enque(iLink[4]);
|
sl@0
|
260 |
iLink[5]->Deque();
|
sl@0
|
261 |
iLink[5]->Enque(iLink[2]);
|
sl@0
|
262 |
test(iLink[1]->iPrev==iLink[4]);
|
sl@0
|
263 |
test(iLink[1]->iNext==iLink[2]);
|
sl@0
|
264 |
test(iLink[2]->iPrev==iLink[1]);
|
sl@0
|
265 |
test(iLink[2]->iNext==iLink[5]);
|
sl@0
|
266 |
test(iLink[5]->iPrev==iLink[2]);
|
sl@0
|
267 |
test(iLink[5]->iNext==iLink[3]);
|
sl@0
|
268 |
test(iLink[3]->iPrev==iLink[5]);
|
sl@0
|
269 |
test(iLink[3]->iNext==iLink[4]);
|
sl@0
|
270 |
test(iLink[4]->iPrev==iLink[3]);
|
sl@0
|
271 |
test(iLink[4]->iNext==iLink[1]);
|
sl@0
|
272 |
iLink[3]->Deque();
|
sl@0
|
273 |
test(iLink[1]->iPrev==iLink[4]);
|
sl@0
|
274 |
test(iLink[1]->iNext==iLink[2]);
|
sl@0
|
275 |
test(iLink[2]->iPrev==iLink[1]);
|
sl@0
|
276 |
test(iLink[2]->iNext==iLink[5]);
|
sl@0
|
277 |
test(iLink[5]->iPrev==iLink[2]);
|
sl@0
|
278 |
test(iLink[5]->iNext==iLink[4]);
|
sl@0
|
279 |
test(iLink[4]->iPrev==iLink[5]);
|
sl@0
|
280 |
test(iLink[4]->iNext==iLink[1]);
|
sl@0
|
281 |
iLink[1]->Deque();
|
sl@0
|
282 |
test(iLink[2]->iPrev==iLink[4]);
|
sl@0
|
283 |
test(iLink[2]->iNext==iLink[5]);
|
sl@0
|
284 |
test(iLink[5]->iPrev==iLink[2]);
|
sl@0
|
285 |
test(iLink[5]->iNext==iLink[4]);
|
sl@0
|
286 |
test(iLink[4]->iPrev==iLink[5]);
|
sl@0
|
287 |
test(iLink[4]->iNext==iLink[2]);
|
sl@0
|
288 |
iLink[4]->Deque();
|
sl@0
|
289 |
test(iLink[2]->iPrev==iLink[5]);
|
sl@0
|
290 |
test(iLink[2]->iNext==iLink[5]);
|
sl@0
|
291 |
test(iLink[5]->iPrev==iLink[2]);
|
sl@0
|
292 |
test(iLink[5]->iNext==iLink[2]);
|
sl@0
|
293 |
test.Next(_L("Finished"));
|
sl@0
|
294 |
DestroyObjects();
|
sl@0
|
295 |
test.End();
|
sl@0
|
296 |
}
|
sl@0
|
297 |
|
sl@0
|
298 |
class VDblQueBase : public TDblQueBase
|
sl@0
|
299 |
{
|
sl@0
|
300 |
public:
|
sl@0
|
301 |
VDblQueBase();
|
sl@0
|
302 |
VDblQueBase(TInt anOffset);
|
sl@0
|
303 |
inline void sDoAddFirst(TAny* aPtr) {DoAddFirst(aPtr);}
|
sl@0
|
304 |
inline void sDoAddLast(TAny* aPtr) {DoAddLast(aPtr);}
|
sl@0
|
305 |
inline void sDoAddPriority(TAny* aPtr) {DoAddPriority(aPtr);}
|
sl@0
|
306 |
inline void sTestEmpty() const {__DbgTestEmpty();}
|
sl@0
|
307 |
TDblQueLink* sHead;
|
sl@0
|
308 |
TInt* sOffset;
|
sl@0
|
309 |
private:
|
sl@0
|
310 |
void SetMembers();
|
sl@0
|
311 |
};
|
sl@0
|
312 |
|
sl@0
|
313 |
class VDeltaQueBase : public TDeltaQueBase
|
sl@0
|
314 |
{
|
sl@0
|
315 |
public:
|
sl@0
|
316 |
VDeltaQueBase();
|
sl@0
|
317 |
VDeltaQueBase(TInt anOffset);
|
sl@0
|
318 |
inline void sDoAddDelta(TAny* aPtr,TInt aDelta) {DoAddDelta(aPtr,aDelta);} //From TDeltaQueBase
|
sl@0
|
319 |
inline void sDoRemove(TAny* aPtr) {this->DoRemove(aPtr);}
|
sl@0
|
320 |
inline TAny* sDoRemoveFirst() {return this->DoRemoveFirst();}
|
sl@0
|
321 |
TInt** sFirstDelta;
|
sl@0
|
322 |
inline void sDoAddFirst(TAny* aPtr) {DoAddFirst(aPtr);} //From TDblQueBase
|
sl@0
|
323 |
inline void sDoAddLast(TAny* aPtr) {DoAddLast(aPtr);}
|
sl@0
|
324 |
inline void sDoAddPriority(TAny* aPtr) {DoAddPriority(aPtr);}
|
sl@0
|
325 |
TDblQueLink* sHead;
|
sl@0
|
326 |
TInt* sOffset;
|
sl@0
|
327 |
private:
|
sl@0
|
328 |
void SetMembers();
|
sl@0
|
329 |
};
|
sl@0
|
330 |
|
sl@0
|
331 |
template <class T>
|
sl@0
|
332 |
class VDblQue : public TDblQue<T>
|
sl@0
|
333 |
{
|
sl@0
|
334 |
public:
|
sl@0
|
335 |
VDblQue();
|
sl@0
|
336 |
VDblQue(TInt anOffset);
|
sl@0
|
337 |
/*inline void sDoAddDelta(TAny* aPtr,TInt aDelta) {DoAddDelta(aPtr,aDelta);} //From TDeltaQueBase
|
sl@0
|
338 |
inline void sDoRemove(TAny* aPtr) {this->DoRemove(aPtr);}
|
sl@0
|
339 |
inline TAny* sDoRemoveFirst() {return this->DoRemoveFirst();}
|
sl@0
|
340 |
TInt** sFirstDelta;*/
|
sl@0
|
341 |
inline void sDoAddFirst(TAny* aPtr) {this->DoAddFirst(aPtr);} //From TDblQueBase
|
sl@0
|
342 |
inline void sDoAddLast(TAny* aPtr) {this->DoAddLast(aPtr);}
|
sl@0
|
343 |
inline void sDoAddPriority(TAny* aPtr) {this->DoAddPriority(aPtr);}
|
sl@0
|
344 |
TDblQueLink* sHead;
|
sl@0
|
345 |
TInt* sOffset;
|
sl@0
|
346 |
private:
|
sl@0
|
347 |
void SetMembers();
|
sl@0
|
348 |
};
|
sl@0
|
349 |
|
sl@0
|
350 |
template <class T>
|
sl@0
|
351 |
class VPriQue : public TPriQue<T>
|
sl@0
|
352 |
{
|
sl@0
|
353 |
public:
|
sl@0
|
354 |
VPriQue();
|
sl@0
|
355 |
VPriQue(TInt anOffset);
|
sl@0
|
356 |
/*inline void sDoAddDelta(TAny* aPtr,TInt aDelta) {DoAddDelta(aPtr,aDelta);} //From TDeltaQueBase
|
sl@0
|
357 |
inline void sDoRemove(TAny* aPtr) {this->DoRemove(aPtr);}
|
sl@0
|
358 |
inline TAny* sDoRemoveFirst() {return this->DoRemoveFirst();}
|
sl@0
|
359 |
TInt** sFirstDelta;*/
|
sl@0
|
360 |
inline void sDoAddFirst(TAny* aPtr) {this->DoAddFirst(aPtr);} //From TDblQueBase
|
sl@0
|
361 |
inline void sDoAddLast(TAny* aPtr) {this->DoAddLast(aPtr);}
|
sl@0
|
362 |
inline void sDoAddPriority(TAny* aPtr) {this->DoAddPriority(aPtr);}
|
sl@0
|
363 |
TDblQueLink* sHead;
|
sl@0
|
364 |
TInt* sOffset;
|
sl@0
|
365 |
private:
|
sl@0
|
366 |
void SetMembers();
|
sl@0
|
367 |
};
|
sl@0
|
368 |
|
sl@0
|
369 |
template <class T>
|
sl@0
|
370 |
class VDeltaQue : public TDeltaQue<T>
|
sl@0
|
371 |
{
|
sl@0
|
372 |
public:
|
sl@0
|
373 |
VDeltaQue();
|
sl@0
|
374 |
VDeltaQue(TInt anOffset);
|
sl@0
|
375 |
inline void sDoAddDelta(TAny* aPtr,TInt aDelta) {this->DoAddDelta(aPtr,aDelta);} //From TDeltaQueBase
|
sl@0
|
376 |
inline void sDoRemove(TAny* aPtr) {this->DoRemove(aPtr);}
|
sl@0
|
377 |
inline TAny* sDoRemoveFirst() {return this->DoRemoveFirst();}
|
sl@0
|
378 |
TInt** sFirstDelta;
|
sl@0
|
379 |
inline void sDoAddFirst(TAny* aPtr) {this->DoAddFirst(aPtr);} //From TDblQueBase
|
sl@0
|
380 |
inline void sDoAddLast(TAny* aPtr) {this->DoAddLast(aPtr);}
|
sl@0
|
381 |
inline void sDoAddPriority(TAny* aPtr) {this->DoAddPriority(aPtr);}
|
sl@0
|
382 |
TDblQueLink* sHead;
|
sl@0
|
383 |
TInt* sOffset;
|
sl@0
|
384 |
private:
|
sl@0
|
385 |
void SetMembers();
|
sl@0
|
386 |
};
|
sl@0
|
387 |
|
sl@0
|
388 |
VDblQueBase::VDblQueBase()
|
sl@0
|
389 |
{
|
sl@0
|
390 |
SetMembers();
|
sl@0
|
391 |
}
|
sl@0
|
392 |
|
sl@0
|
393 |
VDblQueBase::VDblQueBase(TInt anOffset)
|
sl@0
|
394 |
:TDblQueBase(anOffset)
|
sl@0
|
395 |
{
|
sl@0
|
396 |
SetMembers();
|
sl@0
|
397 |
}
|
sl@0
|
398 |
|
sl@0
|
399 |
void VDblQueBase::SetMembers()
|
sl@0
|
400 |
{
|
sl@0
|
401 |
sHead=&iHead;
|
sl@0
|
402 |
sOffset=&iOffset;
|
sl@0
|
403 |
}
|
sl@0
|
404 |
|
sl@0
|
405 |
VDeltaQueBase::VDeltaQueBase()
|
sl@0
|
406 |
{
|
sl@0
|
407 |
SetMembers();
|
sl@0
|
408 |
}
|
sl@0
|
409 |
|
sl@0
|
410 |
VDeltaQueBase::VDeltaQueBase(TInt anOffset)
|
sl@0
|
411 |
:TDeltaQueBase(anOffset)
|
sl@0
|
412 |
{
|
sl@0
|
413 |
SetMembers();
|
sl@0
|
414 |
}
|
sl@0
|
415 |
|
sl@0
|
416 |
void VDeltaQueBase::SetMembers()
|
sl@0
|
417 |
{
|
sl@0
|
418 |
sFirstDelta=&iFirstDelta;
|
sl@0
|
419 |
sHead=&iHead;
|
sl@0
|
420 |
sOffset=&iOffset;
|
sl@0
|
421 |
}
|
sl@0
|
422 |
|
sl@0
|
423 |
template <class T>
|
sl@0
|
424 |
VDblQue<T>::VDblQue()
|
sl@0
|
425 |
{
|
sl@0
|
426 |
SetMembers();
|
sl@0
|
427 |
}
|
sl@0
|
428 |
|
sl@0
|
429 |
template <class T>
|
sl@0
|
430 |
VDblQue<T>::VDblQue(TInt anOffset)
|
sl@0
|
431 |
:TDblQue<T>(anOffset)
|
sl@0
|
432 |
{
|
sl@0
|
433 |
SetMembers();
|
sl@0
|
434 |
}
|
sl@0
|
435 |
|
sl@0
|
436 |
template <class T>
|
sl@0
|
437 |
void VDblQue<T>::SetMembers()
|
sl@0
|
438 |
{
|
sl@0
|
439 |
//sFirstDelta=&iFirstDelta;
|
sl@0
|
440 |
sHead=&this->iHead;
|
sl@0
|
441 |
sOffset=&this->iOffset;
|
sl@0
|
442 |
}
|
sl@0
|
443 |
|
sl@0
|
444 |
template <class T>
|
sl@0
|
445 |
VPriQue<T>::VPriQue()
|
sl@0
|
446 |
{
|
sl@0
|
447 |
SetMembers();
|
sl@0
|
448 |
}
|
sl@0
|
449 |
|
sl@0
|
450 |
template <class T>
|
sl@0
|
451 |
VPriQue<T>::VPriQue(TInt anOffset)
|
sl@0
|
452 |
:TPriQue<T>(anOffset)
|
sl@0
|
453 |
{
|
sl@0
|
454 |
SetMembers();
|
sl@0
|
455 |
}
|
sl@0
|
456 |
|
sl@0
|
457 |
template <class T>
|
sl@0
|
458 |
void VPriQue<T>::SetMembers()
|
sl@0
|
459 |
{
|
sl@0
|
460 |
//sFirstDelta=&iFirstDelta;
|
sl@0
|
461 |
sHead=&this->iHead;
|
sl@0
|
462 |
sOffset=&this->iOffset;
|
sl@0
|
463 |
}
|
sl@0
|
464 |
|
sl@0
|
465 |
template <class T>
|
sl@0
|
466 |
VDeltaQue<T>::VDeltaQue()
|
sl@0
|
467 |
{
|
sl@0
|
468 |
SetMembers();
|
sl@0
|
469 |
}
|
sl@0
|
470 |
|
sl@0
|
471 |
template <class T>
|
sl@0
|
472 |
VDeltaQue<T>::VDeltaQue(TInt anOffset)
|
sl@0
|
473 |
:TDeltaQue<T>(anOffset)
|
sl@0
|
474 |
{
|
sl@0
|
475 |
SetMembers();
|
sl@0
|
476 |
}
|
sl@0
|
477 |
|
sl@0
|
478 |
template <class T>
|
sl@0
|
479 |
void VDeltaQue<T>::SetMembers()
|
sl@0
|
480 |
{
|
sl@0
|
481 |
sFirstDelta=&this->iFirstDelta;
|
sl@0
|
482 |
sHead=&this->iHead;
|
sl@0
|
483 |
sOffset=&this->iOffset;
|
sl@0
|
484 |
}
|
sl@0
|
485 |
|
sl@0
|
486 |
template<class T>
|
sl@0
|
487 |
class TestTQue
|
sl@0
|
488 |
{
|
sl@0
|
489 |
friend class TestTQueLink<TDblQueLinkBase>;
|
sl@0
|
490 |
public:
|
sl@0
|
491 |
void TestQueBase();
|
sl@0
|
492 |
void TestDeltaBase();
|
sl@0
|
493 |
void TestDblQue();
|
sl@0
|
494 |
void TestPriQue();
|
sl@0
|
495 |
void TestDeltaQue();
|
sl@0
|
496 |
void Test1(); // All functions //TDblQueBase functions
|
sl@0
|
497 |
void Test2(); // Constructors
|
sl@0
|
498 |
void Test3(TBool aTestPri); // DoAdd's
|
sl@0
|
499 |
void Test4(); // Public functions
|
sl@0
|
500 |
void Test5(); // All functions //TDblDeltaQueBase
|
sl@0
|
501 |
void Test6(); // Constructors
|
sl@0
|
502 |
void Test7(); // Do's
|
sl@0
|
503 |
void Test8(); // CountDown
|
sl@0
|
504 |
void Test9(); // All functions //TDblQueBase
|
sl@0
|
505 |
void Test10(); // Constructors
|
sl@0
|
506 |
void Test11(); // Add's
|
sl@0
|
507 |
void Test12(); // Is's
|
sl@0
|
508 |
void Test13(); // Get's
|
sl@0
|
509 |
void Test14(); // All functions //TPriQue
|
sl@0
|
510 |
void Test15(); // Constructors
|
sl@0
|
511 |
void Test16(); // Add
|
sl@0
|
512 |
void Test17(); // All functions //TDeltaQue
|
sl@0
|
513 |
void Test18(); // Constructors
|
sl@0
|
514 |
void Test19(); // Add/Remove
|
sl@0
|
515 |
private:
|
sl@0
|
516 |
void CallTest3_4(TBool aTestPri);
|
sl@0
|
517 |
void CallTest7_8();
|
sl@0
|
518 |
};
|
sl@0
|
519 |
|
sl@0
|
520 |
template<class T>
|
sl@0
|
521 |
void TestTQue<T>::CallTest3_4(TBool aTestPri)
|
sl@0
|
522 |
{
|
sl@0
|
523 |
test.Next(_L("Test DoAdd's"));
|
sl@0
|
524 |
Test3(aTestPri);
|
sl@0
|
525 |
test.Next(_L("Test public functions"));
|
sl@0
|
526 |
Test4();
|
sl@0
|
527 |
}
|
sl@0
|
528 |
|
sl@0
|
529 |
template<class T>
|
sl@0
|
530 |
void TestTQue<T>::CallTest7_8()
|
sl@0
|
531 |
{
|
sl@0
|
532 |
test.Next(_L("Test Do's"));
|
sl@0
|
533 |
Test7();
|
sl@0
|
534 |
test.Next(_L("CountDown"));
|
sl@0
|
535 |
Test8();
|
sl@0
|
536 |
}
|
sl@0
|
537 |
|
sl@0
|
538 |
template<class T>
|
sl@0
|
539 |
void TestTQue<T>::TestQueBase()
|
sl@0
|
540 |
{
|
sl@0
|
541 |
test.Start(_L("Test all member functions (simply)"));
|
sl@0
|
542 |
Test1();
|
sl@0
|
543 |
test.Next(_L("Test Constructors"));
|
sl@0
|
544 |
Test2();
|
sl@0
|
545 |
CallTest3_4(ETrue);
|
sl@0
|
546 |
test.Next(_L("Finished"));
|
sl@0
|
547 |
test.End();
|
sl@0
|
548 |
}
|
sl@0
|
549 |
|
sl@0
|
550 |
template<class T>
|
sl@0
|
551 |
void TestTQue<T>::TestDeltaBase()
|
sl@0
|
552 |
{
|
sl@0
|
553 |
test.Start(_L("Test all member functions (simply)"));
|
sl@0
|
554 |
Test5();
|
sl@0
|
555 |
CallTest3_4(EFalse);
|
sl@0
|
556 |
test.Next(_L("Test Constructors"));
|
sl@0
|
557 |
Test6();
|
sl@0
|
558 |
CallTest7_8();
|
sl@0
|
559 |
test.Next(_L("Finished"));
|
sl@0
|
560 |
test.End();
|
sl@0
|
561 |
}
|
sl@0
|
562 |
|
sl@0
|
563 |
template<class T>
|
sl@0
|
564 |
void TestTQue<T>::TestDblQue()
|
sl@0
|
565 |
{
|
sl@0
|
566 |
test.Start(_L("Test all member functions (simply)"));
|
sl@0
|
567 |
Test9();
|
sl@0
|
568 |
CallTest3_4(EFalse);
|
sl@0
|
569 |
test.Next(_L("Test Constructor"));
|
sl@0
|
570 |
Test10();
|
sl@0
|
571 |
test.Next(_L("Test Add's"));
|
sl@0
|
572 |
Test11();
|
sl@0
|
573 |
test.Next(_L("Test Is's"));
|
sl@0
|
574 |
Test12();
|
sl@0
|
575 |
test.Next(_L("Get's"));
|
sl@0
|
576 |
Test13();
|
sl@0
|
577 |
test.Next(_L("Finished"));
|
sl@0
|
578 |
test.End();
|
sl@0
|
579 |
}
|
sl@0
|
580 |
|
sl@0
|
581 |
template<class T>
|
sl@0
|
582 |
void TestTQue<T>::TestPriQue()
|
sl@0
|
583 |
{
|
sl@0
|
584 |
test.Start(_L("Test all member functions (simply)"));
|
sl@0
|
585 |
Test14();
|
sl@0
|
586 |
CallTest3_4(ETrue);
|
sl@0
|
587 |
test.Next(_L("Test Constructor"));
|
sl@0
|
588 |
Test15();
|
sl@0
|
589 |
test.Next(_L("Test Add"));
|
sl@0
|
590 |
Test16();
|
sl@0
|
591 |
test.Next(_L("Finished"));
|
sl@0
|
592 |
test.End();
|
sl@0
|
593 |
}
|
sl@0
|
594 |
|
sl@0
|
595 |
template<class T>
|
sl@0
|
596 |
void TestTQue<T>::TestDeltaQue()
|
sl@0
|
597 |
{
|
sl@0
|
598 |
test.Start(_L("Test all member functions (simply)"));
|
sl@0
|
599 |
Test17();
|
sl@0
|
600 |
CallTest3_4(EFalse);
|
sl@0
|
601 |
CallTest7_8();
|
sl@0
|
602 |
test.Next(_L("Test Constructor"));
|
sl@0
|
603 |
Test18();
|
sl@0
|
604 |
test.Next(_L("Test Add/Removes"));
|
sl@0
|
605 |
Test19();
|
sl@0
|
606 |
test.Next(_L("Finished"));
|
sl@0
|
607 |
test.End();
|
sl@0
|
608 |
}
|
sl@0
|
609 |
|
sl@0
|
610 |
template<class T>
|
sl@0
|
611 |
void TestTQue<T>::Test1()
|
sl@0
|
612 |
{
|
sl@0
|
613 |
T* que;
|
sl@0
|
614 |
TPriQueLink link1,link2;
|
sl@0
|
615 |
TInt offset=4;
|
sl@0
|
616 |
|
sl@0
|
617 |
test.Start(_L("Constructors"));
|
sl@0
|
618 |
que=new VDblQueBase(offset);
|
sl@0
|
619 |
delete que;
|
sl@0
|
620 |
que=new VDblQueBase;
|
sl@0
|
621 |
//delete que;
|
sl@0
|
622 |
test.Next(_L("DoAdd's"));
|
sl@0
|
623 |
que->sDoAddFirst(&link1);
|
sl@0
|
624 |
link1.Deque();
|
sl@0
|
625 |
que->sDoAddLast(&link1);
|
sl@0
|
626 |
link1.iPriority=1;
|
sl@0
|
627 |
link2.iPriority=2;
|
sl@0
|
628 |
que->sDoAddPriority(&link2);
|
sl@0
|
629 |
test.Next(_L("Public"));
|
sl@0
|
630 |
que->IsEmpty();
|
sl@0
|
631 |
que->SetOffset(offset);
|
sl@0
|
632 |
que->Reset();
|
sl@0
|
633 |
test.Next(_L("Finished"));
|
sl@0
|
634 |
delete que;
|
sl@0
|
635 |
test.End();
|
sl@0
|
636 |
}
|
sl@0
|
637 |
|
sl@0
|
638 |
template<class T>
|
sl@0
|
639 |
void TestTQue<T>::Test2()
|
sl@0
|
640 |
{
|
sl@0
|
641 |
T* que;
|
sl@0
|
642 |
TInt offset;
|
sl@0
|
643 |
|
sl@0
|
644 |
test.Start(_L("Default constructor"));
|
sl@0
|
645 |
que=new VDblQueBase();
|
sl@0
|
646 |
test(*(que->sOffset)==0);
|
sl@0
|
647 |
test(que->sHead->iNext==que->sHead);
|
sl@0
|
648 |
test(que->sHead->iPrev==que->sHead);
|
sl@0
|
649 |
delete que;
|
sl@0
|
650 |
test.Next(_L("Offset constructor"));
|
sl@0
|
651 |
for (offset=0;offset<40;offset+=4)
|
sl@0
|
652 |
{
|
sl@0
|
653 |
que=new VDblQueBase(offset);
|
sl@0
|
654 |
test(*(que->sOffset)==offset);
|
sl@0
|
655 |
test(que->sHead->iNext==que->sHead);
|
sl@0
|
656 |
test(que->sHead->iPrev==que->sHead);
|
sl@0
|
657 |
delete que;
|
sl@0
|
658 |
}
|
sl@0
|
659 |
test.Next(_L("Finished"));
|
sl@0
|
660 |
test.End();
|
sl@0
|
661 |
}
|
sl@0
|
662 |
|
sl@0
|
663 |
template<class T>
|
sl@0
|
664 |
void TestTQue<T>::Test3(TBool aTestPri)
|
sl@0
|
665 |
{
|
sl@0
|
666 |
T* que;
|
sl@0
|
667 |
TDblQueLink link1,link2,link3,link4;
|
sl@0
|
668 |
|
sl@0
|
669 |
test.Start(_L("AddFirst"));
|
sl@0
|
670 |
que=new T();
|
sl@0
|
671 |
que->sDoAddFirst(&link1);
|
sl@0
|
672 |
test(que->sHead->iNext==&link1);
|
sl@0
|
673 |
test(que->sHead->iPrev==&link1);
|
sl@0
|
674 |
test(link1.iNext==que->sHead);
|
sl@0
|
675 |
test(link1.iPrev==que->sHead);
|
sl@0
|
676 |
que->sDoAddFirst(&link2);
|
sl@0
|
677 |
test(que->sHead->iNext==&link2);
|
sl@0
|
678 |
test(que->sHead->iPrev==&link1);
|
sl@0
|
679 |
test(link1.iNext==que->sHead);
|
sl@0
|
680 |
test(link1.iPrev==&link2);
|
sl@0
|
681 |
test(link2.iNext==&link1);
|
sl@0
|
682 |
test(link2.iPrev==que->sHead);
|
sl@0
|
683 |
que->sDoAddFirst(&link3);
|
sl@0
|
684 |
test(que->sHead->iNext==&link3);
|
sl@0
|
685 |
test(que->sHead->iPrev==&link1);
|
sl@0
|
686 |
test(link1.iNext==que->sHead);
|
sl@0
|
687 |
test(link1.iPrev==&link2);
|
sl@0
|
688 |
test(link2.iNext==&link1);
|
sl@0
|
689 |
test(link2.iPrev==&link3);
|
sl@0
|
690 |
test(link3.iNext==&link2);
|
sl@0
|
691 |
test(link3.iPrev==que->sHead);
|
sl@0
|
692 |
que->sDoAddFirst(&link4);
|
sl@0
|
693 |
test(que->sHead->iNext==&link4);
|
sl@0
|
694 |
test(que->sHead->iPrev==&link1);
|
sl@0
|
695 |
test(link1.iNext==que->sHead);
|
sl@0
|
696 |
test(link1.iPrev==&link2);
|
sl@0
|
697 |
test(link2.iNext==&link1);
|
sl@0
|
698 |
test(link2.iPrev==&link3);
|
sl@0
|
699 |
test(link3.iNext==&link2);
|
sl@0
|
700 |
test(link3.iPrev==&link4);
|
sl@0
|
701 |
test(link4.iNext==&link3);
|
sl@0
|
702 |
test(link4.iPrev==que->sHead);
|
sl@0
|
703 |
link1.Deque();
|
sl@0
|
704 |
link2.Deque();
|
sl@0
|
705 |
link3.Deque();
|
sl@0
|
706 |
link4.Deque();
|
sl@0
|
707 |
delete que;
|
sl@0
|
708 |
test.Next(_L("AddLast"));
|
sl@0
|
709 |
que=new T();
|
sl@0
|
710 |
que->sDoAddLast(&link1);
|
sl@0
|
711 |
test(que->sHead->iNext==&link1);
|
sl@0
|
712 |
test(que->sHead->iPrev==&link1);
|
sl@0
|
713 |
test(link1.iNext==que->sHead);
|
sl@0
|
714 |
test(link1.iPrev==que->sHead);
|
sl@0
|
715 |
que->sDoAddLast(&link2);
|
sl@0
|
716 |
test(que->sHead->iNext==&link1);
|
sl@0
|
717 |
test(que->sHead->iPrev==&link2);
|
sl@0
|
718 |
test(link1.iNext==&link2);
|
sl@0
|
719 |
test(link1.iPrev==que->sHead);
|
sl@0
|
720 |
test(link2.iNext==que->sHead);
|
sl@0
|
721 |
test(link2.iPrev==&link1);
|
sl@0
|
722 |
que->sDoAddLast(&link3);
|
sl@0
|
723 |
test(que->sHead->iNext==&link1);
|
sl@0
|
724 |
test(que->sHead->iPrev==&link3);
|
sl@0
|
725 |
test(link1.iNext==&link2);
|
sl@0
|
726 |
test(link1.iPrev==que->sHead);
|
sl@0
|
727 |
test(link2.iNext==&link3);
|
sl@0
|
728 |
test(link2.iPrev==&link1);
|
sl@0
|
729 |
test(link3.iNext==que->sHead);
|
sl@0
|
730 |
test(link3.iPrev==&link2);
|
sl@0
|
731 |
que->sDoAddLast(&link4);
|
sl@0
|
732 |
test(que->sHead->iNext==&link1);
|
sl@0
|
733 |
test(que->sHead->iPrev==&link4);
|
sl@0
|
734 |
test(link1.iNext==&link2);
|
sl@0
|
735 |
test(link1.iPrev==que->sHead);
|
sl@0
|
736 |
test(link2.iNext==&link3);
|
sl@0
|
737 |
test(link2.iPrev==&link1);
|
sl@0
|
738 |
test(link3.iNext==&link4);
|
sl@0
|
739 |
test(link3.iPrev==&link2);
|
sl@0
|
740 |
test(link4.iNext==que->sHead);
|
sl@0
|
741 |
test(link4.iPrev==&link3);
|
sl@0
|
742 |
link1.Deque();
|
sl@0
|
743 |
link2.Deque();
|
sl@0
|
744 |
link3.Deque();
|
sl@0
|
745 |
link4.Deque();
|
sl@0
|
746 |
delete que;
|
sl@0
|
747 |
test.Next(_L("Combined AddFirst and AddLast"));
|
sl@0
|
748 |
que=new T();
|
sl@0
|
749 |
que->sDoAddFirst(&link1);
|
sl@0
|
750 |
que->sDoAddLast(&link2);
|
sl@0
|
751 |
test(que->sHead->iNext==&link1);
|
sl@0
|
752 |
test(que->sHead->iPrev==&link2);
|
sl@0
|
753 |
test(link1.iNext==&link2);
|
sl@0
|
754 |
test(link1.iPrev==que->sHead);
|
sl@0
|
755 |
test(link2.iNext==que->sHead);
|
sl@0
|
756 |
test(link2.iPrev==&link1);
|
sl@0
|
757 |
que->sDoAddFirst(&link3);
|
sl@0
|
758 |
test(que->sHead->iNext==&link3);
|
sl@0
|
759 |
test(que->sHead->iPrev==&link2);
|
sl@0
|
760 |
test(link1.iNext==&link2);
|
sl@0
|
761 |
test(link1.iPrev==&link3);
|
sl@0
|
762 |
test(link2.iNext==que->sHead);
|
sl@0
|
763 |
test(link2.iPrev==&link1);
|
sl@0
|
764 |
test(link3.iNext==&link1);
|
sl@0
|
765 |
test(link3.iPrev==que->sHead);
|
sl@0
|
766 |
que->sDoAddLast(&link4);
|
sl@0
|
767 |
test(que->sHead->iNext==&link3);
|
sl@0
|
768 |
test(que->sHead->iPrev==&link4);
|
sl@0
|
769 |
test(link1.iNext==&link2);
|
sl@0
|
770 |
test(link1.iPrev==&link3);
|
sl@0
|
771 |
test(link2.iNext==&link4);
|
sl@0
|
772 |
test(link2.iPrev==&link1);
|
sl@0
|
773 |
test(link3.iNext==&link1);
|
sl@0
|
774 |
test(link3.iPrev==que->sHead);
|
sl@0
|
775 |
test(link4.iNext==que->sHead);
|
sl@0
|
776 |
test(link4.iPrev==&link2);
|
sl@0
|
777 |
link1.Deque();
|
sl@0
|
778 |
link2.Deque();
|
sl@0
|
779 |
link3.Deque();
|
sl@0
|
780 |
link4.Deque();
|
sl@0
|
781 |
delete que;
|
sl@0
|
782 |
if (aTestPri)
|
sl@0
|
783 |
{
|
sl@0
|
784 |
TPriQueLink link5,link6,link7,link8,link9,link10;
|
sl@0
|
785 |
|
sl@0
|
786 |
test.Next(_L("AddPriority"));
|
sl@0
|
787 |
que=new T();
|
sl@0
|
788 |
link5.iPriority=4;
|
sl@0
|
789 |
link6.iPriority=6;
|
sl@0
|
790 |
link7.iPriority=8;
|
sl@0
|
791 |
que->sDoAddPriority(&link5);
|
sl@0
|
792 |
que->sDoAddPriority(&link6);
|
sl@0
|
793 |
que->sDoAddPriority(&link7);
|
sl@0
|
794 |
test(que->sHead->iNext==&link7);
|
sl@0
|
795 |
test(que->sHead->iPrev==&link5);
|
sl@0
|
796 |
test(link5.iNext==que->sHead);
|
sl@0
|
797 |
test(link5.iPrev==&link6);
|
sl@0
|
798 |
test(link6.iNext==&link5);
|
sl@0
|
799 |
test(link6.iPrev==&link7);
|
sl@0
|
800 |
test(link7.iNext==&link6);
|
sl@0
|
801 |
test(link7.iPrev==que->sHead);
|
sl@0
|
802 |
link8.iPriority=7;
|
sl@0
|
803 |
que->sDoAddPriority(&link8);
|
sl@0
|
804 |
test(que->sHead->iNext==&link7);
|
sl@0
|
805 |
test(que->sHead->iPrev==&link5);
|
sl@0
|
806 |
test(link5.iNext==que->sHead);
|
sl@0
|
807 |
test(link5.iPrev==&link6);
|
sl@0
|
808 |
test(link6.iNext==&link5);
|
sl@0
|
809 |
test(link6.iPrev==&link8);
|
sl@0
|
810 |
test(link7.iNext==&link8);
|
sl@0
|
811 |
test(link7.iPrev==que->sHead);
|
sl@0
|
812 |
test(link8.iPrev==&link7);
|
sl@0
|
813 |
test(link8.iNext==&link6);
|
sl@0
|
814 |
link9.iPriority=5;
|
sl@0
|
815 |
que->sDoAddPriority(&link9);
|
sl@0
|
816 |
test(que->sHead->iNext==&link7);
|
sl@0
|
817 |
test(que->sHead->iPrev==&link5);
|
sl@0
|
818 |
test(link5.iNext==que->sHead);
|
sl@0
|
819 |
test(link5.iPrev==&link9);
|
sl@0
|
820 |
test(link6.iNext==&link9);
|
sl@0
|
821 |
test(link6.iPrev==&link8);
|
sl@0
|
822 |
test(link7.iNext==&link8);
|
sl@0
|
823 |
test(link7.iPrev==que->sHead);
|
sl@0
|
824 |
test(link8.iPrev==&link7);
|
sl@0
|
825 |
test(link8.iNext==&link6);
|
sl@0
|
826 |
test(link9.iPrev==&link6);
|
sl@0
|
827 |
test(link9.iNext==&link5);
|
sl@0
|
828 |
link10.iPriority=3;
|
sl@0
|
829 |
que->sDoAddPriority(&link10);
|
sl@0
|
830 |
test(que->sHead->iNext==&link7);
|
sl@0
|
831 |
test(que->sHead->iPrev==&link10);
|
sl@0
|
832 |
test(link5.iNext==&link10);
|
sl@0
|
833 |
test(link5.iPrev==&link9);
|
sl@0
|
834 |
test(link6.iNext==&link9);
|
sl@0
|
835 |
test(link6.iPrev==&link8);
|
sl@0
|
836 |
test(link7.iNext==&link8);
|
sl@0
|
837 |
test(link7.iPrev==que->sHead);
|
sl@0
|
838 |
test(link8.iPrev==&link7);
|
sl@0
|
839 |
test(link8.iNext==&link6);
|
sl@0
|
840 |
test(link9.iPrev==&link6);
|
sl@0
|
841 |
test(link9.iNext==&link5);
|
sl@0
|
842 |
test(link10.iNext==que->sHead);
|
sl@0
|
843 |
test(link10.iPrev==&link5);
|
sl@0
|
844 |
link5.Deque();
|
sl@0
|
845 |
link6.Deque();
|
sl@0
|
846 |
link7.Deque();
|
sl@0
|
847 |
link8.Deque();
|
sl@0
|
848 |
delete que;
|
sl@0
|
849 |
}
|
sl@0
|
850 |
test.Next(_L("Finished"));
|
sl@0
|
851 |
test.End();
|
sl@0
|
852 |
}
|
sl@0
|
853 |
|
sl@0
|
854 |
template<class T>
|
sl@0
|
855 |
void TestTQue<T>::Test4()
|
sl@0
|
856 |
{
|
sl@0
|
857 |
T* que;
|
sl@0
|
858 |
TInt offset;
|
sl@0
|
859 |
|
sl@0
|
860 |
test.Start(_L("IsEmpty"));
|
sl@0
|
861 |
que=new T();
|
sl@0
|
862 |
test(que->IsEmpty()==TRUE);
|
sl@0
|
863 |
TDblQueLink link1,link2;
|
sl@0
|
864 |
que->sDoAddFirst(&link1);
|
sl@0
|
865 |
test(que->IsEmpty()==FALSE);
|
sl@0
|
866 |
link1.Deque();
|
sl@0
|
867 |
test(que->IsEmpty()==TRUE);
|
sl@0
|
868 |
que->sDoAddLast(&link2);
|
sl@0
|
869 |
test(que->IsEmpty()==FALSE);
|
sl@0
|
870 |
link1.Enque(&link2);
|
sl@0
|
871 |
test(que->IsEmpty()==FALSE);
|
sl@0
|
872 |
link2.Deque();
|
sl@0
|
873 |
test(que->IsEmpty()==FALSE);
|
sl@0
|
874 |
link1.Deque();
|
sl@0
|
875 |
test(que->IsEmpty()==TRUE);
|
sl@0
|
876 |
test.Next(_L("Reset"));
|
sl@0
|
877 |
que->sDoAddFirst(&link1);
|
sl@0
|
878 |
test(que->IsEmpty()==FALSE);
|
sl@0
|
879 |
que->Reset();
|
sl@0
|
880 |
test(que->IsEmpty()==TRUE);
|
sl@0
|
881 |
test.Next(_L("SetOffset"));
|
sl@0
|
882 |
for (offset=0;offset<40;offset+=4)
|
sl@0
|
883 |
{
|
sl@0
|
884 |
que->SetOffset(offset);
|
sl@0
|
885 |
test(*(que->sOffset)==offset);
|
sl@0
|
886 |
}
|
sl@0
|
887 |
test.Next(_L("Finished"));
|
sl@0
|
888 |
delete que;
|
sl@0
|
889 |
test.End();
|
sl@0
|
890 |
}
|
sl@0
|
891 |
|
sl@0
|
892 |
template<class T>
|
sl@0
|
893 |
void TestTQue<T>::Test5()
|
sl@0
|
894 |
{
|
sl@0
|
895 |
T* que;
|
sl@0
|
896 |
TDeltaQueLink link1,link2,link3;
|
sl@0
|
897 |
TInt offset=4;
|
sl@0
|
898 |
|
sl@0
|
899 |
test.Start(_L("Constructors"));
|
sl@0
|
900 |
que=new VDeltaQueBase(offset);
|
sl@0
|
901 |
delete que;
|
sl@0
|
902 |
que=new VDeltaQueBase;
|
sl@0
|
903 |
test.Next(_L("Do's"));
|
sl@0
|
904 |
que->sDoAddDelta(&link1,3);
|
sl@0
|
905 |
que->sDoAddDelta(&link2,2);
|
sl@0
|
906 |
que->sDoAddDelta(&link3,0);
|
sl@0
|
907 |
que->sDoRemoveFirst();
|
sl@0
|
908 |
que->sDoRemove(&link2);
|
sl@0
|
909 |
test.Next(_L("CountDown"));
|
sl@0
|
910 |
que->CountDown();
|
sl@0
|
911 |
test.Next(_L("Finished"));
|
sl@0
|
912 |
delete que;
|
sl@0
|
913 |
test.End();
|
sl@0
|
914 |
}
|
sl@0
|
915 |
|
sl@0
|
916 |
template<class T>
|
sl@0
|
917 |
void TestTQue<T>::Test6()
|
sl@0
|
918 |
{
|
sl@0
|
919 |
T* que;
|
sl@0
|
920 |
TInt offset;
|
sl@0
|
921 |
|
sl@0
|
922 |
test.Start(_L("Default constructor"));
|
sl@0
|
923 |
que=new VDeltaQueBase();
|
sl@0
|
924 |
test(*(que->sFirstDelta)==NULL);
|
sl@0
|
925 |
delete que;
|
sl@0
|
926 |
test.Next(_L("Offset constructor"));
|
sl@0
|
927 |
for (offset=0;offset<40;offset+=4)
|
sl@0
|
928 |
{
|
sl@0
|
929 |
que=new VDeltaQueBase(offset);
|
sl@0
|
930 |
test(*(que->sOffset)==offset);
|
sl@0
|
931 |
test(*(que->sFirstDelta)==NULL);
|
sl@0
|
932 |
delete que;
|
sl@0
|
933 |
}
|
sl@0
|
934 |
test.Next(_L("Finished"));
|
sl@0
|
935 |
test.End();
|
sl@0
|
936 |
}
|
sl@0
|
937 |
|
sl@0
|
938 |
template<class T>
|
sl@0
|
939 |
void TestTQue<T>::Test7()
|
sl@0
|
940 |
{
|
sl@0
|
941 |
T* que;
|
sl@0
|
942 |
TDeltaQueLink link1,link2,link3,link4,link5,link6;
|
sl@0
|
943 |
|
sl@0
|
944 |
test.Start(_L("DoAddDelta"));
|
sl@0
|
945 |
que=new T();
|
sl@0
|
946 |
que->sDoAddDelta(&link2,3);
|
sl@0
|
947 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
948 |
test(link2.iDelta==3);
|
sl@0
|
949 |
que->sDoAddDelta(&link5,15);
|
sl@0
|
950 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
951 |
test(link2.iDelta==3);
|
sl@0
|
952 |
test(link5.iDelta==12);
|
sl@0
|
953 |
que->sDoAddDelta(&link3,6);
|
sl@0
|
954 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
955 |
test(link2.iDelta==3);
|
sl@0
|
956 |
test(link3.iDelta==3);
|
sl@0
|
957 |
test(link5.iDelta==9);
|
sl@0
|
958 |
que->sDoAddDelta(&link4,10);
|
sl@0
|
959 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
960 |
test(link2.iDelta==3);
|
sl@0
|
961 |
test(link3.iDelta==3);
|
sl@0
|
962 |
test(link4.iDelta==4);
|
sl@0
|
963 |
test(link5.iDelta==5);
|
sl@0
|
964 |
que->sDoAddDelta(&link1,1);
|
sl@0
|
965 |
test(*(que->sFirstDelta)==&link1.iDelta);
|
sl@0
|
966 |
test(link1.iDelta==1);
|
sl@0
|
967 |
test(link2.iDelta==2);
|
sl@0
|
968 |
test(link3.iDelta==3);
|
sl@0
|
969 |
test(link4.iDelta==4);
|
sl@0
|
970 |
test(link5.iDelta==5);
|
sl@0
|
971 |
que->sDoAddDelta(&link6,21);
|
sl@0
|
972 |
test(*(que->sFirstDelta)==&link1.iDelta);
|
sl@0
|
973 |
test(link1.iDelta==1);
|
sl@0
|
974 |
test(link2.iDelta==2);
|
sl@0
|
975 |
test(link3.iDelta==3);
|
sl@0
|
976 |
test(link4.iDelta==4);
|
sl@0
|
977 |
test(link5.iDelta==5);
|
sl@0
|
978 |
test(link6.iDelta==6);
|
sl@0
|
979 |
test.Next(_L("DoRemove"));
|
sl@0
|
980 |
que->sDoRemove(&link6);
|
sl@0
|
981 |
test(*(que->sFirstDelta)==&link1.iDelta);
|
sl@0
|
982 |
test(link1.iDelta==1);
|
sl@0
|
983 |
test(link2.iDelta==2);
|
sl@0
|
984 |
test(link3.iDelta==3);
|
sl@0
|
985 |
test(link4.iDelta==4);
|
sl@0
|
986 |
test(link5.iDelta==5);
|
sl@0
|
987 |
que->sDoRemove(&link1);
|
sl@0
|
988 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
989 |
test(link2.iDelta==3);
|
sl@0
|
990 |
test(link3.iDelta==3);
|
sl@0
|
991 |
test(link4.iDelta==4);
|
sl@0
|
992 |
test(link5.iDelta==5);
|
sl@0
|
993 |
que->sDoRemove(&link4);
|
sl@0
|
994 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
995 |
test(link2.iDelta==3);
|
sl@0
|
996 |
test(link3.iDelta==3);
|
sl@0
|
997 |
test(link5.iDelta==9);
|
sl@0
|
998 |
que->sDoRemove(&link3);
|
sl@0
|
999 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
1000 |
test(link2.iDelta==3);
|
sl@0
|
1001 |
test(link5.iDelta==12);
|
sl@0
|
1002 |
que->sDoRemove(&link5);
|
sl@0
|
1003 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
1004 |
test(link2.iDelta==3);
|
sl@0
|
1005 |
test.Next(_L("DoRemoveFirst"));
|
sl@0
|
1006 |
test(NULL==que->sDoRemoveFirst());
|
sl@0
|
1007 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
1008 |
test(link2.iDelta==3);
|
sl@0
|
1009 |
link2.iDelta=1;
|
sl@0
|
1010 |
test(NULL==que->sDoRemoveFirst());
|
sl@0
|
1011 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
1012 |
test(link2.iDelta==1);
|
sl@0
|
1013 |
link2.iDelta=0;
|
sl@0
|
1014 |
test(&link2==que->sDoRemoveFirst());
|
sl@0
|
1015 |
delete que;
|
sl@0
|
1016 |
test.Next(_L("Finished"));
|
sl@0
|
1017 |
test.End();
|
sl@0
|
1018 |
}
|
sl@0
|
1019 |
|
sl@0
|
1020 |
template<class T>
|
sl@0
|
1021 |
void TestTQue<T>::Test8()
|
sl@0
|
1022 |
{
|
sl@0
|
1023 |
T* que;
|
sl@0
|
1024 |
TDeltaQueLink link1,link2,link3;
|
sl@0
|
1025 |
|
sl@0
|
1026 |
que=new T();
|
sl@0
|
1027 |
que->sDoAddDelta(&link1,1);
|
sl@0
|
1028 |
que->sDoAddDelta(&link2,3);
|
sl@0
|
1029 |
que->sDoAddDelta(&link3,6);
|
sl@0
|
1030 |
test(que->CountDown()==TRUE);
|
sl@0
|
1031 |
que->sDoRemoveFirst();
|
sl@0
|
1032 |
test(que->CountDown()==FALSE);
|
sl@0
|
1033 |
test(que->CountDown()==TRUE);
|
sl@0
|
1034 |
que->sDoRemoveFirst();
|
sl@0
|
1035 |
test(que->CountDown()==FALSE);
|
sl@0
|
1036 |
test(que->CountDown()==FALSE);
|
sl@0
|
1037 |
test(que->CountDown()==TRUE);
|
sl@0
|
1038 |
que->sDoRemoveFirst();
|
sl@0
|
1039 |
delete que;
|
sl@0
|
1040 |
}
|
sl@0
|
1041 |
|
sl@0
|
1042 |
template<class T>
|
sl@0
|
1043 |
void TestTQue<T>::Test9()
|
sl@0
|
1044 |
{
|
sl@0
|
1045 |
T* que;
|
sl@0
|
1046 |
TDblQueLink link1,link2;
|
sl@0
|
1047 |
TInt offset=4;
|
sl@0
|
1048 |
|
sl@0
|
1049 |
test.Start(_L("Constructors"));
|
sl@0
|
1050 |
que=new VDblQue<TDblQueLink>(offset);
|
sl@0
|
1051 |
delete que;
|
sl@0
|
1052 |
que=new VDblQue<TDblQueLink>;
|
sl@0
|
1053 |
test.Next(_L("Add's"));
|
sl@0
|
1054 |
que->AddFirst(link1);
|
sl@0
|
1055 |
que->AddLast(link2);
|
sl@0
|
1056 |
test.Next(_L("Is's"));
|
sl@0
|
1057 |
que->IsHead(que->sHead);
|
sl@0
|
1058 |
que->IsFirst(&link1);
|
sl@0
|
1059 |
que->IsLast(&link2);
|
sl@0
|
1060 |
test.Next(_L("Get's"));
|
sl@0
|
1061 |
que->First();
|
sl@0
|
1062 |
que->Last();
|
sl@0
|
1063 |
test.Next(_L("Finished"));
|
sl@0
|
1064 |
delete que;
|
sl@0
|
1065 |
test.End();
|
sl@0
|
1066 |
}
|
sl@0
|
1067 |
|
sl@0
|
1068 |
template<class T>
|
sl@0
|
1069 |
void TestTQue<T>::Test10()
|
sl@0
|
1070 |
{
|
sl@0
|
1071 |
T* que;
|
sl@0
|
1072 |
TInt offset;
|
sl@0
|
1073 |
|
sl@0
|
1074 |
test.Start(_L("Offset constructor"));
|
sl@0
|
1075 |
for (offset=0;offset<40;offset+=4)
|
sl@0
|
1076 |
{
|
sl@0
|
1077 |
que=new VDblQue<TDblQueLink>(offset);
|
sl@0
|
1078 |
test(*(que->sOffset)==offset);
|
sl@0
|
1079 |
delete que;
|
sl@0
|
1080 |
}
|
sl@0
|
1081 |
test.Next(_L("Finished"));
|
sl@0
|
1082 |
test.End();
|
sl@0
|
1083 |
}
|
sl@0
|
1084 |
|
sl@0
|
1085 |
template<class T>
|
sl@0
|
1086 |
void TestTQue<T>::Test11()
|
sl@0
|
1087 |
{
|
sl@0
|
1088 |
T* que;
|
sl@0
|
1089 |
TDblQueLink link1,link2,link3,link4;
|
sl@0
|
1090 |
|
sl@0
|
1091 |
test.Start(_L("AddFirst"));
|
sl@0
|
1092 |
que=new T();
|
sl@0
|
1093 |
que->AddFirst(link1);
|
sl@0
|
1094 |
test(que->sHead->iNext==&link1);
|
sl@0
|
1095 |
test(que->sHead->iPrev==&link1);
|
sl@0
|
1096 |
test(link1.iNext==que->sHead);
|
sl@0
|
1097 |
test(link1.iPrev==que->sHead);
|
sl@0
|
1098 |
que->AddFirst(link2);
|
sl@0
|
1099 |
test(que->sHead->iNext==&link2);
|
sl@0
|
1100 |
test(que->sHead->iPrev==&link1);
|
sl@0
|
1101 |
test(link1.iNext==que->sHead);
|
sl@0
|
1102 |
test(link1.iPrev==&link2);
|
sl@0
|
1103 |
test(link2.iNext==&link1);
|
sl@0
|
1104 |
test(link2.iPrev==que->sHead);
|
sl@0
|
1105 |
que->AddFirst(link3);
|
sl@0
|
1106 |
test(que->sHead->iNext==&link3);
|
sl@0
|
1107 |
test(que->sHead->iPrev==&link1);
|
sl@0
|
1108 |
test(link1.iNext==que->sHead);
|
sl@0
|
1109 |
test(link1.iPrev==&link2);
|
sl@0
|
1110 |
test(link2.iNext==&link1);
|
sl@0
|
1111 |
test(link2.iPrev==&link3);
|
sl@0
|
1112 |
test(link3.iNext==&link2);
|
sl@0
|
1113 |
test(link3.iPrev==que->sHead);
|
sl@0
|
1114 |
que->AddFirst(link4);
|
sl@0
|
1115 |
test(que->sHead->iNext==&link4);
|
sl@0
|
1116 |
test(que->sHead->iPrev==&link1);
|
sl@0
|
1117 |
test(link1.iNext==que->sHead);
|
sl@0
|
1118 |
test(link1.iPrev==&link2);
|
sl@0
|
1119 |
test(link2.iNext==&link1);
|
sl@0
|
1120 |
test(link2.iPrev==&link3);
|
sl@0
|
1121 |
test(link3.iNext==&link2);
|
sl@0
|
1122 |
test(link3.iPrev==&link4);
|
sl@0
|
1123 |
test(link4.iNext==&link3);
|
sl@0
|
1124 |
test(link4.iPrev==que->sHead);
|
sl@0
|
1125 |
link1.Deque();
|
sl@0
|
1126 |
link2.Deque();
|
sl@0
|
1127 |
link3.Deque();
|
sl@0
|
1128 |
link4.Deque();
|
sl@0
|
1129 |
delete que;
|
sl@0
|
1130 |
test.Next(_L("AddLast"));
|
sl@0
|
1131 |
que=new T();
|
sl@0
|
1132 |
que->AddLast(link1);
|
sl@0
|
1133 |
test(que->sHead->iNext==&link1);
|
sl@0
|
1134 |
test(que->sHead->iPrev==&link1);
|
sl@0
|
1135 |
test(link1.iNext==que->sHead);
|
sl@0
|
1136 |
test(link1.iPrev==que->sHead);
|
sl@0
|
1137 |
que->AddLast(link2);
|
sl@0
|
1138 |
test(que->sHead->iNext==&link1);
|
sl@0
|
1139 |
test(que->sHead->iPrev==&link2);
|
sl@0
|
1140 |
test(link1.iNext==&link2);
|
sl@0
|
1141 |
test(link1.iPrev==que->sHead);
|
sl@0
|
1142 |
test(link2.iNext==que->sHead);
|
sl@0
|
1143 |
test(link2.iPrev==&link1);
|
sl@0
|
1144 |
que->AddLast(link3);
|
sl@0
|
1145 |
test(que->sHead->iNext==&link1);
|
sl@0
|
1146 |
test(que->sHead->iPrev==&link3);
|
sl@0
|
1147 |
test(link1.iNext==&link2);
|
sl@0
|
1148 |
test(link1.iPrev==que->sHead);
|
sl@0
|
1149 |
test(link2.iNext==&link3);
|
sl@0
|
1150 |
test(link2.iPrev==&link1);
|
sl@0
|
1151 |
test(link3.iNext==que->sHead);
|
sl@0
|
1152 |
test(link3.iPrev==&link2);
|
sl@0
|
1153 |
que->AddLast(link4);
|
sl@0
|
1154 |
test(que->sHead->iNext==&link1);
|
sl@0
|
1155 |
test(que->sHead->iPrev==&link4);
|
sl@0
|
1156 |
test(link1.iNext==&link2);
|
sl@0
|
1157 |
test(link1.iPrev==que->sHead);
|
sl@0
|
1158 |
test(link2.iNext==&link3);
|
sl@0
|
1159 |
test(link2.iPrev==&link1);
|
sl@0
|
1160 |
test(link3.iNext==&link4);
|
sl@0
|
1161 |
test(link3.iPrev==&link2);
|
sl@0
|
1162 |
test(link4.iNext==que->sHead);
|
sl@0
|
1163 |
test(link4.iPrev==&link3);
|
sl@0
|
1164 |
link1.Deque();
|
sl@0
|
1165 |
link2.Deque();
|
sl@0
|
1166 |
link3.Deque();
|
sl@0
|
1167 |
link4.Deque();
|
sl@0
|
1168 |
delete que;
|
sl@0
|
1169 |
test.Next(_L("Combined AddFirst and AddLast"));
|
sl@0
|
1170 |
que=new T();
|
sl@0
|
1171 |
que->AddFirst(link1);
|
sl@0
|
1172 |
que->AddLast(link2);
|
sl@0
|
1173 |
test(que->sHead->iNext==&link1);
|
sl@0
|
1174 |
test(que->sHead->iPrev==&link2);
|
sl@0
|
1175 |
test(link1.iNext==&link2);
|
sl@0
|
1176 |
test(link1.iPrev==que->sHead);
|
sl@0
|
1177 |
test(link2.iNext==que->sHead);
|
sl@0
|
1178 |
test(link2.iPrev==&link1);
|
sl@0
|
1179 |
que->AddFirst(link3);
|
sl@0
|
1180 |
test(que->sHead->iNext==&link3);
|
sl@0
|
1181 |
test(que->sHead->iPrev==&link2);
|
sl@0
|
1182 |
test(link1.iNext==&link2);
|
sl@0
|
1183 |
test(link1.iPrev==&link3);
|
sl@0
|
1184 |
test(link2.iNext==que->sHead);
|
sl@0
|
1185 |
test(link2.iPrev==&link1);
|
sl@0
|
1186 |
test(link3.iNext==&link1);
|
sl@0
|
1187 |
test(link3.iPrev==que->sHead);
|
sl@0
|
1188 |
que->AddLast(link4);
|
sl@0
|
1189 |
test(que->sHead->iNext==&link3);
|
sl@0
|
1190 |
test(que->sHead->iPrev==&link4);
|
sl@0
|
1191 |
test(link1.iNext==&link2);
|
sl@0
|
1192 |
test(link1.iPrev==&link3);
|
sl@0
|
1193 |
test(link2.iNext==&link4);
|
sl@0
|
1194 |
test(link2.iPrev==&link1);
|
sl@0
|
1195 |
test(link3.iNext==&link1);
|
sl@0
|
1196 |
test(link3.iPrev==que->sHead);
|
sl@0
|
1197 |
test(link4.iNext==que->sHead);
|
sl@0
|
1198 |
test(link4.iPrev==&link2);
|
sl@0
|
1199 |
link1.Deque();
|
sl@0
|
1200 |
link2.Deque();
|
sl@0
|
1201 |
link3.Deque();
|
sl@0
|
1202 |
link4.Deque();
|
sl@0
|
1203 |
delete que;
|
sl@0
|
1204 |
test.Next(_L("Finished"));
|
sl@0
|
1205 |
test.End();
|
sl@0
|
1206 |
}
|
sl@0
|
1207 |
|
sl@0
|
1208 |
template<class T>
|
sl@0
|
1209 |
void TestTQue<T>::Test12()
|
sl@0
|
1210 |
{
|
sl@0
|
1211 |
T* que;
|
sl@0
|
1212 |
TDblQueLink link1,link2,link3,link4,*head;
|
sl@0
|
1213 |
|
sl@0
|
1214 |
que=new T();
|
sl@0
|
1215 |
que->AddFirst(link1);
|
sl@0
|
1216 |
que->AddLast(link2);
|
sl@0
|
1217 |
que->AddLast(link3);
|
sl@0
|
1218 |
que->AddLast(link4);
|
sl@0
|
1219 |
head=que->sHead;
|
sl@0
|
1220 |
test.Start(_L("IsHead"));
|
sl@0
|
1221 |
test(que->IsHead(head)==TRUE);
|
sl@0
|
1222 |
test(que->IsHead(&link1)==FALSE);
|
sl@0
|
1223 |
test(que->IsHead(&link2)==FALSE);
|
sl@0
|
1224 |
test(que->IsHead(&link3)==FALSE);
|
sl@0
|
1225 |
test(que->IsHead(&link4)==FALSE);
|
sl@0
|
1226 |
test.Next(_L("IsFirst"));
|
sl@0
|
1227 |
test(que->IsFirst(head)==FALSE);
|
sl@0
|
1228 |
test(que->IsFirst(&link1)==TRUE);
|
sl@0
|
1229 |
test(que->IsFirst(&link2)==FALSE);
|
sl@0
|
1230 |
test(que->IsFirst(&link3)==FALSE);
|
sl@0
|
1231 |
test(que->IsFirst(&link4)==FALSE);
|
sl@0
|
1232 |
test.Next(_L("IsLast"));
|
sl@0
|
1233 |
test(que->IsLast(head)==FALSE);
|
sl@0
|
1234 |
test(que->IsLast(&link1)==FALSE);
|
sl@0
|
1235 |
test(que->IsLast(&link2)==FALSE);
|
sl@0
|
1236 |
test(que->IsLast(&link3)==FALSE);
|
sl@0
|
1237 |
test(que->IsLast(&link4)==TRUE);
|
sl@0
|
1238 |
delete que;
|
sl@0
|
1239 |
test.Next(_L("Finished"));
|
sl@0
|
1240 |
test.End();
|
sl@0
|
1241 |
}
|
sl@0
|
1242 |
|
sl@0
|
1243 |
template<class T>
|
sl@0
|
1244 |
void TestTQue<T>::Test13()
|
sl@0
|
1245 |
{
|
sl@0
|
1246 |
T* que;
|
sl@0
|
1247 |
TDblQueLink link1,link2,link3,link4;
|
sl@0
|
1248 |
|
sl@0
|
1249 |
test.Start(_L("First"));
|
sl@0
|
1250 |
que=new T();
|
sl@0
|
1251 |
que->AddFirst(link1);
|
sl@0
|
1252 |
test(que->First()==&link1);
|
sl@0
|
1253 |
que->AddFirst(link2);
|
sl@0
|
1254 |
test(que->First()==&link2);
|
sl@0
|
1255 |
que->AddFirst(link3);
|
sl@0
|
1256 |
test(que->First()==&link3);
|
sl@0
|
1257 |
que->AddFirst(link4);
|
sl@0
|
1258 |
test(que->First()==&link4);
|
sl@0
|
1259 |
link1.Deque();
|
sl@0
|
1260 |
link2.Deque();
|
sl@0
|
1261 |
link3.Deque();
|
sl@0
|
1262 |
link4.Deque();
|
sl@0
|
1263 |
delete que;
|
sl@0
|
1264 |
test.Next(_L("Last"));
|
sl@0
|
1265 |
que=new T();
|
sl@0
|
1266 |
que->AddLast(link1);
|
sl@0
|
1267 |
test(que->Last()==&link1);
|
sl@0
|
1268 |
que->AddLast(link2);
|
sl@0
|
1269 |
test(que->Last()==&link2);
|
sl@0
|
1270 |
que->AddLast(link3);
|
sl@0
|
1271 |
test(que->Last()==&link3);
|
sl@0
|
1272 |
que->AddLast(link4);
|
sl@0
|
1273 |
test(que->Last()==&link4);
|
sl@0
|
1274 |
link1.Deque();
|
sl@0
|
1275 |
link2.Deque();
|
sl@0
|
1276 |
link3.Deque();
|
sl@0
|
1277 |
link4.Deque();
|
sl@0
|
1278 |
delete que;
|
sl@0
|
1279 |
test.Next(_L("Finished"));
|
sl@0
|
1280 |
test.End();
|
sl@0
|
1281 |
}
|
sl@0
|
1282 |
|
sl@0
|
1283 |
template<class T>
|
sl@0
|
1284 |
void TestTQue<T>::Test14()
|
sl@0
|
1285 |
{
|
sl@0
|
1286 |
T* que;
|
sl@0
|
1287 |
TPriQueLink link;
|
sl@0
|
1288 |
TInt offset=4;
|
sl@0
|
1289 |
|
sl@0
|
1290 |
test.Start(_L("Constructors"));
|
sl@0
|
1291 |
que=new VPriQue<TPriQueLink>(offset);
|
sl@0
|
1292 |
delete que;
|
sl@0
|
1293 |
que=new VPriQue<TPriQueLink>;
|
sl@0
|
1294 |
test.Next(_L("Add"));
|
sl@0
|
1295 |
que->Add(link);
|
sl@0
|
1296 |
test.Next(_L("Finished"));
|
sl@0
|
1297 |
delete que;
|
sl@0
|
1298 |
test.End();
|
sl@0
|
1299 |
}
|
sl@0
|
1300 |
|
sl@0
|
1301 |
template<class T>
|
sl@0
|
1302 |
void TestTQue<T>::Test15()
|
sl@0
|
1303 |
{
|
sl@0
|
1304 |
T* que;
|
sl@0
|
1305 |
TInt offset;
|
sl@0
|
1306 |
|
sl@0
|
1307 |
test.Start(_L("Offset constructor"));
|
sl@0
|
1308 |
for (offset=0;offset<40;offset+=4)
|
sl@0
|
1309 |
{
|
sl@0
|
1310 |
que=new VPriQue<TPriQueLink>(offset);
|
sl@0
|
1311 |
test(*(que->sOffset)==offset);
|
sl@0
|
1312 |
delete que;
|
sl@0
|
1313 |
}
|
sl@0
|
1314 |
test.Next(_L("Finished"));
|
sl@0
|
1315 |
test.End();
|
sl@0
|
1316 |
}
|
sl@0
|
1317 |
|
sl@0
|
1318 |
template<class T>
|
sl@0
|
1319 |
void TestTQue<T>::Test16()
|
sl@0
|
1320 |
{
|
sl@0
|
1321 |
T* que;
|
sl@0
|
1322 |
TPriQueLink link1,link2,link3,link4,link5,link6;
|
sl@0
|
1323 |
|
sl@0
|
1324 |
que=new T();
|
sl@0
|
1325 |
link1.iPriority=4;
|
sl@0
|
1326 |
link2.iPriority=6;
|
sl@0
|
1327 |
link3.iPriority=2;
|
sl@0
|
1328 |
que->sDoAddPriority(&link1);
|
sl@0
|
1329 |
que->sDoAddPriority(&link2);
|
sl@0
|
1330 |
que->sDoAddPriority(&link3);
|
sl@0
|
1331 |
test(que->sHead->iNext==&link2);
|
sl@0
|
1332 |
test(que->sHead->iPrev==&link3);
|
sl@0
|
1333 |
test(link1.iNext==&link3);
|
sl@0
|
1334 |
test(link1.iPrev==&link2);
|
sl@0
|
1335 |
test(link2.iNext==&link1);
|
sl@0
|
1336 |
test(link2.iPrev==que->sHead);
|
sl@0
|
1337 |
test(link3.iNext==que->sHead);
|
sl@0
|
1338 |
test(link3.iPrev==&link1);
|
sl@0
|
1339 |
link4.iPriority=3;
|
sl@0
|
1340 |
que->sDoAddPriority(&link4);
|
sl@0
|
1341 |
test(que->sHead->iNext==&link2);
|
sl@0
|
1342 |
test(que->sHead->iPrev==&link3);
|
sl@0
|
1343 |
test(link1.iNext==&link4);
|
sl@0
|
1344 |
test(link1.iPrev==&link2);
|
sl@0
|
1345 |
test(link2.iNext==&link1);
|
sl@0
|
1346 |
test(link2.iPrev==que->sHead);
|
sl@0
|
1347 |
test(link3.iNext==que->sHead);
|
sl@0
|
1348 |
test(link3.iPrev==&link4);
|
sl@0
|
1349 |
test(link4.iNext==&link3);
|
sl@0
|
1350 |
test(link4.iPrev==&link1);
|
sl@0
|
1351 |
link5.iPriority=5;
|
sl@0
|
1352 |
que->sDoAddPriority(&link5);
|
sl@0
|
1353 |
test(que->sHead->iNext==&link2);
|
sl@0
|
1354 |
test(que->sHead->iPrev==&link3);
|
sl@0
|
1355 |
test(link1.iNext==&link4);
|
sl@0
|
1356 |
test(link1.iPrev==&link5);
|
sl@0
|
1357 |
test(link2.iNext==&link5);
|
sl@0
|
1358 |
test(link2.iPrev==que->sHead);
|
sl@0
|
1359 |
test(link3.iNext==que->sHead);
|
sl@0
|
1360 |
test(link3.iPrev==&link4);
|
sl@0
|
1361 |
test(link4.iNext==&link3);
|
sl@0
|
1362 |
test(link4.iPrev==&link1);
|
sl@0
|
1363 |
test(link5.iNext==&link1);
|
sl@0
|
1364 |
test(link5.iPrev==&link2);
|
sl@0
|
1365 |
link6.iPriority=1;
|
sl@0
|
1366 |
que->sDoAddPriority(&link6);
|
sl@0
|
1367 |
test(que->sHead->iNext==&link2);
|
sl@0
|
1368 |
test(que->sHead->iPrev==&link6);
|
sl@0
|
1369 |
test(link1.iNext==&link4);
|
sl@0
|
1370 |
test(link1.iPrev==&link5);
|
sl@0
|
1371 |
test(link2.iNext==&link5);
|
sl@0
|
1372 |
test(link2.iPrev==que->sHead);
|
sl@0
|
1373 |
test(link3.iNext==&link6);
|
sl@0
|
1374 |
test(link3.iPrev==&link4);
|
sl@0
|
1375 |
test(link4.iNext==&link3);
|
sl@0
|
1376 |
test(link4.iPrev==&link1);
|
sl@0
|
1377 |
test(link5.iNext==&link1);
|
sl@0
|
1378 |
test(link5.iPrev==&link2);
|
sl@0
|
1379 |
test(link6.iNext==que->sHead);
|
sl@0
|
1380 |
test(link6.iPrev==&link3);
|
sl@0
|
1381 |
delete que;
|
sl@0
|
1382 |
}
|
sl@0
|
1383 |
|
sl@0
|
1384 |
template<class T>
|
sl@0
|
1385 |
void TestTQue<T>::Test17()
|
sl@0
|
1386 |
{
|
sl@0
|
1387 |
T* que;
|
sl@0
|
1388 |
TDeltaQueLink link1,link2;
|
sl@0
|
1389 |
TInt offset=4;
|
sl@0
|
1390 |
|
sl@0
|
1391 |
test.Start(_L("Constructors"));
|
sl@0
|
1392 |
que=new VDeltaQue<TDeltaQueLink>(offset);
|
sl@0
|
1393 |
delete que;
|
sl@0
|
1394 |
que=new VDeltaQue<TDeltaQueLink>;
|
sl@0
|
1395 |
test.Next(_L("Add/Remove"));
|
sl@0
|
1396 |
que->Add(link1,0);
|
sl@0
|
1397 |
que->Add(link2,2);
|
sl@0
|
1398 |
que->Remove(link2);
|
sl@0
|
1399 |
que->RemoveFirst();
|
sl@0
|
1400 |
test.Next(_L("Finished"));
|
sl@0
|
1401 |
test.End();
|
sl@0
|
1402 |
}
|
sl@0
|
1403 |
|
sl@0
|
1404 |
template<class T>
|
sl@0
|
1405 |
void TestTQue<T>::Test18()
|
sl@0
|
1406 |
{
|
sl@0
|
1407 |
T* que;
|
sl@0
|
1408 |
TInt offset;
|
sl@0
|
1409 |
|
sl@0
|
1410 |
test.Start(_L("Offset constructor"));
|
sl@0
|
1411 |
for (offset=0;offset<40;offset+=4)
|
sl@0
|
1412 |
{
|
sl@0
|
1413 |
que=new VDeltaQue<TDeltaQueLink>(offset);
|
sl@0
|
1414 |
test(*(que->sOffset)==offset);
|
sl@0
|
1415 |
delete que;
|
sl@0
|
1416 |
}
|
sl@0
|
1417 |
test.Next(_L("Finished"));
|
sl@0
|
1418 |
test.End();
|
sl@0
|
1419 |
}
|
sl@0
|
1420 |
|
sl@0
|
1421 |
template<class T>
|
sl@0
|
1422 |
void TestTQue<T>::Test19()
|
sl@0
|
1423 |
{
|
sl@0
|
1424 |
T* que;
|
sl@0
|
1425 |
TDeltaQueLink link1,link2,link3,link4,link5,link6;
|
sl@0
|
1426 |
|
sl@0
|
1427 |
test.Start(_L("Add"));
|
sl@0
|
1428 |
que=new T();
|
sl@0
|
1429 |
que->Add(link2,3);
|
sl@0
|
1430 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
1431 |
test(link2.iDelta==3);
|
sl@0
|
1432 |
que->Add(link5,15);
|
sl@0
|
1433 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
1434 |
test(link2.iDelta==3);
|
sl@0
|
1435 |
test(link5.iDelta==12);
|
sl@0
|
1436 |
que->Add(link3,6);
|
sl@0
|
1437 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
1438 |
test(link2.iDelta==3);
|
sl@0
|
1439 |
test(link3.iDelta==3);
|
sl@0
|
1440 |
test(link5.iDelta==9);
|
sl@0
|
1441 |
que->Add(link4,10);
|
sl@0
|
1442 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
1443 |
test(link2.iDelta==3);
|
sl@0
|
1444 |
test(link3.iDelta==3);
|
sl@0
|
1445 |
test(link4.iDelta==4);
|
sl@0
|
1446 |
test(link5.iDelta==5);
|
sl@0
|
1447 |
que->Add(link1,1);
|
sl@0
|
1448 |
test(*(que->sFirstDelta)==&link1.iDelta);
|
sl@0
|
1449 |
test(link1.iDelta==1);
|
sl@0
|
1450 |
test(link2.iDelta==2);
|
sl@0
|
1451 |
test(link3.iDelta==3);
|
sl@0
|
1452 |
test(link4.iDelta==4);
|
sl@0
|
1453 |
test(link5.iDelta==5);
|
sl@0
|
1454 |
que->Add(link6,21);
|
sl@0
|
1455 |
test(*(que->sFirstDelta)==&link1.iDelta);
|
sl@0
|
1456 |
test(link1.iDelta==1);
|
sl@0
|
1457 |
test(link2.iDelta==2);
|
sl@0
|
1458 |
test(link3.iDelta==3);
|
sl@0
|
1459 |
test(link4.iDelta==4);
|
sl@0
|
1460 |
test(link5.iDelta==5);
|
sl@0
|
1461 |
test(link6.iDelta==6);
|
sl@0
|
1462 |
test.Next(_L("Remove"));
|
sl@0
|
1463 |
que->Remove(link6);
|
sl@0
|
1464 |
test(*(que->sFirstDelta)==&link1.iDelta);
|
sl@0
|
1465 |
test(link1.iDelta==1);
|
sl@0
|
1466 |
test(link2.iDelta==2);
|
sl@0
|
1467 |
test(link3.iDelta==3);
|
sl@0
|
1468 |
test(link4.iDelta==4);
|
sl@0
|
1469 |
test(link5.iDelta==5);
|
sl@0
|
1470 |
que->Remove(link1);
|
sl@0
|
1471 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
1472 |
test(link2.iDelta==3);
|
sl@0
|
1473 |
test(link3.iDelta==3);
|
sl@0
|
1474 |
test(link4.iDelta==4);
|
sl@0
|
1475 |
test(link5.iDelta==5);
|
sl@0
|
1476 |
que->Remove(link4);
|
sl@0
|
1477 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
1478 |
test(link2.iDelta==3);
|
sl@0
|
1479 |
test(link3.iDelta==3);
|
sl@0
|
1480 |
test(link5.iDelta==9);
|
sl@0
|
1481 |
que->Remove(link3);
|
sl@0
|
1482 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
1483 |
test(link2.iDelta==3);
|
sl@0
|
1484 |
test(link5.iDelta==12);
|
sl@0
|
1485 |
que->Remove(link5);
|
sl@0
|
1486 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
1487 |
test(link2.iDelta==3);
|
sl@0
|
1488 |
test.Next(_L("RemoveFirst"));
|
sl@0
|
1489 |
test(NULL==que->RemoveFirst());
|
sl@0
|
1490 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
1491 |
test(link2.iDelta==3);
|
sl@0
|
1492 |
link2.iDelta=1;
|
sl@0
|
1493 |
test(NULL==que->RemoveFirst());
|
sl@0
|
1494 |
test(*(que->sFirstDelta)==&link2.iDelta);
|
sl@0
|
1495 |
test(link2.iDelta==1);
|
sl@0
|
1496 |
link2.iDelta=0;
|
sl@0
|
1497 |
test(&link2==que->RemoveFirst());
|
sl@0
|
1498 |
test.Next(_L("Finished"));
|
sl@0
|
1499 |
delete que;
|
sl@0
|
1500 |
test.End();
|
sl@0
|
1501 |
}
|
sl@0
|
1502 |
|
sl@0
|
1503 |
class VDblQueIterBase : public TDblQueIterBase
|
sl@0
|
1504 |
{
|
sl@0
|
1505 |
public:
|
sl@0
|
1506 |
VDblQueIterBase(TDblQueBase& aQue);
|
sl@0
|
1507 |
inline TAny* sDoPostInc() {return DoPostInc();}
|
sl@0
|
1508 |
inline TAny* sDoPostDec() {return DoPostDec();}
|
sl@0
|
1509 |
inline TAny* sDoCurrent() {return DoCurrent();}
|
sl@0
|
1510 |
TInt* sOffset;
|
sl@0
|
1511 |
TDblQueLinkBase** sHead;
|
sl@0
|
1512 |
TDblQueLinkBase** sNext;
|
sl@0
|
1513 |
private:
|
sl@0
|
1514 |
void SetMember();
|
sl@0
|
1515 |
};
|
sl@0
|
1516 |
|
sl@0
|
1517 |
template <class T>
|
sl@0
|
1518 |
class VDblQueIter : public TDblQueIter<T>
|
sl@0
|
1519 |
{
|
sl@0
|
1520 |
public:
|
sl@0
|
1521 |
VDblQueIter(TDblQueBase& aQue);
|
sl@0
|
1522 |
inline TAny* sDoPostInc() {return this->DoPostInc();}
|
sl@0
|
1523 |
inline TAny* sDoPostDec() {return this->DoPostDec();}
|
sl@0
|
1524 |
inline TAny* sDoCurrent() {return this->DoCurrent();}
|
sl@0
|
1525 |
TInt* sOffset;
|
sl@0
|
1526 |
TDblQueLinkBase** sHead;
|
sl@0
|
1527 |
TDblQueLinkBase** sNext;
|
sl@0
|
1528 |
private:
|
sl@0
|
1529 |
void SetMember();
|
sl@0
|
1530 |
};
|
sl@0
|
1531 |
|
sl@0
|
1532 |
VDblQueIterBase::VDblQueIterBase(TDblQueBase& aQue)
|
sl@0
|
1533 |
:TDblQueIterBase(aQue)
|
sl@0
|
1534 |
{
|
sl@0
|
1535 |
SetMember();
|
sl@0
|
1536 |
}
|
sl@0
|
1537 |
|
sl@0
|
1538 |
void VDblQueIterBase::SetMember()
|
sl@0
|
1539 |
{
|
sl@0
|
1540 |
sOffset=&iOffset;
|
sl@0
|
1541 |
sHead=&iHead;
|
sl@0
|
1542 |
sNext=&iNext;
|
sl@0
|
1543 |
}
|
sl@0
|
1544 |
|
sl@0
|
1545 |
template <class T>
|
sl@0
|
1546 |
VDblQueIter<T>::VDblQueIter(TDblQueBase& aQue)
|
sl@0
|
1547 |
:TDblQueIter<T>(aQue)
|
sl@0
|
1548 |
{
|
sl@0
|
1549 |
SetMember();
|
sl@0
|
1550 |
}
|
sl@0
|
1551 |
|
sl@0
|
1552 |
template <class T>
|
sl@0
|
1553 |
void VDblQueIter<T>::SetMember()
|
sl@0
|
1554 |
{
|
sl@0
|
1555 |
sOffset=&this->iOffset;
|
sl@0
|
1556 |
sHead=&this->iHead;
|
sl@0
|
1557 |
sNext=&this->iNext;
|
sl@0
|
1558 |
}
|
sl@0
|
1559 |
|
sl@0
|
1560 |
template<class T>
|
sl@0
|
1561 |
class TestTQueIter
|
sl@0
|
1562 |
{
|
sl@0
|
1563 |
public:
|
sl@0
|
1564 |
void TestIterBase();
|
sl@0
|
1565 |
void TestQueIter();
|
sl@0
|
1566 |
void Test1(); //All functions //TDblQueIterBase
|
sl@0
|
1567 |
void Test2(); //Constructors
|
sl@0
|
1568 |
void Test3(); //Do's
|
sl@0
|
1569 |
void Test4(); //Set
|
sl@0
|
1570 |
void Test5(); //All functions //TDblQueIter
|
sl@0
|
1571 |
void Test1Item();
|
sl@0
|
1572 |
//void Test6(); //Constructors //Redundant
|
sl@0
|
1573 |
void Test7(); //Iterators
|
sl@0
|
1574 |
private:
|
sl@0
|
1575 |
void CallTest2_4();
|
sl@0
|
1576 |
};
|
sl@0
|
1577 |
|
sl@0
|
1578 |
template<class T>
|
sl@0
|
1579 |
void TestTQueIter<T>::CallTest2_4()
|
sl@0
|
1580 |
{
|
sl@0
|
1581 |
test.Next(_L("Constructors"));
|
sl@0
|
1582 |
Test2();
|
sl@0
|
1583 |
test.Next(_L("Do's"));
|
sl@0
|
1584 |
Test3();
|
sl@0
|
1585 |
test.Next(_L("Sets"));
|
sl@0
|
1586 |
Test4();
|
sl@0
|
1587 |
}
|
sl@0
|
1588 |
|
sl@0
|
1589 |
template<class T>
|
sl@0
|
1590 |
void TestTQueIter<T>::TestIterBase()
|
sl@0
|
1591 |
{
|
sl@0
|
1592 |
test.Start(_L("All Methods"));
|
sl@0
|
1593 |
Test1();
|
sl@0
|
1594 |
CallTest2_4();
|
sl@0
|
1595 |
test.Next(_L("Finished"));
|
sl@0
|
1596 |
test.End();
|
sl@0
|
1597 |
}
|
sl@0
|
1598 |
|
sl@0
|
1599 |
template<class T>
|
sl@0
|
1600 |
void TestTQueIter<T>::TestQueIter()
|
sl@0
|
1601 |
{
|
sl@0
|
1602 |
test.Start(_L("All Methods"));
|
sl@0
|
1603 |
Test5();
|
sl@0
|
1604 |
CallTest2_4();
|
sl@0
|
1605 |
test.Next(_L("One item in queue"));
|
sl@0
|
1606 |
Test1Item();
|
sl@0
|
1607 |
test.Next(_L("Iterators"));
|
sl@0
|
1608 |
Test7();
|
sl@0
|
1609 |
test.Next(_L("Finished"));
|
sl@0
|
1610 |
test.End();
|
sl@0
|
1611 |
}
|
sl@0
|
1612 |
|
sl@0
|
1613 |
template<class T>
|
sl@0
|
1614 |
void TestTQueIter<T>::Test1()
|
sl@0
|
1615 |
{
|
sl@0
|
1616 |
Item item1,item2;
|
sl@0
|
1617 |
TDblQue<Item> que;
|
sl@0
|
1618 |
T* iter;
|
sl@0
|
1619 |
|
sl@0
|
1620 |
que.AddFirst(item2);
|
sl@0
|
1621 |
que.AddFirst(item1);
|
sl@0
|
1622 |
test.Start(_L("Constructor"));
|
sl@0
|
1623 |
iter=new VDblQueIterBase(que);
|
sl@0
|
1624 |
test.Next(_L("Do's"));
|
sl@0
|
1625 |
iter->sDoCurrent();
|
sl@0
|
1626 |
iter->sDoPostInc();
|
sl@0
|
1627 |
iter->sDoPostDec();
|
sl@0
|
1628 |
test.Next(_L("Sets"));
|
sl@0
|
1629 |
iter->SetToFirst();
|
sl@0
|
1630 |
iter->SetToLast();
|
sl@0
|
1631 |
delete iter;
|
sl@0
|
1632 |
test.Next(_L("Finished"));
|
sl@0
|
1633 |
test.End();
|
sl@0
|
1634 |
}
|
sl@0
|
1635 |
|
sl@0
|
1636 |
template<class T>
|
sl@0
|
1637 |
void TestTQueIter<T>::Test2()
|
sl@0
|
1638 |
{
|
sl@0
|
1639 |
Item item;
|
sl@0
|
1640 |
TDblQue<Item>* que;
|
sl@0
|
1641 |
TInt offset;
|
sl@0
|
1642 |
T* iter;
|
sl@0
|
1643 |
|
sl@0
|
1644 |
for(offset=0;offset<40;offset+=4)
|
sl@0
|
1645 |
{
|
sl@0
|
1646 |
que=new TDblQue<Item>(offset);
|
sl@0
|
1647 |
new(PtrAdd(&item.iLink,offset)) TDblQueLink(); // create the link at this offset
|
sl@0
|
1648 |
iter=new T(*que);
|
sl@0
|
1649 |
test(que->IsHead((Item*) PtrSub(*(iter->sHead),offset))); //Need to pass a pointer to a item
|
sl@0
|
1650 |
test(que->IsHead((Item*) PtrSub(*(iter->sNext),offset)));
|
sl@0
|
1651 |
test(*(iter->sOffset)==offset);
|
sl@0
|
1652 |
delete iter;
|
sl@0
|
1653 |
delete que;
|
sl@0
|
1654 |
que=new TDblQue<Item>(offset);
|
sl@0
|
1655 |
new(PtrAdd(&item.iLink,offset)) TDblQueLink(); // create the link at this offset
|
sl@0
|
1656 |
que->AddFirst(item);
|
sl@0
|
1657 |
iter=new T(*que);
|
sl@0
|
1658 |
test(que->IsHead((Item*) PtrSub(*(iter->sHead),offset)));
|
sl@0
|
1659 |
test(*(iter->sNext)==PtrAdd(&item.iLink,offset)); //Need a pointer to a link
|
sl@0
|
1660 |
test(*(iter->sOffset)==offset);
|
sl@0
|
1661 |
PtrAdd(&item.iLink,offset)->Deque();
|
sl@0
|
1662 |
delete iter;
|
sl@0
|
1663 |
delete que;
|
sl@0
|
1664 |
}
|
sl@0
|
1665 |
}
|
sl@0
|
1666 |
|
sl@0
|
1667 |
template<class T>
|
sl@0
|
1668 |
void TestTQueIter<T>::Test3()
|
sl@0
|
1669 |
{
|
sl@0
|
1670 |
Item item1,item2,item3,item4;
|
sl@0
|
1671 |
TDblQue<Item> que;
|
sl@0
|
1672 |
T* iter;
|
sl@0
|
1673 |
|
sl@0
|
1674 |
que.AddFirst(item4);
|
sl@0
|
1675 |
que.AddFirst(item3);
|
sl@0
|
1676 |
que.AddFirst(item2);
|
sl@0
|
1677 |
que.AddFirst(item1);
|
sl@0
|
1678 |
test.Start(_L("DoPostInc"));
|
sl@0
|
1679 |
iter=new T(que);
|
sl@0
|
1680 |
test(&item1==iter->sDoPostInc());
|
sl@0
|
1681 |
test(&item2.iLink==*(iter->sNext));
|
sl@0
|
1682 |
test(&item2==iter->sDoPostInc());
|
sl@0
|
1683 |
test(&item3.iLink==*(iter->sNext));
|
sl@0
|
1684 |
test(&item3==iter->sDoPostInc());
|
sl@0
|
1685 |
test(&item4.iLink==*(iter->sNext));
|
sl@0
|
1686 |
test(&item4==iter->sDoPostInc());
|
sl@0
|
1687 |
test(que.IsHead((Item*) *(iter->sNext)));
|
sl@0
|
1688 |
test(iter->sDoPostInc()==NULL);
|
sl@0
|
1689 |
delete iter;
|
sl@0
|
1690 |
test.Next(_L("DoPostDec"));
|
sl@0
|
1691 |
iter=new T(que);
|
sl@0
|
1692 |
iter->sDoPostInc();
|
sl@0
|
1693 |
iter->sDoPostInc();
|
sl@0
|
1694 |
iter->sDoPostInc();
|
sl@0
|
1695 |
test(&item4.iLink==*(iter->sNext));
|
sl@0
|
1696 |
test(&item4==iter->sDoPostDec());
|
sl@0
|
1697 |
test(&item3.iLink==*(iter->sNext));
|
sl@0
|
1698 |
test(&item3==iter->sDoPostDec());
|
sl@0
|
1699 |
test(&item2.iLink==*(iter->sNext));
|
sl@0
|
1700 |
test(&item2==iter->sDoPostDec());
|
sl@0
|
1701 |
test(&item1.iLink==*(iter->sNext));
|
sl@0
|
1702 |
test(&item1==iter->sDoPostDec());
|
sl@0
|
1703 |
test(que.IsHead((Item*) *(iter->sNext)));
|
sl@0
|
1704 |
test(iter->sDoPostDec()==NULL);
|
sl@0
|
1705 |
delete iter;
|
sl@0
|
1706 |
test.Next(_L("DoCurrent"));
|
sl@0
|
1707 |
iter=new T(que);
|
sl@0
|
1708 |
test(&item1==iter->sDoCurrent());
|
sl@0
|
1709 |
iter->sDoPostInc();
|
sl@0
|
1710 |
test(&item2==iter->sDoCurrent());
|
sl@0
|
1711 |
iter->sDoPostInc();
|
sl@0
|
1712 |
test(&item3==iter->sDoCurrent());
|
sl@0
|
1713 |
iter->sDoPostInc();
|
sl@0
|
1714 |
test(&item4==iter->sDoCurrent());
|
sl@0
|
1715 |
iter->sDoPostInc();
|
sl@0
|
1716 |
test(iter->sDoCurrent()==NULL);
|
sl@0
|
1717 |
delete iter;
|
sl@0
|
1718 |
test.Next(_L("Finished"));
|
sl@0
|
1719 |
test.End();
|
sl@0
|
1720 |
}
|
sl@0
|
1721 |
|
sl@0
|
1722 |
template<class T>
|
sl@0
|
1723 |
void TestTQueIter<T>::Test4()
|
sl@0
|
1724 |
{
|
sl@0
|
1725 |
Item item1,item2,item3,item4;
|
sl@0
|
1726 |
TDblQue<Item> que;
|
sl@0
|
1727 |
T* iter;
|
sl@0
|
1728 |
TInt i,j;
|
sl@0
|
1729 |
|
sl@0
|
1730 |
que.AddFirst(item4);
|
sl@0
|
1731 |
que.AddFirst(item3);
|
sl@0
|
1732 |
que.AddFirst(item2);
|
sl@0
|
1733 |
que.AddFirst(item1);
|
sl@0
|
1734 |
test.Start(_L("SetToFirst"));
|
sl@0
|
1735 |
iter=new T(que);
|
sl@0
|
1736 |
for(i=0;i<5;i++)
|
sl@0
|
1737 |
{
|
sl@0
|
1738 |
for(j=0;j<i;j++)
|
sl@0
|
1739 |
iter->sDoPostInc();
|
sl@0
|
1740 |
iter->SetToFirst();
|
sl@0
|
1741 |
test(*(iter->sNext)==&item1.iLink);
|
sl@0
|
1742 |
}
|
sl@0
|
1743 |
delete iter;
|
sl@0
|
1744 |
test.Next(_L("SetToLast"));
|
sl@0
|
1745 |
iter=new T(que);
|
sl@0
|
1746 |
for(i=0;i<5;i++)
|
sl@0
|
1747 |
{
|
sl@0
|
1748 |
iter->SetToFirst();
|
sl@0
|
1749 |
for(j=0;j<i;j++)
|
sl@0
|
1750 |
iter->sDoPostInc();
|
sl@0
|
1751 |
iter->SetToLast();
|
sl@0
|
1752 |
test(*(iter->sNext)==&item4.iLink);
|
sl@0
|
1753 |
}
|
sl@0
|
1754 |
delete iter;
|
sl@0
|
1755 |
test.Next(_L("Finished"));
|
sl@0
|
1756 |
test.End();
|
sl@0
|
1757 |
}
|
sl@0
|
1758 |
|
sl@0
|
1759 |
template<class T>
|
sl@0
|
1760 |
void TestTQueIter<T>::Test5()
|
sl@0
|
1761 |
{
|
sl@0
|
1762 |
Item item1,item2;
|
sl@0
|
1763 |
TDblQue<Item> que;
|
sl@0
|
1764 |
T* iter;
|
sl@0
|
1765 |
Item* a;
|
sl@0
|
1766 |
|
sl@0
|
1767 |
que.AddFirst(item2);
|
sl@0
|
1768 |
que.AddFirst(item1);
|
sl@0
|
1769 |
test.Start(_L("Constructor"));
|
sl@0
|
1770 |
iter=new T(que);
|
sl@0
|
1771 |
test.Next(_L("Iterators"));
|
sl@0
|
1772 |
a=*iter;
|
sl@0
|
1773 |
test(((*iter)++)==&item1);
|
sl@0
|
1774 |
test(((*iter)--)==&item2);
|
sl@0
|
1775 |
test(((*iter)++)==&item1);
|
sl@0
|
1776 |
test(((*iter)++)==&item2);
|
sl@0
|
1777 |
test(((*iter)++)==NULL);
|
sl@0
|
1778 |
test(((*iter)++)==NULL);
|
sl@0
|
1779 |
test(((*iter)--)==NULL);
|
sl@0
|
1780 |
test(((*iter)--)==NULL);
|
sl@0
|
1781 |
iter->Set(item2);
|
sl@0
|
1782 |
test(((*iter)--)==&item2);
|
sl@0
|
1783 |
test(((*iter)++)==&item1);
|
sl@0
|
1784 |
test(((*iter)--)==&item2);
|
sl@0
|
1785 |
test(((*iter)--)==&item1);
|
sl@0
|
1786 |
test(((*iter)++)==NULL);
|
sl@0
|
1787 |
test(((*iter)++)==NULL);
|
sl@0
|
1788 |
test(((*iter)--)==NULL);
|
sl@0
|
1789 |
test(((*iter)--)==NULL);
|
sl@0
|
1790 |
delete iter;
|
sl@0
|
1791 |
test.Next(_L("Finished"));
|
sl@0
|
1792 |
test.End();
|
sl@0
|
1793 |
}
|
sl@0
|
1794 |
|
sl@0
|
1795 |
template<class T>
|
sl@0
|
1796 |
void TestTQueIter<T>::Test1Item()
|
sl@0
|
1797 |
{
|
sl@0
|
1798 |
Item item;
|
sl@0
|
1799 |
TDblQue<Item> que;
|
sl@0
|
1800 |
T* iter;
|
sl@0
|
1801 |
|
sl@0
|
1802 |
test.Start(_L("Constructor"));
|
sl@0
|
1803 |
iter=new T(que);
|
sl@0
|
1804 |
que.AddFirst(item);
|
sl@0
|
1805 |
iter->Set(item);
|
sl@0
|
1806 |
test.Next(_L("Iterators"));
|
sl@0
|
1807 |
test(((*iter)++)==&item);
|
sl@0
|
1808 |
test(((*iter)++)==NULL);
|
sl@0
|
1809 |
test(((*iter)++)==NULL);
|
sl@0
|
1810 |
test(((*iter)++)==NULL);
|
sl@0
|
1811 |
test(((*iter)--)==NULL);
|
sl@0
|
1812 |
test(((*iter)--)==NULL);
|
sl@0
|
1813 |
iter->Set(item);
|
sl@0
|
1814 |
test(((*iter)--)==&item);
|
sl@0
|
1815 |
test(((*iter)++)==NULL);
|
sl@0
|
1816 |
test(((*iter)--)==NULL);
|
sl@0
|
1817 |
test(((*iter)--)==NULL);
|
sl@0
|
1818 |
test(((*iter)--)==NULL);
|
sl@0
|
1819 |
test(((*iter)++)==NULL);
|
sl@0
|
1820 |
test(((*iter)++)==NULL);
|
sl@0
|
1821 |
delete iter;
|
sl@0
|
1822 |
test.Next(_L("Finished"));
|
sl@0
|
1823 |
test.End();
|
sl@0
|
1824 |
}
|
sl@0
|
1825 |
|
sl@0
|
1826 |
/*template<class T> //Redundant
|
sl@0
|
1827 |
void TestTQueIter<T>::Test6()
|
sl@0
|
1828 |
{
|
sl@0
|
1829 |
Item item;
|
sl@0
|
1830 |
TDblQue<Item>* que;
|
sl@0
|
1831 |
TInt offset;
|
sl@0
|
1832 |
T* iter;
|
sl@0
|
1833 |
|
sl@0
|
1834 |
for(offset=0;offset<40;offset+=4)
|
sl@0
|
1835 |
{
|
sl@0
|
1836 |
que=new TDblQue<Item>(offset);
|
sl@0
|
1837 |
iter=new T(*que);
|
sl@0
|
1838 |
test(que->IsHead((Item*) *(iter->sHead)));
|
sl@0
|
1839 |
test(que->IsHead((Item*) *(iter->sNext)));
|
sl@0
|
1840 |
test(*(iter->sOffset)==offset);
|
sl@0
|
1841 |
delete iter;
|
sl@0
|
1842 |
delete que;
|
sl@0
|
1843 |
que=new TDblQue<Item>(offset);
|
sl@0
|
1844 |
que->AddFirst(item);
|
sl@0
|
1845 |
iter=new T(*que);
|
sl@0
|
1846 |
test(que->IsHead((Item*) *(iter->sHead)));
|
sl@0
|
1847 |
test(*(iter->sNext)==&item.iLink);
|
sl@0
|
1848 |
test(*(iter->sOffset)==offset);
|
sl@0
|
1849 |
delete iter;
|
sl@0
|
1850 |
delete que;
|
sl@0
|
1851 |
}
|
sl@0
|
1852 |
}*/
|
sl@0
|
1853 |
|
sl@0
|
1854 |
template<class T>
|
sl@0
|
1855 |
void TestTQueIter<T>::Test7()
|
sl@0
|
1856 |
{
|
sl@0
|
1857 |
Item item1,item2,item3,item4;
|
sl@0
|
1858 |
TDblQue<Item> que;
|
sl@0
|
1859 |
T* iter;
|
sl@0
|
1860 |
|
sl@0
|
1861 |
que.AddFirst(item4);
|
sl@0
|
1862 |
que.AddFirst(item3);
|
sl@0
|
1863 |
que.AddFirst(item2);
|
sl@0
|
1864 |
que.AddFirst(item1);
|
sl@0
|
1865 |
test.Start(_L("PostFix ++"));
|
sl@0
|
1866 |
iter=new T(que);
|
sl@0
|
1867 |
test(&item1==(*iter)++);
|
sl@0
|
1868 |
test(&item2.iLink==*(iter->sNext));
|
sl@0
|
1869 |
test(&item2==(*iter)++);
|
sl@0
|
1870 |
test(&item3.iLink==*(iter->sNext));
|
sl@0
|
1871 |
test(&item3==(*iter)++);
|
sl@0
|
1872 |
test(&item4.iLink==*(iter->sNext));
|
sl@0
|
1873 |
test(&item4==(*iter)++);
|
sl@0
|
1874 |
test(que.IsHead((Item*) *(iter->sNext)));
|
sl@0
|
1875 |
test((*iter)++==NULL);
|
sl@0
|
1876 |
delete iter;
|
sl@0
|
1877 |
test.Next(_L("PostFix --"));
|
sl@0
|
1878 |
iter=new T(que);
|
sl@0
|
1879 |
iter->SetToLast();
|
sl@0
|
1880 |
test(&item4.iLink==*(iter->sNext));
|
sl@0
|
1881 |
test(&item4==(*iter)--);
|
sl@0
|
1882 |
test(&item3.iLink==*(iter->sNext));
|
sl@0
|
1883 |
test(&item3==(*iter)--);
|
sl@0
|
1884 |
test(&item2.iLink==*(iter->sNext));
|
sl@0
|
1885 |
test(&item2==(*iter)--);
|
sl@0
|
1886 |
test(&item1.iLink==*(iter->sNext));
|
sl@0
|
1887 |
test(&item1==(*iter)--);
|
sl@0
|
1888 |
test(que.IsHead((Item*) *(iter->sNext)));
|
sl@0
|
1889 |
test((*iter)--==NULL);
|
sl@0
|
1890 |
delete iter;
|
sl@0
|
1891 |
test.Next(_L("Conversion Operator"));
|
sl@0
|
1892 |
iter=new T(que);
|
sl@0
|
1893 |
test(&item1==*iter);
|
sl@0
|
1894 |
(*iter)++;
|
sl@0
|
1895 |
test(&item2==*iter);
|
sl@0
|
1896 |
(*iter)++;
|
sl@0
|
1897 |
test(&item3==*iter);
|
sl@0
|
1898 |
(*iter)++;
|
sl@0
|
1899 |
test(&item4==*iter);
|
sl@0
|
1900 |
(*iter)++;
|
sl@0
|
1901 |
test(*iter==NULL);
|
sl@0
|
1902 |
delete iter;
|
sl@0
|
1903 |
test.Next(_L("Finished"));
|
sl@0
|
1904 |
test.End();
|
sl@0
|
1905 |
}
|
sl@0
|
1906 |
|
sl@0
|
1907 |
GLDEF_C TInt E32Main()
|
sl@0
|
1908 |
{
|
sl@0
|
1909 |
|
sl@0
|
1910 |
TestTQueLink<TDblQueLinkBase>* testDblQueLinkBase;
|
sl@0
|
1911 |
TestTQueLink<TDeltaQueLink>* testDeltaQueLink;
|
sl@0
|
1912 |
TestTQueLink<TDblQueLink>* testDblQueLink;
|
sl@0
|
1913 |
TestTQueLink<TPriQueLink>* testPriQueLink;
|
sl@0
|
1914 |
TestTQue<VDblQueBase>* testDblQueBase;
|
sl@0
|
1915 |
TestTQue<VDeltaQueBase>* testDeltaQueBase;
|
sl@0
|
1916 |
TestTQue<VDblQue<TDblQueLink> >* testDblQue;
|
sl@0
|
1917 |
TestTQue<VPriQue<TPriQueLink> >* testPriQue;
|
sl@0
|
1918 |
TestTQue<VDeltaQue<TDeltaQueLink> >* testDeltaQue;
|
sl@0
|
1919 |
TestTQueIter<VDblQueIterBase>* testDblQueIterBase;
|
sl@0
|
1920 |
TestTQueIter<VDblQueIter<Item> >* testDblQueIter;
|
sl@0
|
1921 |
|
sl@0
|
1922 |
// Test the queue classes.
|
sl@0
|
1923 |
test.Title();
|
sl@0
|
1924 |
test.Start(_L("class TDblQueLinkBase"));
|
sl@0
|
1925 |
testDblQueLinkBase=new TestTQueLink<TDblQueLinkBase>;
|
sl@0
|
1926 |
testDblQueLinkBase->TestQueLinkBase();
|
sl@0
|
1927 |
delete testDblQueLinkBase;
|
sl@0
|
1928 |
|
sl@0
|
1929 |
test.Next(_L("class TDeltaQueLink"));
|
sl@0
|
1930 |
testDeltaQueLink=new TestTQueLink<TDeltaQueLink>;
|
sl@0
|
1931 |
testDeltaQueLink->TestQueLinkBase();
|
sl@0
|
1932 |
delete testDeltaQueLink;
|
sl@0
|
1933 |
|
sl@0
|
1934 |
test.Next(_L("class TDblQueLink"));
|
sl@0
|
1935 |
testDblQueLink=new TestTQueLink<TDblQueLink>;
|
sl@0
|
1936 |
testDblQueLink->TestQueLink();
|
sl@0
|
1937 |
delete testDblQueLink;
|
sl@0
|
1938 |
|
sl@0
|
1939 |
test.Next(_L("class TPriQueLink"));
|
sl@0
|
1940 |
testPriQueLink=new TestTQueLink<TPriQueLink>;
|
sl@0
|
1941 |
testPriQueLink->TestQueLink();
|
sl@0
|
1942 |
delete testPriQueLink;
|
sl@0
|
1943 |
|
sl@0
|
1944 |
test.Next(_L("class TDblQueBase"));
|
sl@0
|
1945 |
testDblQueBase=new TestTQue<VDblQueBase>;
|
sl@0
|
1946 |
testDblQueBase->TestQueBase();
|
sl@0
|
1947 |
delete testDblQueBase;
|
sl@0
|
1948 |
|
sl@0
|
1949 |
test.Next(_L("class TDeltaQueBase"));
|
sl@0
|
1950 |
testDeltaQueBase=new TestTQue<VDeltaQueBase>;
|
sl@0
|
1951 |
testDeltaQueBase->TestDeltaBase();
|
sl@0
|
1952 |
delete testDeltaQueBase;
|
sl@0
|
1953 |
|
sl@0
|
1954 |
test.Next(_L("class TDlbQue"));
|
sl@0
|
1955 |
testDblQue=new TestTQue<VDblQue<TDblQueLink> >;
|
sl@0
|
1956 |
testDblQue->TestDblQue();
|
sl@0
|
1957 |
delete testDblQue;
|
sl@0
|
1958 |
|
sl@0
|
1959 |
test.Next(_L("class TPriQue"));
|
sl@0
|
1960 |
testPriQue=new TestTQue<VPriQue<TPriQueLink> >;
|
sl@0
|
1961 |
testPriQue->TestPriQue();
|
sl@0
|
1962 |
delete testPriQue;
|
sl@0
|
1963 |
|
sl@0
|
1964 |
test.Next(_L("class TDeltaQue"));
|
sl@0
|
1965 |
testDeltaQue=new TestTQue<VDeltaQue<TDeltaQueLink> >;
|
sl@0
|
1966 |
testDeltaQue->TestDeltaQue();
|
sl@0
|
1967 |
delete testDeltaQue;
|
sl@0
|
1968 |
|
sl@0
|
1969 |
test.Next(_L("class TDblQueIterBase"));
|
sl@0
|
1970 |
testDblQueIterBase=new TestTQueIter<VDblQueIterBase>;
|
sl@0
|
1971 |
testDblQueIterBase->TestIterBase();
|
sl@0
|
1972 |
delete testDblQueIterBase;
|
sl@0
|
1973 |
|
sl@0
|
1974 |
test.Next(_L("class TDblQueIter"));
|
sl@0
|
1975 |
testDblQueIter=new TestTQueIter<VDblQueIter<Item> >;
|
sl@0
|
1976 |
testDblQueIter->TestQueIter();
|
sl@0
|
1977 |
delete testDblQueIter;
|
sl@0
|
1978 |
|
sl@0
|
1979 |
test.Next(_L("Finished"));
|
sl@0
|
1980 |
test.End();
|
sl@0
|
1981 |
return(0);
|
sl@0
|
1982 |
}
|
sl@0
|
1983 |
|
sl@0
|
1984 |
#pragma warning(default : 4710) //fuction not expanded
|
sl@0
|
1985 |
|