1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/apputils/tsrc/T_RSCARCHIVE.CPP Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,511 @@
1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include <e32test.h>
1.20 +#include <bautils.h>
1.21 +#include <barsread2.h>
1.22 +#include <barsc2.h>
1.23 +#include <baspi.h>
1.24 +#include "BaArchiveImpl.h"
1.25 +
1.26 +
1.27 +LOCAL_D RTest TheTest(_L("T_RSCARCHIVE"));
1.28 +LOCAL_D RFs TheFs;
1.29 +
1.30 +//Test files
1.31 +_LIT(KXipSpiFile,"z:\\system\\data\\Spi_ECom.SPI");
1.32 +_LIT(KNonXipSpiFile, "c:\\system\\data\\Spi_ECom.SPI");
1.33 +
1.34 +
1.35 +//----------------------UTILITY FUNCTIONS----------------------------------
1.36 +LOCAL_C void CopyFileL(const TDesC& aFrom,const TDesC& aTo)
1.37 + {
1.38 + TheFs.Delete(aTo);
1.39 + CFileMan* man=CFileMan::NewL(TheFs);
1.40 + TInt r=man->Copy(aFrom,aTo, CFileMan::ERecurse);
1.41 + delete man;
1.42 + User::LeaveIfError(r);
1.43 + User::LeaveIfError(TheFs.SetAtt(aTo,0,KEntryAttReadOnly)); // clear RO
1.44 + }
1.45 +
1.46 +LOCAL_C void DeleteFile(const TDesC& aFileName)
1.47 + {
1.48 + // make sure the file is read/write
1.49 + TInt err = TheFs.SetAtt(aFileName, 0, KEntryAttReadOnly);
1.50 + if(err != KErrNone)
1.51 + {
1.52 + RDebug::Print(_L("error changing attributes file = %d"),err);
1.53 + }
1.54 + // delete the file
1.55 + err = BaflUtils::DeleteFile(TheFs, aFileName);
1.56 + if(err != KErrNone)
1.57 + {
1.58 + RDebug::Print(_L("error deleting file = %d"),err);
1.59 + }
1.60 + }
1.61 +
1.62 +LOCAL_C void DeleteTestFile()
1.63 + {
1.64 + DeleteFile(KNonXipSpiFile);
1.65 + //Testcase 1 files
1.66 + DeleteFile(_L("c:\\system\\data\\spi_ecom-0-0.spi"));
1.67 + DeleteFile(_L("c:\\system\\data\\spi_ecom-1-0.spi"));
1.68 + //Testcase 2 files
1.69 + DeleteFile(_L("c:\\system\\data\\ecom-1-0.spi"));
1.70 + DeleteFile(_L("c:\\system\\data\\ecom-1-0.s02"));
1.71 + DeleteFile(_L("c:\\system\\data\\ecom-2-0.spi"));
1.72 + DeleteFile(_L("c:\\system\\data\\ecom-2-0.s02"));
1.73 + //Testcase 3 files
1.74 + DeleteFile(_L("c:\\system\\data\\cecom-0-0.spi"));
1.75 + DeleteFile(_L("c:\\system\\data\\cecom-1-0.spi"));
1.76 + //Testcase 5 files
1.77 + DeleteFile(_L("c:\\system\\data\\spi_ecom_case-0-0.spi"));
1.78 + DeleteFile(_L("c:\\system\\data\\spi_ecom_case-1-0.spi"));
1.79 + }
1.80 +
1.81 +LOCAL_C void CopyTestFile()
1.82 + {
1.83 + CopyFileL(KXipSpiFile,KNonXipSpiFile);
1.84 + //Testcase1 files
1.85 + CopyFileL(_L("z:\\system\\data\\spi_ecom-0-0.spi"),_L("c:\\system\\data\\spi_ecom-0-0.spi"));
1.86 + CopyFileL(_L("z:\\system\\data\\spi_ecom-1-0.spi"),_L("c:\\system\\data\\spi_ecom-1-0.spi"));
1.87 + //Testcase2 files
1.88 + CopyFileL(_L("z:\\system\\data\\ecom-1-0.spi"),_L("c:\\system\\data\\ecom-1-0.spi"));
1.89 + CopyFileL(_L("z:\\system\\data\\ecom-1-0.s02"),_L("c:\\system\\data\\ecom-1-0.s02"));
1.90 + CopyFileL(_L("z:\\system\\data\\ecom-2-0.spi"),_L("c:\\system\\data\\ecom-2-0.spi"));
1.91 + CopyFileL(_L("z:\\system\\data\\ecom-2-0.s02"),_L("c:\\system\\data\\ecom-2-0.s02"));
1.92 + //Testcase 3 files
1.93 + CopyFileL(_L("z:\\system\\data\\cecom-0-0.spi"),_L("c:\\system\\data\\cecom-0-0.spi"));
1.94 + CopyFileL(_L("z:\\system\\data\\cecom-1-0.spi"),_L("c:\\system\\data\\cecom-1-0.spi"));
1.95 + //Testcase 5 files
1.96 + CopyFileL(_L("z:\\system\\data\\spi_ecom_case-0-0.spi"),_L("c:\\system\\data\\spi_ecom_case-0-0.spi"));
1.97 + CopyFileL(_L("z:\\system\\data\\spi_ecom_case-1-0.spi"),_L("c:\\system\\data\\spi_ecom_case-1-0.spi"));
1.98 + }
1.99 +
1.100 +//Test macroses and functions
1.101 +LOCAL_C void Check(TInt aValue, TInt aLine)
1.102 + {
1.103 + if(!aValue)
1.104 + {
1.105 + ::DeleteTestFile();
1.106 + TheTest(EFalse, aLine);
1.107 + }
1.108 + }
1.109 +
1.110 +#define TEST(arg) ::Check((arg), __LINE__)
1.111 +
1.112 +//---------------------TEST CASE for RResoureArchive------------------
1.113 +class RStaticPluginInfoTest
1.114 + {
1.115 +public:
1.116 + static void TestCase1L(const TDesC& aPath);
1.117 + static void TestCase2L(const TDesC& aPath);
1.118 + static void TestCase3L(const TDesC& aPath);
1.119 + static void TestCase4L(const TDesC& aPath);
1.120 + static void TestCase5L(const TDesC& aPath);
1.121 + };
1.122 +
1.123 +typedef void (*FunctionPtr)(const TDesC&);
1.124 +
1.125 +static void DoBasicTestingL(FunctionPtr aFunctionPtr,const TDesC& aPath,const TDesC& aDescription)
1.126 +{
1.127 + TheTest.Next(aDescription);
1.128 + __UHEAP_MARK;
1.129 + TInt startProcessHandleCount;
1.130 + TInt startThreadHandleCount;
1.131 + RThread().HandleCount(startProcessHandleCount, startThreadHandleCount);
1.132 +
1.133 + aFunctionPtr(aPath);
1.134 +
1.135 + TInt endProcessHandleCount;
1.136 + TInt endThreadHandleCount;
1.137 + RThread().HandleCount(endProcessHandleCount, endThreadHandleCount);
1.138 +
1.139 + TEST(startProcessHandleCount == endProcessHandleCount);
1.140 + TEST(startThreadHandleCount == endThreadHandleCount);
1.141 +
1.142 + __UHEAP_MARKEND;
1.143 +}
1.144 +
1.145 +
1.146 +static void DoOOMTestingL(FunctionPtr aFunctionPtr,const TDesC& aPath,const TDesC& aDescription)
1.147 +{
1.148 + TheTest.Next(aDescription);
1.149 + TInt err;
1.150 + TInt tryCount = 0;
1.151 + do
1.152 + {
1.153 + __UHEAP_MARK;
1.154 + // find out the number of open handles
1.155 + TInt startProcessHandleCount;
1.156 + TInt startThreadHandleCount;
1.157 + RThread().HandleCount(startProcessHandleCount, startThreadHandleCount);
1.158 + __UHEAP_SETFAIL(RHeap::EDeterministic, ++tryCount);
1.159 +
1.160 + TRAP(err,aFunctionPtr(aPath));
1.161 +
1.162 + __UHEAP_SETFAIL(RHeap::ENone, 0);
1.163 +
1.164 + //Add ReleaseLanguage for Test4
1.165 + BaflUtils::ReleaseIdealLanguage();
1.166 +
1.167 + // check that no handles have leaked
1.168 + TInt endProcessHandleCount;
1.169 + TInt endThreadHandleCount;
1.170 + RThread().HandleCount(endProcessHandleCount, endThreadHandleCount);
1.171 +
1.172 + TEST(startProcessHandleCount == endProcessHandleCount);
1.173 + TEST(startThreadHandleCount == endThreadHandleCount);
1.174 + __UHEAP_MARKEND;
1.175 + } while(err == KErrNoMemory);
1.176 + RDebug::Print(_L("Success at count=%d\n"),tryCount);
1.177 +}
1.178 +
1.179 +/**
1.180 +@SYMTestCaseID SYSLIB-BAFL-UT-1698
1.181 +@SYMTestCaseDesc Test for creating and deleting newly added constructor for CResourceArchiveImpl
1.182 +@SYMTestPriority High
1.183 +@SYMTestActions
1.184 +-create and delete CResourceArchiveImpl
1.185 +-check for the resource file entry from multiple spi files
1.186 +-and test for the replacing/hiding feature
1.187 +files used
1.188 +-----------------------------------------------------------
1.189 +spi_ecom-0-0.spi | spi_ecom-1-0.spi | Visible resources
1.190 +-----------------------------------------------------------
1.191 +Spi_EComRsc1 | hide Spi_EComRsc1 | Spi_EComRsc2(id=1)
1.192 +Spi_EComRsc2 | Spi_EComRsc2 | Spi_EComRsc3(id=0)
1.193 +Spi_EComRsc3 | Spi_EComRsc4 | Spi_EComRsc4(id=1)
1.194 +@SYMTestExpectedResults The test must not fail.
1.195 +@SYMREQ CR0759
1.196 +*/
1.197 +void RStaticPluginInfoTest::TestCase1L(const TDesC& aPath)
1.198 + {
1.199 + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-UT-1698 "));
1.200 + //create and delete
1.201 + CResourceArchiveImpl* impl=CResourceArchiveImpl::NewL(TheFs,aPath,_L("Spi_ECom"));
1.202 + delete impl;
1.203 +
1.204 + //check and read resource entry
1.205 + impl=CResourceArchiveImpl::NewL(TheFs,aPath,_L("Spi_ECom"));
1.206 + CleanupStack::PushL(impl);
1.207 + HBufC* rscName=NULL;
1.208 + CResourceFile* rscFile=NULL;
1.209 + TInt count=0;
1.210 + while (impl->NextResourceExist())
1.211 + {
1.212 + TFileName expectedFile;
1.213 + expectedFile.Append(aPath);
1.214 + //test the rsc entry file association
1.215 + if (count==0 || count==2)
1.216 + {
1.217 + expectedFile.Append(_L("spi_ecom-1-0.spi"));
1.218 + TEST(impl->iRscList[count].iFileNamePtr.Compare(expectedFile)==0);
1.219 + }
1.220 + else
1.221 + {
1.222 + expectedFile.Append(_L("spi_ecom-0-0.spi"));
1.223 + TEST(impl->iRscList[count].iFileNamePtr.Compare(expectedFile)==0);
1.224 + }
1.225 + count++;
1.226 + rscFile=impl->NextL(rscName);
1.227 + TEST(rscFile!=NULL);
1.228 + TEST(rscName!=NULL);
1.229 + TBuf<12> buf;
1.230 + TInt temp=count+1;
1.231 + buf.AppendFormat(_L("Spi_EComRsc%d"),temp);
1.232 + TEST(rscName->Compare(buf)==0);
1.233 + delete rscName;
1.234 + rscName=NULL;
1.235 + delete rscFile;
1.236 + rscFile=NULL;
1.237 + }
1.238 + TEST(count==3);
1.239 +
1.240 + //Testing Reset
1.241 + TEST(!impl->NextResourceExist());
1.242 + impl->Reset();
1.243 + TEST(impl->NextResourceExist());
1.244 +
1.245 + //Testing Type
1.246 + const TUid KEcomSpiFileTypeUid = {0x10205C2C};
1.247 + TEST(impl->Type()==KEcomSpiFileTypeUid);
1.248 +
1.249 + CleanupStack::PopAndDestroy();
1.250 + }
1.251 +
1.252 +
1.253 +/**
1.254 +@SYMTestCaseID SYSLIB-BAFL-CT-1695
1.255 +@SYMTestCaseDesc Test that loading of multiple localised spis return a correct list
1.256 +of resource files
1.257 +@SYMTestPriority High
1.258 +@SYMTestActions Set different language downgrade path before using CResourceArchiveImpl
1.259 +to open a path containing a mix of spi files. Check that the list returned when
1.260 +calling NextL contains the expected resource files.
1.261 +-------------------------------------------------------------------------------
1.262 +Ecom-1-0.spi | Ecom-1-0.s02 | Ecom-2-0.spi | Ecom-2-0.s02 |DGP(1) | DGP(2-1)
1.263 +ROFS(1) | (ROFS1) | (ROFS2) | (ROFS2) |
1.264 +-------------------------------------------------------------------------------
1.265 +A.RSC | A.R02 | B.RSC | Hide D.R02 |A.RSC(1) | A.R02(1)
1.266 +B.RSC | D.R02 | | C.R02 |B.RSC(2) | B.RSC(2)
1.267 +C.RSC | | | |C.RSC(1) | C.R02(2)
1.268 +-------------------------------------------------------------------------------
1.269 +@SYMTestExpectedResults The test must not fail.
1.270 +@SYMREQ CR0759
1.271 +*/
1.272 +void RStaticPluginInfoTest::TestCase2L(const TDesC& aPath)
1.273 + {
1.274 + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-1695 "));
1.275 + //Language DownGradePath(1)
1.276 + CResourceArchiveImpl* impl=CResourceArchiveImpl::NewL(TheFs,aPath,_L("ECom"));
1.277 + CleanupStack::PushL(impl);
1.278 + HBufC* rscName=NULL;
1.279 + CResourceFile* rscFile=NULL;
1.280 + TInt count=0;
1.281 + while (impl->NextResourceExist())
1.282 + {
1.283 + TFileName expectedFile;
1.284 + expectedFile.Append(aPath);
1.285 + rscFile=impl->NextL(rscName);
1.286 + if (count==0)
1.287 + {
1.288 + TEST(rscName->Compare(_L("Spi_EComRscA"))==0);
1.289 + //also testing the spi file association of the resource entry
1.290 + expectedFile.Append(_L("ecom-1-0.spi"));
1.291 + TEST(impl->iRscList[count].iFileNamePtr.Compare(expectedFile)==0);
1.292 + }
1.293 + if (count==1)
1.294 + {
1.295 + TEST(rscName->Compare(_L("Spi_EComRscB"))==0);
1.296 + expectedFile.Append(_L("ecom-2-0.spi"));
1.297 + TEST(impl->iRscList[count].iFileNamePtr.Compare(expectedFile)==0);
1.298 + }
1.299 + if (count==2)
1.300 + {
1.301 + TEST(rscName->Compare(_L("Spi_EComRscC"))==0);
1.302 + expectedFile.Append(_L("ecom-1-0.spi"));
1.303 + TEST(impl->iRscList[count].iFileNamePtr.Compare(expectedFile)==0);
1.304 + }
1.305 + count++;
1.306 + delete rscName;
1.307 + rscName=NULL;
1.308 + delete rscFile;
1.309 + rscFile=NULL;
1.310 + }
1.311 + TEST(count==3);
1.312 + CleanupStack::PopAndDestroy();
1.313 +
1.314 + //Language DownGradePath(2-1)
1.315 + User::LeaveIfError(BaflUtils::SetIdealLanguage(ELangFrench));
1.316 + impl=CResourceArchiveImpl::NewL(TheFs,aPath,_L("ECom"));
1.317 + CleanupStack::PushL(impl);
1.318 + rscName=NULL;
1.319 + rscFile=NULL;
1.320 + count=0;
1.321 + while (impl->NextResourceExist())
1.322 + {
1.323 + TFileName expectedFile;
1.324 + expectedFile.Append(aPath);
1.325 + rscFile=impl->NextL(rscName);
1.326 + if (count==0)
1.327 + {
1.328 + TEST(rscName->Compare(_L("Spi_EComRscA"))==0);
1.329 + //also testing the spi file association of the resource entry
1.330 + expectedFile.Append(_L("ecom-1-0.s02"));
1.331 + TEST(impl->iRscList[count].iFileNamePtr.Compare(expectedFile)==0);
1.332 + }
1.333 + if (count==1)
1.334 + {
1.335 + TEST(rscName->Compare(_L("Spi_EComRscB"))==0);
1.336 + expectedFile.Append(_L("ecom-2-0.spi"));
1.337 + TEST(impl->iRscList[count].iFileNamePtr.Compare(expectedFile)==0);
1.338 + }
1.339 + if (count==2)
1.340 + {
1.341 + TEST(rscName->Compare(_L("Spi_EComRscC"))==0);
1.342 + expectedFile.Append(_L("ecom-2-0.s02"));
1.343 + TEST(impl->iRscList[count].iFileNamePtr.Compare(expectedFile)==0);
1.344 + }
1.345 + count++;
1.346 + delete rscName;
1.347 + rscName=NULL;
1.348 + delete rscFile;
1.349 + rscFile=NULL;
1.350 + }
1.351 + TEST(count==3);
1.352 + CleanupStack::PopAndDestroy();
1.353 +
1.354 + BaflUtils::ReleaseIdealLanguage();
1.355 + }
1.356 +
1.357 +/**
1.358 +@SYMTestCaseID SYSLIB-BAFL-CT-1696
1.359 +@SYMTestCaseDesc Test opening corrupt file and an inconsistent list of spi files
1.360 +@SYMTestPriority High
1.361 +@SYMTestActions Try to open an invalid/corrupt spi file. Try to open a list
1.362 +of spi files where one of them has a different spi type, expect this to leave
1.363 +with KErrCorrupt.
1.364 +@SYMTestExpectedResults The test must not fail.
1.365 +@SYMREQ CR0759
1.366 +*/
1.367 +//negative testing using cecom-0-0.spi(Corrupt) and cecom-1-0.spi(OK)
1.368 +void RStaticPluginInfoTest::TestCase3L(const TDesC& aPath)
1.369 + {
1.370 + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-1696 "));
1.371 + TInt err=KErrNone;
1.372 + CResourceArchiveImpl* impl=NULL;
1.373 + //Testing opening single corrupt spi file
1.374 + TFileName filename;
1.375 + filename.Append(aPath);
1.376 + filename.Append(_L("cecom-0-0.spi"));
1.377 + TRAP(err,impl=CResourceArchiveImpl::NewL(TheFs,filename));
1.378 + if (err==KErrNoMemory)
1.379 + User::LeaveNoMemory();
1.380 + TEST(err==KErrCorrupt);
1.381 + delete impl;
1.382 +
1.383 + //Testing opening spi files where one is not a valid spi file
1.384 + TRAP(err,impl=CResourceArchiveImpl::NewL(TheFs,aPath,_L("CECom")));
1.385 + if (err==KErrNoMemory)
1.386 + User::LeaveNoMemory();
1.387 + TEST(err==KErrCorrupt);
1.388 + delete impl;
1.389 + }
1.390 +
1.391 +/**
1.392 +@SYMTestCaseID SYSLIB-BAFL-CT-1697
1.393 +@SYMTestCaseDesc Test opening file which does not exist
1.394 +@SYMTestPriority High
1.395 +@SYMTestActions Try to open spi files in a specified path but there
1.396 +is no file that matches the specified pattern to look for.
1.397 +@SYMTestExpectedResults The test must not fail.
1.398 +@SYMREQ CR0759
1.399 +*/
1.400 +void RStaticPluginInfoTest::TestCase4L(const TDesC& aPath)
1.401 + {
1.402 + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-1697 "));
1.403 + TInt err=KErrNone;
1.404 + TRAP(err,CResourceArchiveImpl* impl=CResourceArchiveImpl::NewL(TheFs,aPath,_L("SpiECom")));
1.405 + if (err==KErrNoMemory)
1.406 + User::LeaveNoMemory();
1.407 + TEST(err==KErrNotFound);
1.408 + }
1.409 +
1.410 +/**
1.411 +@SYMTestCaseID SYSLIB-BAFL-UT-3473
1.412 +@SYMTestCaseDesc Test that resource selection is case insensitive
1.413 +@SYMTestPriority High
1.414 +@SYMTestActions
1.415 +-create a CResourceArchiveImpl
1.416 +-check the correct resource file entry is chosen from multiple spi files
1.417 +------------------------------------------------------------------
1.418 +Spi_ECom_Case-0-0.spi | Spi_ECom_Case-1-0.spi | Visible resources
1.419 +------------------------------------------------------------------
1.420 +Spi_EComRsc1 | Spi_ECOMRSC1 | Spi_ECOMRSC1(id=1)
1.421 +Spi_ECOMRSC2 | Spi_EComRsc2 | Spi_EComRsc2(id=1)
1.422 +------------------------------------------------------------------
1.423 +@SYMTestExpectedResults The overridden resource is chosen regardless of case.
1.424 +@SYMDEF DEF105972
1.425 +@SYMUnit CResourceArchiveImpl::ProcessEntryL()
1.426 +*/
1.427 +void RStaticPluginInfoTest::TestCase5L(const TDesC& aPath)
1.428 + {
1.429 + //check and read resource entry
1.430 + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-UT-3473 "));
1.431 + CResourceArchiveImpl* impl=CResourceArchiveImpl::NewL(TheFs,aPath,_L("Spi_ECom_Case"));
1.432 + CleanupStack::PushL(impl);
1.433 + HBufC* rscName=NULL;
1.434 + CResourceFile* rscFile=NULL;
1.435 + TInt count=0;
1.436 + while (impl->NextResourceExist())
1.437 + {
1.438 + TFileName expectedFile;
1.439 + expectedFile.Append(aPath);
1.440 + //test that the overridden resource is always chosen
1.441 + expectedFile.Append(_L("spi_ecom_case-1-0.spi"));
1.442 + TEST(impl->iRscList[count].iFileNamePtr.CompareF(expectedFile)==0);
1.443 +
1.444 + count++;
1.445 + rscFile=impl->NextL(rscName);
1.446 + TEST(rscFile!=NULL);
1.447 + TEST(rscName!=NULL);
1.448 + delete rscName;
1.449 + rscName=NULL;
1.450 + delete rscFile;
1.451 + rscFile=NULL;
1.452 + }
1.453 + TEST(count==2);
1.454 +
1.455 + impl->Reset();
1.456 + CleanupStack::PopAndDestroy();
1.457 + }
1.458 +
1.459 +LOCAL_C void DoAllTestsL()
1.460 + {
1.461 + CleanupClosePushL(TheFs);
1.462 + User::LeaveIfError(TheFs.Connect());
1.463 +
1.464 + TheTest.Printf(_L("Copying SPI files to RAM\r\n"));
1.465 +
1.466 + //Copying test spi file and individual rsc files that are included inside spi
1.467 + CopyTestFile();
1.468 +
1.469 + //Basic Test
1.470 + DoBasicTestingL(RStaticPluginInfoTest::TestCase1L,_L("z:\\system\\data\\"),_L("Test Case 1 Basic Xip"));
1.471 + DoBasicTestingL(RStaticPluginInfoTest::TestCase1L,_L("c:\\system\\data\\"),_L("Test Case 1 Basic Non-Xip"));
1.472 + DoBasicTestingL(RStaticPluginInfoTest::TestCase2L,_L("z:\\system\\data\\"),_L("Test Case 2 Basic Xip"));
1.473 + DoBasicTestingL(RStaticPluginInfoTest::TestCase2L,_L("c:\\system\\data\\"),_L("Test Case 2 Basic Non-Xip"));
1.474 + DoBasicTestingL(RStaticPluginInfoTest::TestCase3L,_L("z:\\system\\data\\"),_L("Test Case 3 Basic Xip"));
1.475 + DoBasicTestingL(RStaticPluginInfoTest::TestCase3L,_L("c:\\system\\data\\"),_L("Test Case 3 Basic Non-Xip"));
1.476 + DoBasicTestingL(RStaticPluginInfoTest::TestCase4L,_L("z:\\system\\data\\"),_L("Test Case 4 Basic Xip"));
1.477 + DoBasicTestingL(RStaticPluginInfoTest::TestCase4L,_L("c:\\system\\data\\"),_L("Test Case 4 Basic Non-Xip"));
1.478 + DoBasicTestingL(RStaticPluginInfoTest::TestCase5L,_L("z:\\system\\data\\"),_L("Test Case 5 Basic Xip"));
1.479 + DoBasicTestingL(RStaticPluginInfoTest::TestCase5L,_L("c:\\system\\data\\"),_L("Test Case 5 Basic Non-Xip"));
1.480 +
1.481 + //OOM Test
1.482 + DoOOMTestingL(RStaticPluginInfoTest::TestCase1L,_L("z:\\system\\data\\"),_L("Test Case 1 OOM Xip"));
1.483 + DoOOMTestingL(RStaticPluginInfoTest::TestCase1L,_L("c:\\system\\data\\"),_L("Test Case 1 OOM Non-Xip"));
1.484 + DoOOMTestingL(RStaticPluginInfoTest::TestCase2L,_L("z:\\system\\data\\"),_L("Test Case 2 OOM Xip"));
1.485 + DoOOMTestingL(RStaticPluginInfoTest::TestCase2L,_L("c:\\system\\data\\"),_L("Test Case 2 OOM Non-Xip"));
1.486 + DoOOMTestingL(RStaticPluginInfoTest::TestCase3L,_L("z:\\system\\data\\"),_L("Test Case 3 OOM Xip"));
1.487 + DoOOMTestingL(RStaticPluginInfoTest::TestCase3L,_L("c:\\system\\data\\"),_L("Test Case 3 OOM Non-Xip"));
1.488 + DoOOMTestingL(RStaticPluginInfoTest::TestCase4L,_L("z:\\system\\data\\"),_L("Test Case 4 OOM Xip"));
1.489 + DoOOMTestingL(RStaticPluginInfoTest::TestCase4L,_L("c:\\system\\data\\"),_L("Test Case 4 OOM Non-Xip"));
1.490 + DoOOMTestingL(RStaticPluginInfoTest::TestCase5L,_L("z:\\system\\data\\"),_L("Test Case 5 OOM Xip"));
1.491 + DoOOMTestingL(RStaticPluginInfoTest::TestCase5L,_L("c:\\system\\data\\"),_L("Test Case 5 OOM Non-Xip"));
1.492 +
1.493 + //Clearing all the test files we have copied to C
1.494 + DeleteTestFile();
1.495 +
1.496 + CleanupStack::PopAndDestroy(1, &TheFs);
1.497 + }
1.498 +
1.499 +GLDEF_C TInt E32Main()
1.500 + {
1.501 + __UHEAP_MARK;
1.502 + CTrapCleanup *cleanup=CTrapCleanup::New();
1.503 + TheTest.Title();
1.504 + TheTest.Start(_L("Testing RResourceArchive internal class"));
1.505 + TRAPD(err,DoAllTestsL());
1.506 + TheTest.Printf(_L("Error code is %d\n"),err);
1.507 + TEST(err==KErrNone);
1.508 + TheTest.End();
1.509 + TheTest.Close();
1.510 + delete cleanup;
1.511 + __UHEAP_MARKEND;
1.512 + return(0);
1.513 + }
1.514 +