Update contrib.
1 // Copyright (c) 1997-2009 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 "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Written by Martin, May 1996
25 LOCAL_D RTest test(_L("T_CELL"));
37 @SYMTestCaseID SYSLIB-BAFL-CT-0400
38 @SYMTestCaseDesc Tests the functionality of TCellRef::operator ==() and !=()
40 @SYMTestActions Test the equality of two cells defined by TCellRef's constructor
41 Test the equality after changing the offsets of the cells already created
42 @SYMTestExpectedResults Test must not fail
48 test.Start(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0400 Cells "));
67 c2 = c2 - TCellRef(48,40);
68 test(c2==TCellRef(52,60));
69 c2 = c2 + TCellRef(100,100);
70 test(c2==TCellRef(152,160));
77 @SYMTestCaseID SYSLIB-BAFL-CT-0401
78 @SYMTestCaseDesc Tests the functionality of TRangeRef::NoRows(),NoCols(),NoCells(),Contains() functions
79 @SYMTestPriority Medium
80 @SYMTestActions Test the equality of two objects defined by TRangeRef's
81 Test the no of rows & columns after a range is defined
82 Test the existence of a cell after a range is defined.
83 @SYMTestExpectedResults Test must not fail
89 test.Start(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0401 Ranges "));
91 TRangeRef r1(TCellRef(2,3),TCellRef(3,5));
92 TRangeRef r2(2,3,3,5);
93 TRangeRef r3(2,4,3,6);
94 TRangeRef r5(1,0,19,20);
101 r2.SetRange(2,3,3,5);
103 r2.SetRange(TCellRef(1,0),TCellRef(19,20));
106 {test(TRangeRef(TCellRef(2,3),TCellRef(3,5)).NoRows()==2);}
107 {test(TRangeRef(TCellRef(2,3),TCellRef(3,5)).NoCols()==3);}
108 {test(TRangeRef(TCellRef(2,3),TCellRef(3,5)).NoCells()==6);}
110 {test(TRangeRef(TCellRef(1,7),TCellRef(10,20)).NoRows()==10);}
111 {test(TRangeRef(TCellRef(1,7),TCellRef(10,20)).NoCols()==14);}
112 {test(TRangeRef(TCellRef(1,7),TCellRef(10,20)).NoCells()==140);}
114 {test(TRangeRef(TCellRef(2,3),TCellRef(3,5)).Contains(TCellRef(3,3)));}
115 {test(TRangeRef(TCellRef(2,3),TCellRef(3,5)).Contains(TCellRef(2,3)));}
116 {test(TRangeRef(TCellRef(2,3),TCellRef(3,5)).Contains(TCellRef(3,5)));}
117 {test(!TRangeRef(TCellRef(2,3),TCellRef(3,5)).Contains(TCellRef(1,3)));}
118 {test(!TRangeRef(TCellRef(2,3),TCellRef(3,5)).Contains(TCellRef(3,6)));}
125 @SYMTestCaseID SYSLIB-BAFL-CT-0402
126 @SYMTestCaseDesc TRangeRef class functionality test
127 @SYMTestPriority Medium
128 @SYMTestActions Test range of cells defined by TRangeRef by iteration and checking the count
129 @SYMTestExpectedResults Tests must not fail
135 test.Start(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0402 Range iterator "));
137 {TRangeRef range(TCellRef(2,3),TCellRef(10,24));
138 TRangeRef::TIter iter(range);
139 test(iter.iCurrent==range.iFrom);
141 while (iter.InRange())
146 test(count==range.NoCells());
147 test(iter.iCurrent==TCellRef(range.iTo.iRow+1,range.iFrom.iCol));}
149 {TRangeRef range(TCellRef(2,3),TCellRef(2,3));
150 TRangeRef::TIter iter(range);
151 test(iter.iCurrent==range.iFrom);
153 while (iter.InRange())
161 {TRangeRef range(TCellRef(2,3),TCellRef(2,-3));
162 TRangeRef::TIter iter(range);
163 test(iter.iCurrent==range.iFrom);
165 while (iter.InRange())
177 @SYMTestCaseID SYSLIB-BAFL-CT-0403
178 @SYMTestCaseDesc Tests for RDesWriteStream and RDesReadStream classes
179 @SYMTestPriority Medium
180 @SYMTestActions Test the cell's info by writing and reading back from stream.
181 @SYMTestExpectedResults Tests must not fail
187 test.Start(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0403 Streaming "));
190 RDesWriteStream writeStream(buf);
193 TRangeRef range1(12,13,2,5);
194 writeStream << cell1;
195 writeStream << cell2;
196 writeStream.WriteInt32L(KMaxTInt32);
197 writeStream.WriteInt32L(KMinTInt32);
198 writeStream << range1;
201 RDesReadStream readStream(buf);
202 readStream >> range1;
203 test(range1==TRangeRef(cell1,cell2));
204 readStream >> range1;
205 test(range1.iFrom==TCellRef(KMaxTInt32,KMinTInt32));
206 test(range1.iTo.iRow==12);
207 test(range1.iTo.iCol==13);