commonservices/sysutil/test/tef/te_sysutiltestsuite/src/te_sysutilsgetswversion.cpp
branchRCL_3
changeset 22 8cb079868133
parent 21 ccb4f6b3db21
equal deleted inserted replaced
21:ccb4f6b3db21 22:8cb079868133
     1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    25 /**
    25 /**
    26 Destructor
    26 Destructor
    27  */
    27  */
    28 CSysUtilsGetSWVersionStep::~CSysUtilsGetSWVersionStep()
    28 CSysUtilsGetSWVersionStep::~CSysUtilsGetSWVersionStep()
    29 	{
    29 	{
    30     SetTestPath(EFalse);
       
    31 	}
    30 	}
    32 
    31 
    33 /**
    32 /**
    34 Constructor
    33 Constructor
    35  */
    34  */
    60 	_LIT16(KDummy,"xxxxx");
    59 	_LIT16(KDummy,"xxxxx");
    61 
    60 
    62 	TBuf16<KSysUtilVersionTextLength> version;
    61 	TBuf16<KSysUtilVersionTextLength> version;
    63 	version.Insert(0,KDummy);
    62 	version.Insert(0,KDummy);
    64 	
    63 	
    65 	TInt fileErr = CheckIsFileExist( _L("C:\\versions\\sw.txt"));
    64 	TInt fileErr = CheckIsFileExist( _L("Z:\\resource\\versions\\sw.txt"));
    66 
    65 
    67 	if(fileErr == KErrNone)
    66 	if(fileErr == KErrNone)
    68 		{
    67 		{
    69 		err = DeletePSProperties();
    68 		err = DeletePSProperties();
    70 		if(err != KErrNone)
    69 		if(err != KErrNone)
    73 			SetTestStepResult(EAbort);
    72 			SetTestStepResult(EAbort);
    74 			return TestStepResult();
    73 			return TestStepResult();
    75 			}
    74 			}
    76 		INFO_PRINTF1(_L("Deleted P&S properties successfully."));
    75 		INFO_PRINTF1(_L("Deleted P&S properties successfully."));
    77 		
    76 		
    78 		err = SetTestPath(ETrue);
    77 		err = SetTestPath(EFalse);
    79 		if( err != KErrNone )
    78 		if( err != KErrNone )
    80 			{
    79 			{
    81 			ERR_PRINTF2(_L("Could not turn test path off. Error = %d"), err);
    80 			ERR_PRINTF2(_L("Could not turn test path off. Error = %d"), err);
    82 			SetTestStepResult(EAbort);
    81 			SetTestStepResult(EAbort);
    83 			return TestStepResult();
    82 			return TestStepResult();
   112 	            }
   111 	            }
   113 	        
   112 	        
   114 	        if (version.Compare(testBuf)!=0)
   113 	        if (version.Compare(testBuf)!=0)
   115 				{
   114 				{
   116 				ERR_PRINTF1(_L("software version formatted incorrectly"));
   115 				ERR_PRINTF1(_L("software version formatted incorrectly"));
   117 				INFO_PRINTF1(_L("From ini file: "));
   116 				INFO_PRINTF1(testBuf);
   118                 INFO_PRINTF1(testBuf);
       
   119                 INFO_PRINTF1(_L("From txt file: "));
       
   120                 INFO_PRINTF1(version);
       
   121                 INFO_PRINTF2(_L("Comparison returned value %d"), version.Compare(testBuf));
       
   122 				SetTestStepResult(EFail);
   117 				SetTestStepResult(EFail);
   123 				}
   118 				}
   124 			else
   119 			else
   125 				{
   120 				{
   126 				INFO_PRINTF1(_L("software version formatted correctly"));
   121 				INFO_PRINTF1(_L("software version formatted correctly"));
   134 	else
   129 	else
   135 		{
   130 		{
   136 		ERR_PRINTF1(_L("sw.txt is missing, should be included to base packets"));
   131 		ERR_PRINTF1(_L("sw.txt is missing, should be included to base packets"));
   137 		SetTestStepResult(EFail);
   132 		SetTestStepResult(EFail);
   138 		}
   133 		}
   139 	
   134 
   140 	SetTestPath(EFalse);
       
   141 	return TestStepResult();
   135 	return TestStepResult();
   142 	}
   136 	}
   143 
   137