sl@0
|
1 |
|
sl@0
|
2 |
// Concurrency tests. Threads[2-8] wait (semaphore) until they receive a
|
sl@0
|
3 |
// signal. Thread1 creates the db and adds a table to it. It then signals the
|
sl@0
|
4 |
// other threads and all eight threads write integer, real, and text data
|
sl@0
|
5 |
// to the table.
|
sl@0
|
6 |
[Thread1]
|
sl@0
|
7 |
WaitB0=7
|
sl@0
|
8 |
Delete1=C:\Concurrent.db
|
sl@0
|
9 |
ExpectedError1=KErrNotFound
|
sl@0
|
10 |
Create2=C:\Concurrent.db
|
sl@0
|
11 |
Exec3=Create Table Con( Someint int primary key, Somereal real, Sometext text);
|
sl@0
|
12 |
Prepare4=insert into Con(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
|
sl@0
|
13 |
// Wake up the other threads, we're doing the next bit concurrently.
|
sl@0
|
14 |
SignalA5=7
|
sl@0
|
15 |
|
sl@0
|
16 |
Function6=WriteBigTable
|
sl@0
|
17 |
EventuallyExpectedError=KErrNone
|
sl@0
|
18 |
LowCount=0
|
sl@0
|
19 |
HighCount=64
|
sl@0
|
20 |
CountStep=8
|
sl@0
|
21 |
Multiplier=2.81
|
sl@0
|
22 |
Text=Thread1
|
sl@0
|
23 |
St_Close7=
|
sl@0
|
24 |
Close8=
|
sl@0
|
25 |
WaitB9=7
|
sl@0
|
26 |
EndBlock10=
|
sl@0
|
27 |
|
sl@0
|
28 |
[Thread2]
|
sl@0
|
29 |
SignalB0=1
|
sl@0
|
30 |
WaitA1=1
|
sl@0
|
31 |
Open2=C:\Concurrent.db
|
sl@0
|
32 |
Prepare3=insert into Con(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
|
sl@0
|
33 |
Function4=WriteBigTable
|
sl@0
|
34 |
EventuallyExpectedError=KErrNone
|
sl@0
|
35 |
LowCount=1
|
sl@0
|
36 |
HighCount=65
|
sl@0
|
37 |
CountStep=8
|
sl@0
|
38 |
Multiplier=-1.121
|
sl@0
|
39 |
Text=Thread2
|
sl@0
|
40 |
St_Close5=
|
sl@0
|
41 |
Close6=
|
sl@0
|
42 |
SignalB7=1
|
sl@0
|
43 |
EndBlock8=
|
sl@0
|
44 |
|
sl@0
|
45 |
[Thread3]
|
sl@0
|
46 |
SignalB0=1
|
sl@0
|
47 |
WaitA1=1
|
sl@0
|
48 |
Open2=C:\Concurrent.db
|
sl@0
|
49 |
Prepare3=insert into Con(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
|
sl@0
|
50 |
Function4=WriteBigTable
|
sl@0
|
51 |
EventuallyExpectedError=KErrNone
|
sl@0
|
52 |
LowCount=2
|
sl@0
|
53 |
HighCount=66
|
sl@0
|
54 |
CountStep=8
|
sl@0
|
55 |
Multiplier=4.8e-21
|
sl@0
|
56 |
Text=Thread3
|
sl@0
|
57 |
St_Close5=
|
sl@0
|
58 |
Close6=
|
sl@0
|
59 |
SignalB7=1
|
sl@0
|
60 |
EndBlock8=
|
sl@0
|
61 |
|
sl@0
|
62 |
[Thread4]
|
sl@0
|
63 |
SignalB0=1
|
sl@0
|
64 |
WaitA1=1
|
sl@0
|
65 |
Open2=C:\Concurrent.db
|
sl@0
|
66 |
Prepare3=insert into Con(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
|
sl@0
|
67 |
Function4=WriteBigTable
|
sl@0
|
68 |
EventuallyExpectedError=KErrNone
|
sl@0
|
69 |
LowCount=3
|
sl@0
|
70 |
HighCount=67
|
sl@0
|
71 |
CountStep=8
|
sl@0
|
72 |
Multiplier=3.141592654
|
sl@0
|
73 |
Text=Thread4
|
sl@0
|
74 |
St_Close5=
|
sl@0
|
75 |
Close6=
|
sl@0
|
76 |
SignalB7=1
|
sl@0
|
77 |
EndBlock8=
|
sl@0
|
78 |
|
sl@0
|
79 |
[Thread5]
|
sl@0
|
80 |
SignalB0=1
|
sl@0
|
81 |
WaitA1=1
|
sl@0
|
82 |
Open2=C:\Concurrent.db
|
sl@0
|
83 |
Prepare3=insert into Con(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
|
sl@0
|
84 |
Function4=WriteBigTable
|
sl@0
|
85 |
EventuallyExpectedError=KErrNone
|
sl@0
|
86 |
LowCount=4
|
sl@0
|
87 |
HighCount=68
|
sl@0
|
88 |
CountStep=8
|
sl@0
|
89 |
Multiplier=2.81
|
sl@0
|
90 |
Text=Thread5
|
sl@0
|
91 |
St_Close5=
|
sl@0
|
92 |
Close6=
|
sl@0
|
93 |
SignalB7=1
|
sl@0
|
94 |
EndBlock8=
|
sl@0
|
95 |
|
sl@0
|
96 |
[Thread6]
|
sl@0
|
97 |
SignalB0=1
|
sl@0
|
98 |
WaitA1=1
|
sl@0
|
99 |
Open2=C:\Concurrent.db
|
sl@0
|
100 |
Prepare3=insert into Con(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
|
sl@0
|
101 |
Function4=WriteBigTable
|
sl@0
|
102 |
EventuallyExpectedError=KErrNone
|
sl@0
|
103 |
LowCount=5
|
sl@0
|
104 |
HighCount=69
|
sl@0
|
105 |
CountStep=8
|
sl@0
|
106 |
Multiplier=-1.121
|
sl@0
|
107 |
Text=Thread6
|
sl@0
|
108 |
St_Close5=
|
sl@0
|
109 |
Close6=
|
sl@0
|
110 |
SignalB7=1
|
sl@0
|
111 |
EndBlock8=
|
sl@0
|
112 |
|
sl@0
|
113 |
[Thread7]
|
sl@0
|
114 |
SignalB0=1
|
sl@0
|
115 |
WaitA1=1
|
sl@0
|
116 |
Open2=C:\Concurrent.db
|
sl@0
|
117 |
Prepare3=insert into Con(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
|
sl@0
|
118 |
Function4=WriteBigTable
|
sl@0
|
119 |
EventuallyExpectedError=KErrNone
|
sl@0
|
120 |
LowCount=6
|
sl@0
|
121 |
HighCount=70
|
sl@0
|
122 |
CountStep=8
|
sl@0
|
123 |
Multiplier=4.8e-21
|
sl@0
|
124 |
Text=Thread7
|
sl@0
|
125 |
St_Close5=
|
sl@0
|
126 |
Close6=
|
sl@0
|
127 |
SignalB7=1
|
sl@0
|
128 |
EndBlock8=
|
sl@0
|
129 |
|
sl@0
|
130 |
[Thread8]
|
sl@0
|
131 |
SignalB0=1
|
sl@0
|
132 |
WaitA1=1
|
sl@0
|
133 |
Open2=C:\Concurrent.db
|
sl@0
|
134 |
Prepare3=insert into Con(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
|
sl@0
|
135 |
Function4=WriteBigTable
|
sl@0
|
136 |
EventuallyExpectedError=KErrNone
|
sl@0
|
137 |
LowCount=7
|
sl@0
|
138 |
HighCount=71
|
sl@0
|
139 |
CountStep=8
|
sl@0
|
140 |
Multiplier=3.141592654
|
sl@0
|
141 |
Text=Thread8
|
sl@0
|
142 |
St_Close5=
|
sl@0
|
143 |
Close6=
|
sl@0
|
144 |
SignalB7=1
|
sl@0
|
145 |
EndBlock8=
|
sl@0
|
146 |
|
sl@0
|
147 |
// The following 8 blocks check the content written by the threads above.
|
sl@0
|
148 |
// These are entirely independent of each other and therefore do not require
|
sl@0
|
149 |
// use of the semaphores.
|
sl@0
|
150 |
|
sl@0
|
151 |
[Check1]
|
sl@0
|
152 |
Open0=C:\Concurrent.db
|
sl@0
|
153 |
Prepare1=select * from Con where(Sometext="Thread1");
|
sl@0
|
154 |
Next2=KSqlAtRow
|
sl@0
|
155 |
ExpectedError2=KSqlAtRow
|
sl@0
|
156 |
NoOperation3=
|
sl@0
|
157 |
|
sl@0
|
158 |
Function4=ReadBigTable
|
sl@0
|
159 |
EventuallyExpectedError=KErrNone
|
sl@0
|
160 |
LowCount=0
|
sl@0
|
161 |
HighCount=64
|
sl@0
|
162 |
CountStep=8
|
sl@0
|
163 |
Multiplier=2.81
|
sl@0
|
164 |
Text=Thread1
|
sl@0
|
165 |
AtRow5=False
|
sl@0
|
166 |
St_Close6=
|
sl@0
|
167 |
Close7=
|
sl@0
|
168 |
EndBlock8=
|
sl@0
|
169 |
|
sl@0
|
170 |
[Check2]
|
sl@0
|
171 |
Open0=C:\Concurrent.db
|
sl@0
|
172 |
Prepare1=select * from Con where(Sometext="Thread2");
|
sl@0
|
173 |
Next2=KSqlAtRow
|
sl@0
|
174 |
ExpectedError2=KSqlAtRow
|
sl@0
|
175 |
NoOperation3=
|
sl@0
|
176 |
|
sl@0
|
177 |
Function4=ReadBigTable
|
sl@0
|
178 |
EventuallyExpectedError=KErrNone
|
sl@0
|
179 |
LowCount=1
|
sl@0
|
180 |
HighCount=65
|
sl@0
|
181 |
CountStep=8
|
sl@0
|
182 |
Multiplier=-1.121
|
sl@0
|
183 |
Text=Thread2
|
sl@0
|
184 |
AtRow5=False
|
sl@0
|
185 |
St_Close6=
|
sl@0
|
186 |
Close7=
|
sl@0
|
187 |
EndBlock8=
|
sl@0
|
188 |
|
sl@0
|
189 |
[Check3]
|
sl@0
|
190 |
Open0=C:\Concurrent.db
|
sl@0
|
191 |
Prepare1=select * from Con where(Sometext="Thread3");
|
sl@0
|
192 |
Next2=KSqlAtRow
|
sl@0
|
193 |
ExpectedError2=KSqlAtRow
|
sl@0
|
194 |
NoOperation3=
|
sl@0
|
195 |
|
sl@0
|
196 |
Function4=ReadBigTable
|
sl@0
|
197 |
EventuallyExpectedError=KErrNone
|
sl@0
|
198 |
LowCount=2
|
sl@0
|
199 |
HighCount=66
|
sl@0
|
200 |
CountStep=8
|
sl@0
|
201 |
Multiplier=4.8e-21
|
sl@0
|
202 |
Text=Thread3
|
sl@0
|
203 |
AtRow5=False
|
sl@0
|
204 |
St_Close6=
|
sl@0
|
205 |
Close7=
|
sl@0
|
206 |
EndBlock8=
|
sl@0
|
207 |
|
sl@0
|
208 |
[Check4]
|
sl@0
|
209 |
Open0=C:\Concurrent.db
|
sl@0
|
210 |
Prepare1=select * from Con where(Sometext="Thread4");
|
sl@0
|
211 |
Next2=KSqlAtRow
|
sl@0
|
212 |
ExpectedError2=KSqlAtRow
|
sl@0
|
213 |
NoOperation3=
|
sl@0
|
214 |
|
sl@0
|
215 |
Function4=ReadBigTable
|
sl@0
|
216 |
EventuallyExpectedError=KErrNone
|
sl@0
|
217 |
LowCount=3
|
sl@0
|
218 |
HighCount=67
|
sl@0
|
219 |
CountStep=8
|
sl@0
|
220 |
Multiplier=3.141592654
|
sl@0
|
221 |
Text=Thread4
|
sl@0
|
222 |
AtRow5=False
|
sl@0
|
223 |
St_Close6=
|
sl@0
|
224 |
Close7=
|
sl@0
|
225 |
EndBlock8=
|
sl@0
|
226 |
|
sl@0
|
227 |
[Check5]
|
sl@0
|
228 |
Open0=C:\Concurrent.db
|
sl@0
|
229 |
Prepare1=select * from Con where(Sometext="Thread5");
|
sl@0
|
230 |
Next2=KSqlAtRow
|
sl@0
|
231 |
ExpectedError2=KSqlAtRow
|
sl@0
|
232 |
NoOperation3=
|
sl@0
|
233 |
|
sl@0
|
234 |
Function4=ReadBigTable
|
sl@0
|
235 |
EventuallyExpectedError=KErrNone
|
sl@0
|
236 |
LowCount=4
|
sl@0
|
237 |
HighCount=68
|
sl@0
|
238 |
CountStep=8
|
sl@0
|
239 |
Multiplier=2.81
|
sl@0
|
240 |
Text=Thread5
|
sl@0
|
241 |
AtRow5=False
|
sl@0
|
242 |
St_Close6=
|
sl@0
|
243 |
Close7=
|
sl@0
|
244 |
EndBlock8=
|
sl@0
|
245 |
|
sl@0
|
246 |
[Check6]
|
sl@0
|
247 |
Open0=C:\Concurrent.db
|
sl@0
|
248 |
Prepare1=select * from Con where(Sometext="Thread6");
|
sl@0
|
249 |
Next2=KSqlAtRow
|
sl@0
|
250 |
ExpectedError2=KSqlAtRow
|
sl@0
|
251 |
NoOperation3=
|
sl@0
|
252 |
|
sl@0
|
253 |
Function4=ReadBigTable
|
sl@0
|
254 |
EventuallyExpectedError=KErrNone
|
sl@0
|
255 |
LowCount=5
|
sl@0
|
256 |
HighCount=69
|
sl@0
|
257 |
CountStep=8
|
sl@0
|
258 |
Multiplier=-1.121
|
sl@0
|
259 |
Text=Thread6
|
sl@0
|
260 |
AtRow5=False
|
sl@0
|
261 |
St_Close6=
|
sl@0
|
262 |
Close7=
|
sl@0
|
263 |
EndBlock8=
|
sl@0
|
264 |
|
sl@0
|
265 |
[Check7]
|
sl@0
|
266 |
Open0=C:\Concurrent.db
|
sl@0
|
267 |
Prepare1=select * from Con where(Sometext="Thread7");
|
sl@0
|
268 |
Next2=KSqlAtRow
|
sl@0
|
269 |
ExpectedError2=KSqlAtRow
|
sl@0
|
270 |
NoOperation3=
|
sl@0
|
271 |
|
sl@0
|
272 |
Function4=ReadBigTable
|
sl@0
|
273 |
EventuallyExpectedError=KErrNone
|
sl@0
|
274 |
LowCount=6
|
sl@0
|
275 |
HighCount=70
|
sl@0
|
276 |
CountStep=8
|
sl@0
|
277 |
Multiplier=4.8e-21
|
sl@0
|
278 |
Text=Thread7
|
sl@0
|
279 |
AtRow5=False
|
sl@0
|
280 |
St_Close6=
|
sl@0
|
281 |
Close7=
|
sl@0
|
282 |
EndBlock8=
|
sl@0
|
283 |
|
sl@0
|
284 |
[Check8]
|
sl@0
|
285 |
Open0=C:\Concurrent.db
|
sl@0
|
286 |
Prepare1=select * from Con where(Sometext="Thread8");
|
sl@0
|
287 |
Next2=KSqlAtRow
|
sl@0
|
288 |
ExpectedError2=KSqlAtRow
|
sl@0
|
289 |
NoOperation3=
|
sl@0
|
290 |
|
sl@0
|
291 |
Function4=ReadBigTable
|
sl@0
|
292 |
EventuallyExpectedError=KErrNone
|
sl@0
|
293 |
LowCount=7
|
sl@0
|
294 |
HighCount=71
|
sl@0
|
295 |
CountStep=8
|
sl@0
|
296 |
Multiplier=3.141592654
|
sl@0
|
297 |
Text=Thread8
|
sl@0
|
298 |
AtRow5=False
|
sl@0
|
299 |
St_Close6=
|
sl@0
|
300 |
Close7=
|
sl@0
|
301 |
EndBlock8=
|
sl@0
|
302 |
|