First public contribution.
1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "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.
21 //Constants taken from SqlSrvConfig.h
23 const TInt KDefaultSoftHeapLimitKb = 1024;
25 const TInt KDefaultSoftHeapLimitKb = 8192;
28 // Includes any code required for 'Code-Driven' testing, generally tests
29 // that cannot be data-driven (or not completely).
37 SetTestStepName(KSQLCDT);
41 // Look at 'arg' and call whichever function is required.
42 void CSQLCDT::ResolveTestFunctionL(const TDesC &acfgblk, const TInt acnnum,
45 _LIT(KTestFunction, "cdtest::ResolveTestFunction");
46 INFO_PRINTF3(_L("In %S, arg is %S"), &KTestFunction, &arg);
48 if(arg == _L("WriteBigTable"))
49 WriteBigTableL(acfgblk, acnnum);
50 else if(arg == _L("ReadBigTable"))
51 ReadBigTableL(acfgblk);
53 // This assumes that a ParameterIndex and ColumnIndex call has been
54 // set up previously - the apidxs/apicxs array access below will
55 // certainly PANIC if you haven't done the require preparation..
56 else if(arg == _L("CopyCellsUsingStreams"))
57 CopyCellsUsingStreamsL(acfgblk);
58 else if(arg == _L("WriteIntsToStream"))
59 WriteIntsToStream(acfgblk, acnnum);
60 else if(arg == _L("NearFillDisk"))
61 NearFillDisk(acfgblk);
62 else if(arg == _L("ScalarFullSelect"))
63 ScalarFullSelectL(acfgblk, acnnum);
64 else if(arg == _L("FilesDifferBySize"))
65 FilesDifferBySize(acfgblk, acnnum);
66 else if(arg == _L("SecurityPolicyCheck"))
67 SecurityPolicyCheck(acfgblk, acnnum);
68 else if(arg == _L("CollationTest"))
69 CollationTest(acfgblk, acnnum);
71 else User::Panic(_L("Unknown Function"), 42);
74 // ------------------------------------------------------------------------
76 // There's some hardwired nastiness in here - which we might be able to remove
77 // if we can restructure the code (with the parameter index array as a
78 // member variable in sqlfn), but until we can get reporting (INFO_PRINTF etc)
79 // working in new objects that isn't going to happen.
80 // There should have been a
81 // 'Insert into t(what, ever, whatever) values (:FInt, :FReal, :FText)'
82 // ... before this is called. Those on the right are the nasty hardwiring,
83 // and should correspond to integer, real, and text fields.
84 void CSQLCDT::WriteBigTableL(const TDesC &acfgblk, TInt acnnum )
86 _LIT(KTestFunction, "WriteBigTable");
88 // Parameters for the loop.
89 TInt low=1, high=10, step=1, experr = KErrNone;
90 TReal mult; TPtrC text, experrS;
91 FromConfig(KTestFunction, acfgblk, _L("LowCount"), low);
92 FromConfig(KTestFunction, acfgblk, _L("HighCount"), high);
93 FromConfig(KTestFunction, acfgblk, _L("CountStep"), step);
94 FromConfig(KTestFunction, acfgblk, _L("Multiplier"), mult);
95 FromConfig(KTestFunction, acfgblk, _L("Text"), text);
96 if( FromConfig(KTestFunction, acfgblk, _L("EventuallyExpectedError"), experrS) )
97 experr = ErrStringToEnum(experrS);
99 // First work out if out text is actually a filename..
101 textfromfile = BaflUtils::FileExists(irfs, text);
103 // Ahoy! Nasty hardwiring ahead!
104 TInt pidxi = ParamIndex(_L(":FInt"), acfgblk, 0 );
105 TInt pidxr = ParamIndex(_L(":FReal"), acfgblk, 0 );
106 TInt pidxt = ParamIndex(_L(":FText"), acfgblk, 0 );
109 for(i=low ; i<=high ; i+=step)
112 // Can use a stream write for speed to write the text to the disk. Don't
113 // make the file too big or a memory error (server side) will result.
115 SWBindTextL(pidxt, text, acfgblk, acnnum);
118 err = isqlst.BindText(pidxt, text);
119 ReportOnError( KTestFunction, _L("BindText"), acfgblk, acnnum, err );
123 err = isqlst.BindInt(pidxi, i);
124 ReportOnError( KTestFunction, _L("BindInt"), acfgblk, acnnum, err );
125 err = isqlst.BindReal(pidxr, tr);
126 ReportOnError( KTestFunction, _L("BindReal"), acfgblk, acnnum, err);
129 if((err != KErrNone) && (err == experr))
131 INFO_PRINTF1(HTML_GREEN);
132 INFO_PRINTF3(_L("Loop dropped out with expected error %S, i=%d"), &experrS, i );
133 INFO_PRINTF1(HTML_COLOUR_OFF);
136 else if(err < 0) // <0 a real error we weren't expecting.
138 ReportOnError( KTestFunction, _L("Exec"), acfgblk, acnnum, err );
139 INFO_PRINTF3(_L("%S: counter i is %d"), &KTestFunction, i );
143 err = isqlst.Reset();
144 ReportOnError( KTestFunction, _L("Reset"), acfgblk, acnnum, err );
151 void CSQLCDT::ReadBigTableL(const TDesC &acfgblk)
153 _LIT(KTestFunction, "ReadBigTable");
155 // Parameters for the loop.
156 TInt low=1, high=10, step=1, err;
157 TReal mult; TPtrC text;
158 FromConfig(KTestFunction, acfgblk, _L("LowCount"), low);
159 FromConfig(KTestFunction, acfgblk, _L("HighCount"), high);
160 FromConfig(KTestFunction, acfgblk, _L("CountStep"), step);
161 FromConfig(KTestFunction, acfgblk, _L("Multiplier"), mult);
162 FromConfig(KTestFunction, acfgblk, _L("Text"), text);
164 // First work out if out text is actually a filename..
166 textfromfile = BaflUtils::FileExists(irfs, text);
168 // Ahoy! Nasty hardwiring ahead!
169 TInt cidxi = ColumnIndex(_L("Someint"), acfgblk, 0 );
170 TInt cidxr = ColumnIndex(_L("Somereal"), acfgblk, 0 );
171 TInt cidxt = ColumnIndex(_L("Sometext"), acfgblk, 0 );
173 for(TInt i=low ; i<=high ; i+=step)
176 // INFO_PRINTF3(_L("CFGBLK: %S COUNT: %d"), &acfgblk, i);
178 TInt cint = isqlst.ColumnInt(cidxi);
179 TReal creal = isqlst.ColumnReal(cidxr);
180 if((cint != i) || (creal != tr))
182 SetTestStepResult(EFail);
183 INFO_PRINTF1(HTML_RED);
184 ERR_PRINTF4(_L("%S: ColumnInt gave %d, wanted %d"),
185 &KTestFunction, cint, i );
186 ERR_PRINTF4(_L("%S: ColumnReal gave %f, wanted %f"),
187 &KTestFunction, creal, tr );
188 INFO_PRINTF1(HTML_COLOUR_OFF);
191 // Now check the text..
193 SRColumnTextL(cidxt, text, acfgblk, -1 );
195 ColumnTextL(cidxt, text, acfgblk, -1 );
196 if(isqlst.Next()==KSqlAtEnd)
198 // This expected error was for *writing* the table - we don't
199 // get an error reading it back, just KSqlAtEnd. But lets assume
200 // that an expected error on write implies a short table and
201 // so no failure if we get KSqlAtEnd early.
202 INFO_PRINTF1(HTML_GREEN);
203 INFO_PRINTF3(_L("%S: Next gave KSqlAtEnd, i is %d"),
205 INFO_PRINTF1(HTML_COLOUR_OFF);
210 if( (err = isqlst.Next()) != KSqlErrMisuse )
212 SetTestStepResult(EFail);
213 INFO_PRINTF1(HTML_RED);
214 ERR_PRINTF3(_L("%S: Next gave %d, is there some table left? Expected KSqlErrMisuse"), &KTestFunction, err );
215 INFO_PRINTF1(HTML_COLOUR_OFF);
221 // Copy a single cell in a table using streams. We'll use the BindBinary
222 // and ColumnBinary methods of RSqlParamWriteStream and RSqlColumnReadStream
223 // respectively. Don't try to copy integers or reals, as the API spec
224 // says very clearly in a table, converting most of these to Binary
226 void CSQLCDT::CopyCellsUsingStreamsL(const TDesC &acfgblk)
228 _LIT(KTestFunction, "CopyCellUsingStreams");
230 // We only have one RSqlStatement around, and we must have two - a
231 // source and destination, so lets get another one - we'll write to
233 RSqlStatement sqlst2;
235 // The prepare statement used to add to the second table.
237 FromConfig(KTestFunction, acfgblk, _L("PrepareStatement"), prep);
238 // The parameter name (e.g :freddy) in the above.
240 FromConfig(KTestFunction, acfgblk, _L("ParamName"), paramname);
242 // Prepare and get pidx.
243 TInt err = sqlst2.Prepare(isqldb, prep);
244 TInt pidx = sqlst2.ParameterIndex(paramname);
246 // Whilst we're reading
247 while(isqlst.Next() == KSqlAtRow)
249 // First lets find a cell to copy. This assumes there is a single
251 // Set up where we're reading from. ColumnIndex will be zero.
252 // Obviously a prepare must already have been done.
253 RSqlColumnReadStream sqlr;
254 err = sqlr.ColumnText(isqlst, 0);
256 // Read a cell from the database as a stream. Pass that stream to
257 // another stream, an RSqlParamWriteStream to copy the cell into
260 // Get our writable stream..
261 RSqlParamWriteStream sqlw;
263 // Set up where we're writing to.
264 err = sqlw.BindText(sqlst2, pidx);
270 err = sqlst2.Reset();
276 // Write to 32-bit signed integers to a stream (a cell in a table) until
277 // the write operation Leaves with a KErrNoMem. A 'prepare' statement
278 // must already have been run, and a parameterindex also. We assume
279 // that the parameterindex is zero.
280 // If the user wants to do an Exec and Reset, that's up to them. That
281 // would end up sticking a NULL into the current cell though.
282 void CSQLCDT::WriteIntsToStream(const TDesC &acfgblk, const TInt acnnum)
285 _LIT(KTestFunction, "WriteIntsToStream");
287 // Get our writable stream..
288 RSqlParamWriteStream sqlw;
289 // Find out how many integers to write..
291 FromConfig(KTestFunction, acfgblk, _L("Count"), count);
292 if(count == -1) count = 2000000000;
294 // Assume only one 'ParameterIndex' has been run..
295 sqlw.BindBinary(isqlst,0);
298 for(i=0 ; i<count ; i++)
300 // A fast way to send a lot of data down a stream..
301 TRAP(leavecode, sqlw.WriteInt32L(i));
302 if(leavecode != KErrNone) break;
304 // Close the stream immediately. If we've run out of memory (a common test)
305 // this will free it up and allow (e.g) LogEngine to function so we get
306 // proper error reports.
309 ReportOnError( KTestFunction, _L("Stream Write"), acfgblk, acnnum, leavecode );
310 INFO_PRINTF3(_L("%S bound %d integers"), &KTestFunction, i );
315 //This function is needed for drives with more free space than KMaxTUint32 (4GB -1)
316 //This is because in a FAT32 file system, the maximum file size is (4GB-1)
317 //In the case where the free space is larger than this limit, this function will create additional
318 //file(s)until the disk is under the (4GB-1) limit. After that CSQLCDT::NearFillDisk will fill the
319 //disk up to the required amount.
320 void CSQLCDT::PrepareLargeDisk(const TDesC& /*acfgblk*/, const TDriveUnit atdu, TInt64 &atowrite)
322 _LIT(KTestFunction, "PrepareLargeDisk");
323 _LIT(KFillDiskName,"\\FillDisk");
324 _LIT(KFillDiskExt,".txt");
329 while(atowrite > KMaxTUint32)
331 RFile64 fillDiskFile;
332 fname.Copy(atdu.Name());
333 fname.Append(KFillDiskName);
334 fname.AppendNum(count);
335 fname.Append(KFillDiskExt);
337 if( (err = fillDiskFile.Create(irfs, fname, EFileWrite)) != KErrNone )
339 SetTestStepResult(EFail);
340 INFO_PRINTF1(HTML_RED);
341 ERR_PRINTF4(_L("%S: Failed to open RFile64 for file %S, err %d"),
342 &KTestFunction, &fname, err );
343 INFO_PRINTF1(HTML_COLOUR_OFF);
347 if( (err = fillDiskFile.SetSize(KMaxTUint32)) != KErrNone )
349 SetTestStepResult(EFail);
350 INFO_PRINTF1(HTML_RED);
351 ERR_PRINTF4(_L("%S: Failed on RFile64::SetSize for file %S, err %d"),
352 &KTestFunction, &fname, err );
353 INFO_PRINTF1(HTML_COLOUR_OFF);
354 fillDiskFile.Close();
358 fillDiskFile.Close();
359 atowrite-=KMaxTUint32;
364 // Create a file specified by 'FillFile' in the config and write to
365 // it until 'DiskFree' bytes remain. Note that because files use whole
366 // sectors (512/1024/2048/4096 or whatever bytes), that attempting to leave
367 // (e.g) 1023 bytes could result in 512 bytes remaining on a file system
368 // with 512 byte sectors, or zero bytes remaining if the sectors are bigger.
369 void CSQLCDT::NearFillDisk(const TDesC &acfgblk)
371 _LIT(KTestFunction, "NearFillDisk");
373 // What file should we use? Requires a full path.
375 (void)FromConfig(KTestFunction, acfgblk, _L("FillFile"), fillfile);
376 irfs.Delete(fillfile);
378 // Get the drive number. This method ignores trailing text.
379 // Probably wants upper case.
380 TDriveUnit tdu(fillfile);
382 // Find out how much disk we want left..
384 (void)FromConfig(KTestFunction, acfgblk, _L("DiskFree"), free);
386 // Find out how much disk space currently remains..
388 if((err = irfs.Volume(vol, tdu )) != KErrNone)
390 SetTestStepResult(EFail);
391 INFO_PRINTF1(HTML_RED);
392 ERR_PRINTF4(_L("%S: Failed to get volume info for %S, err %d"),
393 &KTestFunction, &fillfile, err );
394 INFO_PRINTF1(HTML_COLOUR_OFF);
398 // So how many bytes do we need to write?
399 TInt64 towrite = vol.iFree - free;
400 INFO_PRINTF4(_L("%S: Disk writing %Ld, free %Ld"), &KTestFunction,
401 towrite, vol.iFree );
402 INFO_PRINTF3(_L("%S: free %Ld"), &KTestFunction, vol.iFree );
403 INFO_PRINTF3(_L("%S: writing %Ld"), &KTestFunction, towrite );
407 SetTestStepResult(EFail);
408 INFO_PRINTF1(HTML_RED);
409 ERR_PRINTF3(_L("%S: Disk wanted remaining less than current(%Ld)"),
410 &KTestFunction, vol.iFree );
411 INFO_PRINTF1(HTML_COLOUR_OFF);
415 //In case the disk is large (i.e >4G -1 bytes) we need another function to
416 //create more files to fill it
417 PrepareLargeDisk(acfgblk, tdu, towrite);
421 if( (err = myfile.Create(irfs, fillfile, EFileWrite)) != KErrNone )
423 SetTestStepResult(EFail);
424 INFO_PRINTF1(HTML_RED);
425 ERR_PRINTF4(_L("%S: Failed to open RFile64 for file %S, err %d"),
426 &KTestFunction, &fillfile, err );
427 INFO_PRINTF1(HTML_COLOUR_OFF);
432 // We seem to hit trouble if we just try to write 'towrite' bytes, so
433 // here we write 50% of them and check the remainder repeatedly until
434 // the right amount remains. Actually it is unlikely to be exactly the
435 // right amount - depending on sector sizes and other factors the
436 // remaining space tends to be a kilobyte or two less than requested.
437 // Obviously this is likely to be different between file system types,
438 // between hardware and emulator and so on.
444 if(towrite < 1024) break;
445 TInt64 tow = towrite/2;
446 if(towrite < 4096) tow = towrite;
448 if( (err = myfile.SetSize(size)) != KErrNone )
450 SetTestStepResult(EFail);
451 INFO_PRINTF1(HTML_RED);
452 ERR_PRINTF4(_L("%S: Failed on RFile64::SetSize for file %S, err %d"),
453 &KTestFunction, &fillfile, err );
454 INFO_PRINTF1(HTML_COLOUR_OFF);
457 err = irfs.Volume(vol, tdu );
460 SetTestStepResult(EFail);
461 INFO_PRINTF1(HTML_RED);
462 ERR_PRINTF3(_L("%S: 2-RFs::Volume() has failed, err=%d"),
463 &KTestFunction, err);
464 INFO_PRINTF1(HTML_COLOUR_OFF);
467 towrite = vol.iFree - free;
470 err = irfs.Volume(vol, tdu );
473 SetTestStepResult(EFail);
474 INFO_PRINTF1(HTML_RED);
475 ERR_PRINTF3(_L("%S: 3-RFs::Volume() has failed, err=%d"),
476 &KTestFunction, err);
477 INFO_PRINTF1(HTML_COLOUR_OFF);
479 INFO_PRINTF3(_L("%S: Disk remaining is %Ld"), &KTestFunction, vol.iFree );
484 // This method exercises the TSqlScalarFullSelectQuery class, which is
485 // just a wrapper. Its methods expect a select statement whose result will
486 // be a single cell. Perhaps this should be in sqlfn.cpp.
487 void CSQLCDT::ScalarFullSelectL(const TDesC &acfgblk, const TInt acnnum)
490 _LIT(KTestFunction, "ScalarFullSelect");
492 // Look for an integer called 'Use_SetNN'.
494 TBuf<KConfigItemMaxNameLength> conS(_L("Use_Set"));
495 conS.AppendNum(acnnum);
496 FromConfig(KTestFunction, acfgblk, conS, useset);
497 // Look for a string called 'MethodNN'.
499 TBuf<KConfigItemMaxNameLength> methS(_L("Method"));
500 methS.AppendNum(acnnum);
501 FromConfig(KTestFunction, acfgblk, methS, meth);
502 // Look for a string called 'StatementNN'.
504 TBuf<KConfigItemMaxNameLength> stmtS(_L("Statement"));
505 stmtS.AppendNum(acnnum);
506 FromConfig(KTestFunction, acfgblk, stmtS, stmt);
507 // Convert the SQL statement to an UTF-8 version.
509 stmt8.Create(stmt.Length());
511 CleanupClosePushL(stmt8);
513 // Look for a string called 'ResultNN'.
515 TBuf<KConfigItemMaxNameLength> resS(_L("Result"));
516 resS.AppendNum(acnnum);
517 FromConfig(KTestFunction, acfgblk, resS, res);
518 // We may want to convert the expected result to a real or int or something
521 // Ok, now create a TSqlScalarFullSelectQuery object.
522 TSqlScalarFullSelectQuery *asfs;
523 TSqlScalarFullSelectQuery one(isqldb);
524 TSqlScalarFullSelectQuery two;
525 two.SetDatabase(isqldb);
526 // Use one of the above objects.
527 asfs = useset ? &two : &one;
529 // Get the action hash for this..
530 CSQLSFSTEFAction *cs = new CSQLSFSTEFAction();
531 TInt action = cs->GetNumFromString(meth);
534 case CSQLSFSTEFAction::ESFS_SelectIntL:
538 actual = asfs->SelectIntL(stmt8);
540 actual = asfs->SelectIntL(stmt);
543 if (res.CompareF(_L("DEFAULT_SOFT_HEAP_LIMIT")) == 0)
545 expected = KDefaultSoftHeapLimitKb;
552 if( actual != expected )
554 SetTestStepResult(EFail);
555 INFO_PRINTF1(HTML_RED);
556 ERR_PRINTF4(_L("%S: SelectIntL gave %d, wanted %d"),
557 &KTestFunction, actual, expected);
558 INFO_PRINTF1(HTML_COLOUR_OFF);
562 INFO_PRINTF1(HTML_GREEN);
563 INFO_PRINTF3(_L("%S: SelectIntL gave %d, as expected"),
564 &KTestFunction, actual);
565 INFO_PRINTF1(HTML_COLOUR_OFF);
570 case CSQLSFSTEFAction::ESFS_SelectInt64L:
574 actual = asfs->SelectInt64L(stmt8);
576 actual = asfs->SelectInt64L(stmt);
579 if( actual != expected )
581 SetTestStepResult(EFail);
582 INFO_PRINTF1(HTML_RED);
583 ERR_PRINTF4(_L("%S: SelectInt64L gave %d, wanted %d"),
584 &KTestFunction, actual, expected);
585 INFO_PRINTF1(HTML_COLOUR_OFF);
589 INFO_PRINTF1(HTML_GREEN);
590 INFO_PRINTF3(_L("%S: SelectInt64L gave %d, as expected"),
591 &KTestFunction, actual);
592 INFO_PRINTF1(HTML_COLOUR_OFF);
597 case CSQLSFSTEFAction::ESFS_SelectRealL:
601 actual = asfs->SelectRealL(stmt8);
603 actual = asfs->SelectRealL(stmt);
606 if( actual != expected )
608 SetTestStepResult(EFail);
609 INFO_PRINTF1(HTML_RED);
610 ERR_PRINTF4(_L("%S: SelectRealL gave %f, wanted %f"),
611 &KTestFunction, actual, expected);
612 INFO_PRINTF1(HTML_COLOUR_OFF);
616 INFO_PRINTF1(HTML_GREEN);
617 INFO_PRINTF3(_L("%S: SelectRealL gave %f, as expected"),
618 &KTestFunction, actual);
619 INFO_PRINTF1(HTML_COLOUR_OFF);
624 case CSQLSFSTEFAction::ESFS_SelectTextL:
627 actual.Create(32768);
628 CleanupClosePushL(actual);
631 rc = asfs->SelectTextL(stmt8, actual);
633 rc = asfs->SelectTextL(stmt, actual);
636 SetTestStepResult(EFail);
637 INFO_PRINTF1(HTML_RED);
638 ERR_PRINTF4(_L("%S: SelectTextL gave %S, wanted %S"),
639 &KTestFunction, &actual, &res);
640 INFO_PRINTF1(HTML_COLOUR_OFF);
644 INFO_PRINTF1(HTML_GREEN);
645 INFO_PRINTF3(_L("%S: SelectTextL gave %S, as expected"),
646 &KTestFunction, &actual);
647 INFO_PRINTF1(HTML_COLOUR_OFF);
649 ReportOnError( KTestFunction, _L("SelectTextL"), acfgblk, acnnum,
651 CleanupStack::PopAndDestroy(1, &actual);
655 case CSQLSFSTEFAction::ESFS_SelectBinaryL:
658 actual.Create(32768);
659 CleanupClosePushL(actual);
662 rc = asfs->SelectBinaryL(stmt8, actual);
664 rc = asfs->SelectBinaryL(stmt, actual);
665 ReportOnError( KTestFunction, _L("SelectBinaryL"), acfgblk, acnnum, rc );
668 TInt rc2 = CompareBinaryAgainstFileL(actual, res);
671 SetTestStepResult(EFail);
672 INFO_PRINTF1(HTML_RED);
673 ERR_PRINTF3(_L("%S: File compare gave error %d"),
674 &KTestFunction, rc2 );
675 INFO_PRINTF1(HTML_COLOUR_OFF);
679 INFO_PRINTF1(HTML_GREEN);
680 _LIT(KSelectBinaryStr, "SelectBinaryL");
681 ERR_PRINTF3(_L("%S: File compare successful, %S"), &KTestFunction, &KSelectBinaryStr);
682 INFO_PRINTF1(HTML_COLOUR_OFF);
686 CleanupStack::PopAndDestroy(1, &actual);
690 default: User::Panic(_L("Unknown Function"), 49);
693 CleanupStack::PopAndDestroy(1, &stmt8);
696 // Verifies that two files differ by size.
697 void CSQLCDT::FilesDifferBySize(const TDesC &acfgblk, const TInt acnnum)
700 _LIT(KTestFunction, "FilesDifferBySize");
702 // Look for a string called 'FileANN'.
704 TBuf<KConfigItemMaxNameLength> fileaS(_L("FileA"));
705 fileaS.AppendNum(acnnum);
706 FromConfig(KTestFunction, acfgblk, fileaS, filea);
707 // Look for a string called 'FileBNN'.
709 TBuf<KConfigItemMaxNameLength> filebS(_L("FileB"));
710 filebS.AppendNum(acnnum);
711 FromConfig(KTestFunction, acfgblk, filebS, fileb);
713 TInt fza = FileSize(filea);
714 TInt fzb = FileSize(fileb);
717 SetTestStepResult(EFail);
718 INFO_PRINTF1(HTML_RED);
719 ERR_PRINTF4(_L("%S: File A %d, File B %d"), &KTestFunction, fza, fzb);
720 INFO_PRINTF1(HTML_COLOUR_OFF);
724 INFO_PRINTF1(HTML_GREEN);
725 INFO_PRINTF6(_L("%S: Files %S and %S differ in size as expected, %d, %d"), &KTestFunction, &fileaS, &filebS, fza, fzb);
726 INFO_PRINTF1(HTML_COLOUR_OFF);
730 // Tests the method that retrive security policies.
731 void CSQLCDT::SecurityPolicyCheck(const TDesC &/*acfgblk*/, const TInt /*acnnum*/)
733 // _LIT(KTestFunction, "SecurityPolicyCheck");
735 // The methods to be tested here have been tested in the developer test:
736 // t_sqlsecurityXX.cpp. The work here has been deferred because it has been
737 // duplicated in the unit tests.
740 // Tests for Locale change
741 // This test has been deferred pending a defect fix, defect is:
742 // DEF091753 "Initialize locale" should be part of the system startup
743 void CSQLCDT::CollationTest(const TDesC &/*acfgblk*/, const TInt /*acnnum*/)
745 TExtendedLocale myExtendedLocale;
746 myExtendedLocale.LoadSystemSettings();
748 #ifdef SYMBIAN_DISTINCT_LOCALE_MODEL
750 TBuf<100> DllLanguage;
751 DllLanguage.Copy(_L("elocl_lan.003"));
754 DllRegion.Copy(_L("elocl_reg.056"));
756 TBuf<100> DllCollation;
757 DllCollation.Copy(_L("elocl_col.003"));
760 TInt err = myExtendedLocale.LoadLocale(DllLanguage, DllRegion, DllCollation);
765 DllName.Copy(_L("elocl.sc"));
767 // Change the locale to Scandinavian Locale
768 TInt err = myExtendedLocale.LoadLocale(DllName);
771 if( err != KErrNone )
773 _LIT(KTestFunction, "CollationTest");
774 SetTestStepResult(EFail);
775 INFO_PRINTF1(HTML_RED);
776 ERR_PRINTF4(_L("%S: TExtendedLocale::LoadLocale gave %d, wanted %d"),
777 &KTestFunction, err, KErrNone);
778 INFO_PRINTF1(HTML_COLOUR_OFF);
781 // Save the changes to system settings
782 myExtendedLocale.SaveSystemSettings();
785 User::After(1000000);