compressionlibs/ziplib/test/tef/ulibz/src/ulibz.cpp
changeset 31 ce057bb09d0b
parent 0 e4d67989cc36
equal deleted inserted replaced
30:e20de85af2ee 31:ce057bb09d0b
       
     1 // Copyright (c) 2007-2009 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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Name        : ulibz.cpp
       
    15 // 
       
    16 //
       
    17 
       
    18  
       
    19 
       
    20 #include "ulibz.h"
       
    21 
       
    22 CTestlibz::~CTestlibz() 
       
    23 	{ 
       
    24 
       
    25 	}  
       
    26 
       
    27 CTestlibz::CTestlibz(const TDesC& aStepName)
       
    28 	{
       
    29 	// MANDATORY Call to base class method to set up the human readable name for logging.
       
    30 	SetTestStepName(aStepName);		
       
    31 	}
       
    32 
       
    33 TVerdict CTestlibz::doTestStepPreambleL()
       
    34 	{
       
    35 	SetTestStepResult(EPass);
       
    36 	return TestStepResult();
       
    37 	}
       
    38 
       
    39 
       
    40 
       
    41 TVerdict CTestlibz::doTestStepPostambleL()
       
    42 	{
       
    43 	return TestStepResult();
       
    44 	}
       
    45 
       
    46 
       
    47 TVerdict CTestlibz::doTestStepL()
       
    48 	{
       
    49 	int err;
       
    50 
       
    51 	
       
    52 	//testlibz steps
       
    53  	if(TestStepName() == KLibzcomp_decomp)
       
    54    			{
       
    55    	   		INFO_PRINTF1(_L("KLibzcomp_decomp():"));
       
    56    	   		err = libzcomp_decomp();
       
    57    	   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
    58    	   		}
       
    59    	   		
       
    60 	else if(TestStepName() == KLibzdefl_Infl)
       
    61    			{
       
    62    	   		INFO_PRINTF1(_L("KLibzdefl_Infl():"));
       
    63    	   		err = libzdefl_Infl();
       
    64    	   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
    65    	   		}
       
    66    	   		
       
    67 	else if(TestStepName() == KLibzgzio)
       
    68    			{
       
    69    	   		INFO_PRINTF1(_L("Kglobmark():"));
       
    70    	   		iRfs.Connect();
       
    71    	   		iRfs.MkDirAll(KDIRPATH);
       
    72  
       
    73    	   		err = libzgzio();
       
    74    	   		
       
    75    	   		iRfile.Close();
       
    76    	   		iRfs.Delete(KGZFILE);
       
    77    	   		iRfs.RmDir(KDIRPATH);
       
    78    	   		iRfs.Close();
       
    79    	   		
       
    80    	   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
    81    	   		}
       
    82 	else
       
    83 			{
       
    84 			SetTestStepResult(EPass);
       
    85 			}
       
    86 			
       
    87 	return TestStepResult(); 
       
    88 	}
       
    89 
       
    90