os/ossrv/lowlevellibsandfws/apputils/tsrc/t_bafllang.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/lowlevellibsandfws/apputils/tsrc/t_bafllang.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,501 @@
     1.4 +// Copyright (c) 2004-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 <f32file.h>
    1.20 +#include <e32test.h>
    1.21 +#include <bautils.h>
    1.22 +#include <hal.h>
    1.23 +#include <e32std.h>
    1.24 +
    1.25 +LOCAL_D CTrapCleanup*		TheTrapCleanup=NULL;
    1.26 +
    1.27 +LOCAL_D RTest				TheTest (_L("T_BaflLang"));
    1.28 +LOCAL_D RFs					TheFs;
    1.29 +
    1.30 +// Our test diectory and files...
    1.31 +
    1.32 +_LIT (KNullFilename, "");
    1.33 +_LIT (KRscFilename,  "C:\\abc.rsc");
    1.34 +_LIT (KRscFilenameNoSuffix,  "C:\\abc.");
    1.35 +
    1.36 +_LIT (KAmericanLang, "C:\\abc.r10");
    1.37 +_LIT (KFrenchLang,   "C:\\abc.r02");
    1.38 +_LIT (KJapanEnglishLang, "C:\\abc.r160");
    1.39 +_LIT (KEnglishLang, "C:\\abc.r01");
    1.40 +
    1.41 +LOCAL_C void DeleteTestFiles()
    1.42 +{
    1.43 +	User::LeaveIfError (TheFs.Connect ());
    1.44 +	::CleanupClosePushL (TheFs);
    1.45 +
    1.46 +	BaflUtils::DeleteFile (TheFs, KRscFilename);
    1.47 +	BaflUtils::DeleteFile (TheFs, KAmericanLang);
    1.48 +	BaflUtils::DeleteFile (TheFs, KFrenchLang);
    1.49 +	BaflUtils::DeleteFile (TheFs, KJapanEnglishLang);
    1.50 +	BaflUtils::DeleteFile (TheFs, KEnglishLang);
    1.51 +
    1.52 +	CleanupStack::PopAndDestroy (&::TheFs);
    1.53 +}
    1.54 +
    1.55 +//
    1.56 +//Test macroses and functions
    1.57 +LOCAL_C void Check(TInt aValue, TInt aLine)
    1.58 +	{
    1.59 +	if(!aValue)
    1.60 +		{
    1.61 +		::DeleteTestFiles();
    1.62 +		TheTest(EFalse, aLine);
    1.63 +		}
    1.64 +	}
    1.65 +
    1.66 +#define TEST(arg) ::Check((arg), __LINE__)
    1.67 +
    1.68 +LOCAL_C void CreateTestFiles()
    1.69 +{
    1.70 +	User::LeaveIfError (TheFs.Connect ());
    1.71 +	::CleanupClosePushL (TheFs);
    1.72 +	TEST (BaflUtils::FileExists (TheFs, KRscFilename) == EFalse);
    1.73 +	TEST (BaflUtils::FileExists (TheFs, KAmericanLang) == EFalse);
    1.74 +	TEST (BaflUtils::FileExists (TheFs, KFrenchLang) == EFalse);
    1.75 +	TEST (BaflUtils::FileExists (TheFs, KJapanEnglishLang) == EFalse);
    1.76 +	TEST (BaflUtils::FileExists (TheFs, KEnglishLang) == EFalse);
    1.77 +
    1.78 +	// Create the files...
    1.79 +	RFile rFile;
    1.80 +	// KFilename1 can't be created
    1.81 +	rFile.Create (TheFs, KRscFilename, EFileRead);
    1.82 +	rFile.Close ();
    1.83 +	rFile.Create (TheFs, KAmericanLang, EFileRead);
    1.84 +	rFile.Close ();
    1.85 +	rFile.Create (TheFs, KFrenchLang, EFileRead);
    1.86 +	rFile.Close ();
    1.87 +
    1.88 +	CleanupStack::PopAndDestroy (&::TheFs);
    1.89 +
    1.90 +}
    1.91 +
    1.92 +/**
    1.93 +@SYMTestCaseID SYSLIB-BAFL-CT-0070
    1.94 +@SYMTestCaseDesc Tests the configuration of the ideal language.
    1.95 +@SYMTestPriority High
    1.96 +@SYMTestActions  Set the ideal language and look for nearest language files.
    1.97 +@SYMTestExpectedResults The test must not fail.
    1.98 +@SYMREQ 3770: Configurable "ideal language" in BaflUtils::NearestLanguageFile.
    1.99 +*/
   1.100 +void REQ3770L()
   1.101 +	{
   1.102 +    TheTest.Next (_L (" @SYMTestCaseID SYSLIB-BAFL-CT-0070 REQ3770L "));
   1.103 +
   1.104 +    __UHEAP_MARK;
   1.105 +
   1.106 +	User::LeaveIfError (TheFs.Connect ());
   1.107 +	::CleanupClosePushL (TheFs);
   1.108 +
   1.109 +	TBuf <256> filename;
   1.110 +	TLanguage language;
   1.111 +
   1.112 +	// Test ideal language code
   1.113 +
   1.114 +	// Check initial value of ideal language
   1.115 +
   1.116 +	language=BaflUtils::IdealLanguage();
   1.117 +	TEST(language == ELangNone);
   1.118 +
   1.119 +	// Set and read back the ideal language
   1.120 +
   1.121 +	BaflUtils::SetIdealLanguage( ELangGerman);
   1.122 +	language=BaflUtils::IdealLanguage();
   1.123 +	TEST(language == ELangGerman);
   1.124 +
   1.125 +	BaflUtils::SetIdealLanguage( ELangAmerican);
   1.126 +	language=BaflUtils::IdealLanguage();
   1.127 +	TEST(language == ELangAmerican);
   1.128 +
   1.129 +	// Test NearestLanguageFile with empty name
   1.130 +	TFileName resPath;
   1.131 +	BaflUtils::NearestLanguageFile (TheFs, resPath);
   1.132 +	TEST(resPath.Length()==0);
   1.133 +	TheTest.Printf (_L ("The NearestLanguageFile for the null file - %S - is - %S -\n"), &KNullFilename, &filename);
   1.134 +
   1.135 +	// Test NearestLanguageFile with no suffix
   1.136 +	filename.Copy (KRscFilenameNoSuffix);
   1.137 +	BaflUtils::NearestLanguageFile (TheFs, filename);
   1.138 +	TEST(filename==KRscFilenameNoSuffix);
   1.139 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KRscFilenameNoSuffix, &filename);
   1.140 +
   1.141 +	// Test NearestLanguageFile
   1.142 +	filename.Copy (KRscFilename);
   1.143 +	BaflUtils::NearestLanguageFile (TheFs, filename);
   1.144 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KRscFilename, &filename);
   1.145 +	TEST(filename == KAmericanLang);
   1.146 +
   1.147 +	// Set ideal language to one we don't have
   1.148 +	BaflUtils::SetIdealLanguage( ELangGerman);
   1.149 +	language=BaflUtils::IdealLanguage();
   1.150 +	TEST(language == ELangGerman);
   1.151 +
   1.152 +	// Test NearestLanguageFile
   1.153 +	filename.Copy (KRscFilename);
   1.154 +	BaflUtils::NearestLanguageFile (TheFs, filename);
   1.155 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KRscFilename, &filename);
   1.156 +	TEST(filename == KRscFilename);
   1.157 +
   1.158 +	// Restore ideal language to default
   1.159 +	BaflUtils::SetIdealLanguage( ELangNone);
   1.160 +	language=BaflUtils::IdealLanguage();
   1.161 +	TEST(language == ELangNone);
   1.162 +
   1.163 +	// Test NearestLanguageFile
   1.164 +	filename.Copy (KRscFilename);
   1.165 +	BaflUtils::NearestLanguageFile (TheFs, filename);
   1.166 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KRscFilename, &filename);
   1.167 +	TEST(filename == KRscFilename);
   1.168 +
   1.169 +	// Set ideal language to French
   1.170 +
   1.171 +	BaflUtils::SetIdealLanguage( ELangFrench);
   1.172 +	language=BaflUtils::IdealLanguage();
   1.173 +	TEST(language == ELangFrench);
   1.174 +
   1.175 +	// Test NearestLanguageFile
   1.176 +	filename.Copy (KRscFilename);
   1.177 +	BaflUtils::NearestLanguageFile (TheFs, filename);
   1.178 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KRscFilename, &filename);
   1.179 +	TEST(filename == KFrenchLang);
   1.180 +
   1.181 +	// Restore ideal language to default
   1.182 +	BaflUtils::SetIdealLanguage( ELangNone);
   1.183 +	language=BaflUtils::IdealLanguage();
   1.184 +	TEST(language == ELangNone);
   1.185 +
   1.186 +	// Release ideal language - free's TLS
   1.187 +
   1.188 +	BaflUtils::ReleaseIdealLanguage();
   1.189 +
   1.190 +	CleanupStack::PopAndDestroy (&::TheFs);
   1.191 +
   1.192 +	__UHEAP_MARKEND;
   1.193 +	}
   1.194 +
   1.195 +/**
   1.196 +@SYMTestCaseID SYSLIB-BAFL-CT-0071
   1.197 +@SYMTestCaseDesc Tests the overload of BaflUtils::NearestLanguageFile.
   1.198 +@SYMTestPriority High
   1.199 +@SYMTestActions  Calls the overload of BaflUtils::NearestLanguageFile and checks the returned language.
   1.200 +@SYMTestExpectedResults The test must not fail.
   1.201 +@SYMREQ 3785: Overload of BaflUtils::NearestLanguageFile.
   1.202 +*/
   1.203 +void REQ3785L()
   1.204 +	{
   1.205 +    TheTest.Next (_L (" @SYMTestCaseID SYSLIB-BAFL-CT-0071 REQ3785L "));
   1.206 +
   1.207 +    __UHEAP_MARK;
   1.208 +
   1.209 +	User::LeaveIfError (TheFs.Connect ());
   1.210 +	::CleanupClosePushL (TheFs);
   1.211 +
   1.212 +	TBuf <256> filename;
   1.213 +	TLanguage language;
   1.214 +
   1.215 +	// Ensure that ideal language is default
   1.216 +	BaflUtils::SetIdealLanguage( ELangNone);
   1.217 +	language=BaflUtils::IdealLanguage();
   1.218 +	TEST(language == ELangNone);
   1.219 +
   1.220 +	// Test NearestLanguageFile overload with language returned
   1.221 +	language=ELangAmerican;
   1.222 +	filename.Copy (KRscFilename);
   1.223 +	BaflUtils::NearestLanguageFile (TheFs, filename, language);
   1.224 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S, language = %d\n"), &KRscFilename, &filename, language);
   1.225 +	TEST(language == ELangNone);
   1.226 +	TEST(filename == KRscFilename);
   1.227 +
   1.228 +	// Set ideal language to American
   1.229 +
   1.230 +	BaflUtils::SetIdealLanguage( ELangAmerican);
   1.231 +	language=BaflUtils::IdealLanguage();
   1.232 +	TEST(language == ELangAmerican);
   1.233 +
   1.234 +	// Test NearestLanguageFile overload with language returned
   1.235 +	language=ELangNone;
   1.236 +	filename.Copy (KRscFilename);
   1.237 +	BaflUtils::NearestLanguageFile (TheFs, filename, language);
   1.238 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S, language = %d\n"), &KRscFilename, &filename, language);
   1.239 +	TEST(language == ELangAmerican);
   1.240 +	TEST(filename == KAmericanLang);
   1.241 +
   1.242 +	// Set ideal language to French
   1.243 +
   1.244 +	BaflUtils::SetIdealLanguage( ELangFrench);
   1.245 +	language=BaflUtils::IdealLanguage();
   1.246 +	TEST(language == ELangFrench);
   1.247 +
   1.248 +	// Test NearestLanguageFile overload with language returned
   1.249 +	language=ELangNone;
   1.250 +	filename.Copy (KRscFilename);
   1.251 +	BaflUtils::NearestLanguageFile (TheFs, filename, language);
   1.252 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S, language = %d\n"), &KRscFilename, &filename, language);
   1.253 +	TEST(language == ELangFrench);
   1.254 +	TEST(filename == KFrenchLang);
   1.255 +
   1.256 +	// Set ideal language to one we don't have
   1.257 +	BaflUtils::SetIdealLanguage( ELangGerman);
   1.258 +	language=BaflUtils::IdealLanguage();
   1.259 +	TEST(language == ELangGerman);
   1.260 +
   1.261 +	// Test NearestLanguageFile overload with language returned
   1.262 +	language=ELangAmerican;
   1.263 +	filename.Copy (KRscFilename);
   1.264 +	BaflUtils::NearestLanguageFile (TheFs, filename, language);
   1.265 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S, language = %d\n"), &KRscFilename, &filename, language);
   1.266 +	TEST(language == ELangNone);
   1.267 +	TEST(filename == KRscFilename);
   1.268 +
   1.269 +	// Restore ideal language to default
   1.270 +	BaflUtils::SetIdealLanguage( ELangNone);
   1.271 +	language=BaflUtils::IdealLanguage();
   1.272 +	TEST(language == ELangNone);
   1.273 +
   1.274 +	// Release ideal language - free's TLS
   1.275 +
   1.276 +	BaflUtils::ReleaseIdealLanguage();
   1.277 +
   1.278 +	CleanupStack::PopAndDestroy (&::TheFs);
   1.279 +
   1.280 +	__UHEAP_MARKEND;
   1.281 +	}
   1.282 +
   1.283 +/**
   1.284 +@SYMTestCaseID SYSLIB-BAFL-CT-3158
   1.285 +@SYMTestCaseDesc Test the downgrade path from ELangMalay_Apac to ELangMalay
   1.286 +@SYMTestPriority High
   1.287 +@SYMTestActions Calls the BaflUtils::GetDowngradePathL function to check that ELangMalay_Apac downgrades to ELangMalay
   1.288 +@SYMTestExpectedResults The test must not fail.
   1.289 +@SYMDEF DEF094490
   1.290 +*/
   1.291 +void DEF094490L()
   1.292 +	{
   1.293 +    TheTest.Next (_L (" @SYMTestCaseID SYSLIB-BAFL-CT-3158 DEF094490L "));
   1.294 +
   1.295 +	__UHEAP_MARK;
   1.296 +
   1.297 +	User::LeaveIfError (TheFs.Connect ());
   1.298 +	::CleanupClosePushL (TheFs);
   1.299 +	RArray<TLanguage> aLanguageArray;
   1.300 +
   1.301 +	//Test GetDowngradePathL to see if ELangMalay is included in the path
   1.302 +	BaflUtils::GetDowngradePathL(TheFs,ELangMalay_Apac,aLanguageArray);
   1.303 +	TEST(aLanguageArray.Find(ELangMalay)!= KErrNotFound);
   1.304 +
   1.305 +	aLanguageArray.Close();
   1.306 +
   1.307 +	CleanupStack::PopAndDestroy (&::TheFs);
   1.308 +
   1.309 +	__UHEAP_MARKEND;
   1.310 +	}
   1.311 +
   1.312 +/**
   1.313 +@SYMTestCaseID SYSLIB-BAFL-CT-3359
   1.314 +@SYMTestCaseDesc Test correct and incorrect usage of NearestLanguageFile as documented in the developer library
   1.315 +@SYMTestPriority High
   1.316 +@SYMTestActions Calls the BaflUtils::NearestLanguageFile function with different contructed
   1.317 +language downgrade path cases along with different input paths
   1.318 +@SYMTestExpectedResults The test must not fail.
   1.319 +@SYMDEF DEF096421
   1.320 +*/
   1.321 +void DEF096421L()
   1.322 +	{
   1.323 +    TheTest.Next (_L (" @SYMTestCaseID SYSLIB-BAFL-CT-3359 DEF096421 "));
   1.324 +	__UHEAP_MARK;
   1.325 +
   1.326 +	TBuf <256> path;
   1.327 +	TLanguage language;
   1.328 +	RFile rFile;
   1.329 +
   1.330 +	//number of characters in the suffix is less than KInvNameAndMinSuffixLength(2)
   1.331 +	_LIT (KInvalidSuffix1, "C:\\abc.r");
   1.332 +
   1.333 +	//number of digits in the suffix is more than KMaxSuffixLength(5)
   1.334 +	_LIT (KInvalidSuffix2, "C:\\abc.r123456");
   1.335 +
   1.336 +	//no proceeding alphabetical characters in the suffix
   1.337 +	_LIT (KInvalidSuffix3, "C:\\abc.10");
   1.338 +
   1.339 +	//no drive letters supplied in the path
   1.340 +	_LIT (KRscFilenameNoDrive, "\\abc.rsc");
   1.341 +
   1.342 +	_LIT (KRscFileInZDrive, "\\system\\data\\T_CALYPSO_TEST_RESOURCE_FILE_1.RSC");
   1.343 +	_LIT (KRScFullFile, "Z:\\system\\data\\T_CALYPSO_TEST_RESOURCE_FILE_1.RSC");
   1.344 +
   1.345 +	User::LeaveIfError (TheFs.Connect ());
   1.346 +	::CleanupClosePushL (TheFs);
   1.347 +
   1.348 +	rFile.Create (TheFs, KJapanEnglishLang, EFileRead);
   1.349 +	rFile.Close ();
   1.350 +	rFile.Create (TheFs, KEnglishLang, EFileRead);
   1.351 +	rFile.Close ();
   1.352 +
   1.353 +	BaflUtils::SetIdealLanguage( ELangAmerican);
   1.354 +	language=BaflUtils::IdealLanguage();
   1.355 +	TEST(language == ELangAmerican);
   1.356 +
   1.357 +	//Test match for the ideal language
   1.358 +	path.Copy(KRscFilename);
   1.359 +	BaflUtils::NearestLanguageFile (TheFs, path, language);
   1.360 +	TEST(path == KAmericanLang);
   1.361 +	TEST(language == ELangAmerican);
   1.362 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KRscFilename, &path);
   1.363 +
   1.364 +	//Test match when supplied with the language file
   1.365 +	path.Copy(KAmericanLang);
   1.366 +	BaflUtils::NearestLanguageFile (TheFs, path, language);
   1.367 +	TEST(path == KAmericanLang);
   1.368 +	TEST(language == ELangAmerican);
   1.369 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KAmericanLang, &path);
   1.370 +
   1.371 +	//Test when the no. of characters in the suffix is less than KInvNameAndMinSuffixLength(2)
   1.372 +	path.Copy(KInvalidSuffix1);
   1.373 +	BaflUtils::NearestLanguageFile (TheFs, path, language);
   1.374 +	TEST(path == KInvalidSuffix1);
   1.375 +	TEST(language == ELangNone);
   1.376 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KInvalidSuffix1, &path);
   1.377 +
   1.378 +	//Test when filename ends with a period
   1.379 +	path.Copy(KRscFilenameNoSuffix);
   1.380 +	BaflUtils::NearestLanguageFile (TheFs, path, language);
   1.381 +	TEST(path == KRscFilenameNoSuffix);
   1.382 +	TEST(language == ELangNone);
   1.383 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KRscFilenameNoSuffix, &path);
   1.384 +
   1.385 +	//Test when the no. of digits in the suffix is more than KMaxSuffixLength(5)
   1.386 +	path.Copy(KInvalidSuffix2);
   1.387 +	BaflUtils::NearestLanguageFile (TheFs, path, language);
   1.388 +	TEST(path == KInvalidSuffix2);
   1.389 +	TEST(language == ELangNone);
   1.390 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KInvalidSuffix2, &path);
   1.391 +
   1.392 +	//Test when theres no proceeding alphabetical characters in the suffix
   1.393 +	path.Copy(KInvalidSuffix3);
   1.394 +	BaflUtils::NearestLanguageFile (TheFs, path, language);
   1.395 +	TEST(path == KInvalidSuffix3);
   1.396 +	TEST(language == ELangNone);
   1.397 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KInvalidSuffix3, &path);
   1.398 +
   1.399 +	//Test when no drive letter is supplied in the path and theres no corresponding file in Z:
   1.400 +	path.Copy(KRscFilenameNoDrive);
   1.401 +	BaflUtils::NearestLanguageFile (TheFs, path, language);
   1.402 +	TEST(path == KRscFilenameNoDrive);
   1.403 +	TEST(language == ELangNone);
   1.404 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KRscFilenameNoDrive, &path);
   1.405 +
   1.406 +	BaflUtils::SetIdealLanguage(ELangEnglish_Japan);
   1.407 +	TheTest.Printf(_L("The ideal langauge set to ELangEnglish_Japan\n"));
   1.408 +
   1.409 +	//Test when the matching language file is 3 digits long
   1.410 +	path.Copy(KRscFilename);
   1.411 +	BaflUtils::NearestLanguageFile (TheFs, path, language);
   1.412 +	TEST(path == KJapanEnglishLang);
   1.413 +	TEST(language == ELangEnglish_Japan);
   1.414 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KRscFilename, &path);
   1.415 +
   1.416 +	BaflUtils::DeleteFile (TheFs, KJapanEnglishLang);
   1.417 +	TheTest.Printf(_L("Deleting C:\\abc.r160\n"));
   1.418 +
   1.419 +	//Test match for the current locale (2nd best match)
   1.420 +	path.Copy(KRscFilename);
   1.421 +	BaflUtils::NearestLanguageFile (TheFs, path, language);
   1.422 +	TEST(path == KEnglishLang);
   1.423 +	TEST(language == ELangEnglish);
   1.424 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KRscFilename, &path);
   1.425 +
   1.426 +	BaflUtils::DeleteFile (TheFs, KEnglishLang);
   1.427 +	TheTest.Printf(_L("Deleting C:\\abc.r01\n"));
   1.428 +
   1.429 +	//Test when theres no matching language file
   1.430 +	path.Copy(KRscFilename);
   1.431 +	BaflUtils::NearestLanguageFile (TheFs, path, language);
   1.432 +	TEST(path == KRscFilename);
   1.433 +	TEST(language == ELangNone);
   1.434 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KRscFilename, &path);
   1.435 +
   1.436 +	//Test when no drive letter is supplied in the
   1.437 +	//path but theres a corresponding file in Z:
   1.438 +	path.Copy(KRscFileInZDrive);
   1.439 +	BaflUtils::NearestLanguageFile (TheFs, path, language);
   1.440 +	TEST(path == KRScFullFile);
   1.441 +	TEST(language == ELangNone);
   1.442 +	TheTest.Printf (_L ("The NearestLanguageFile for %S is %S\n"), &KRscFileInZDrive, &path);
   1.443 +
   1.444 +	CleanupStack::PopAndDestroy (&::TheFs);
   1.445 +
   1.446 +	BaflUtils::ReleaseIdealLanguage();
   1.447 +	__UHEAP_MARKEND;
   1.448 +
   1.449 +	}
   1.450 +//===============================================================================
   1.451 +
   1.452 +/**
   1.453 +Initialise the cleanup stack
   1.454 +*/
   1.455 +LOCAL_C void SetupL ()
   1.456 +    {
   1.457 +	TheTrapCleanup = CTrapCleanup::New ();
   1.458 +	User::LeaveIfNull (TheTrapCleanup);
   1.459 +	}
   1.460 +
   1.461 +/**
   1.462 +Cleanup
   1.463 +*/
   1.464 +LOCAL_C void CleanupL ()
   1.465 +    {
   1.466 +	delete TheTrapCleanup;
   1.467 +	}
   1.468 +
   1.469 +/**
   1.470 +Invoke the tests
   1.471 +*/
   1.472 +LOCAL_C void DoTestsL ()
   1.473 +    {
   1.474 +    CreateTestFiles();
   1.475 +	REQ3770L ();
   1.476 +	REQ3785L ();
   1.477 +	DEF094490L();
   1.478 +	DEF096421L();
   1.479 +	DeleteTestFiles();
   1.480 +	}
   1.481 +
   1.482 +
   1.483 +GLDEF_C TInt E32Main ()
   1.484 +	{
   1.485 +	__UHEAP_MARK;
   1.486 +
   1.487 +	TheTest.Printf (_L ("\n"));
   1.488 +	TheTest.Title ();
   1.489 +	TheTest.Start (_L("Ideal language Tests "));
   1.490 +
   1.491 +	TRAPD (err, SetupL ());
   1.492 +	TheTest (err == KErrNone);
   1.493 +
   1.494 +	TRAP (err, DoTestsL ());
   1.495 +	TheTest (err == KErrNone);
   1.496 +
   1.497 +	CleanupL ();
   1.498 +
   1.499 +	TheTest.End ();
   1.500 +	TheTest.Close ();
   1.501 +
   1.502 +	__UHEAP_MARKEND;
   1.503 +	return (KErrNone);
   1.504 +	}