--- a/featuremgmt/featuremgr/test/rtest/src/t_fmgrstartup.cpp Mon May 03 14:09:14 2010 +0300
+++ b/featuremgmt/featuremgr/test/rtest/src/t_fmgrstartup.cpp Fri May 14 17:36:33 2010 +0300
@@ -26,6 +26,7 @@
static const TInt KBurstRate = 20;
#endif
+void DestroyTestEnv();
///////////////////////////////////////////////////////////////////////////////////////
static RTest TheTest(_L("t_fmgrstartup"));
@@ -37,24 +38,6 @@
#endif
///////////////////////////////////////////////////////////////////////////////////////
-
-//Deletes all created test files.
-void DestroyTestEnv()
- {
- //KFeaturesDir is defined only if EXTENDED_FEATURE_MANAGER_TEST is defined
-#ifdef EXTENDED_FEATURE_MANAGER_TEST
- RFs fs;
- TInt err = fs.Connect();
- if(err == KErrNone)
- {
- (void)fs.Delete(KFeaturesFile);
- }
- fs.Close();
-#endif
- }
-
-///////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////////////
//Test macros and functions
void Check1(TInt aValue, TInt aLine)
{
@@ -78,6 +61,45 @@
#define TEST2(aValue, aExpected) ::Check2(aValue, aExpected, __LINE__)
///////////////////////////////////////////////////////////////////////////////////////
+void CreateTestEnv()
+ {
+ //KFeaturesDir is defined only if EXTENDED_FEATURE_MANAGER_TEST is defined
+#ifdef EXTENDED_FEATURE_MANAGER_TEST
+ RFs fs;
+ TInt err = fs.Connect();
+ TEST2(err, KErrNone);
+
+ err = fs.MkDir(KFeaturesDir);
+ TEST (err == KErrNone || err == KErrAlreadyExists);
+
+ (void)fs.Delete(KFeaturesFile);
+ err = BaflUtils::CopyFile(fs, KZOrgFeaturesFile, KFeaturesDir);
+ TEST2 (err, KErrNone);
+ err = fs.SetAtt(KFeaturesFile, KEntryAttNormal, KEntryAttReadOnly);
+ TEST2 (err, KErrNone);
+ fs.Close();
+#endif
+ }
+
+//Deletes all created test files.
+void DestroyTestEnv()
+ {
+ //KFeaturesDir is defined only if EXTENDED_FEATURE_MANAGER_TEST is defined
+#ifdef EXTENDED_FEATURE_MANAGER_TEST
+ RFs fs;
+ TInt err = fs.Connect();
+ if(err == KErrNone)
+ {
+ err = fs.Delete(KFeaturesFile);
+ if (err != KErrNone)
+ {
+ RDebug::Print(_L("Warning: Clean test enviroment failed with error %d"), err);
+ }
+ }
+ fs.Close();
+#endif
+ }
+///////////////////////////////////////////////////////////////////////////////////////
static void MarkHandles()
{
@@ -193,24 +215,6 @@
TheTest.Printf(_L("\r\n===File I/O error simulation test succeeded on iteration %d===\r\n"), cnt);
}
-void CreateTestEnv()
- {
- //KFeaturesDir is defined only if EXTENDED_FEATURE_MANAGER_TEST is defined
-#ifdef EXTENDED_FEATURE_MANAGER_TEST
- RFs fs;
- TInt err = fs.Connect();
- TEST2(err, KErrNone);
-
- err = fs.MkDir(KFeaturesDir);
- TEST (err == KErrNone || err == KErrAlreadyExists);
-
- (void)fs.Delete(KFeaturesFile);
- err = BaflUtils::CopyFile(fs, KZOrgFeaturesFile, KFeaturesDir);
- TEST2 (err, KErrNone);
-
- fs.Close();
-#endif
- }
void DoTestsL()
{