os/persistentdata/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest5step.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 //
    15 
    16 /**
    17  @file UloggerServerTest5Step.cpp
    18  @internalTechnology
    19 */
    20 #include "uloggerservertest5step.h"
    21 #include "te_uloggerservertestsuitedefs.h"
    22 #include "uloggerdatatypes.h"
    23 
    24 namespace Ulogger
    25 {
    26 
    27 CUloggerServerTest5Step::~CUloggerServerTest5Step()
    28 /**
    29  * Destructor
    30  */
    31 	{
    32 	
    33 	}
    34 
    35 CUloggerServerTest5Step::CUloggerServerTest5Step()
    36 /**
    37  * Constructor
    38  */
    39 	{
    40 	SetTestStepName(KUloggerServerTest5Step);
    41 	}
    42 
    43 TVerdict CUloggerServerTest5Step::doTestStepPreambleL()
    44 /**
    45  * @return - TVerdict code
    46  * Override of base class virtual
    47  */
    48 	{
    49 	INFO_PRINTF1(_L("****This is unit test for CUloggerChannelSettings class****"));	
    50 	iScheduler = new (ELeave) CActiveScheduler();
    51 	CActiveScheduler::Install(iScheduler);
    52 	
    53 
    54 	SetTestStepResult(EPass);
    55 	return TestStepResult();
    56 	}
    57 
    58 
    59 TVerdict CUloggerServerTest5Step::doTestStepL()
    60 /**
    61  * @return - TVerdict code
    62  * Override of base class pure virtual
    63  * Our implementation only gets called if the base class doTestStepPreambleL() did
    64  * not leave. That being the case, the current test result value will be EPass.
    65  */
    66 	{
    67 	  iErrors = 0;
    68 	  if (TestStepResult()==EPass)
    69 	  {
    70 		iErrors += Test1L(); //CControlFramework::StartReading + StopReading
    71 		
    72 		//display results
    73 		TBuf<128> res;
    74 		res.AppendFormat(_L("%d errors"), iErrors);
    75 		INFO_PRINTF1(_L("****Results****"));
    76 		INFO_PRINTF1(res);
    77 		if(iErrors == 0)  
    78 			SetTestStepResult(EPass);
    79 			else
    80 				SetTestStepResult(EFail);
    81 	  }
    82 	  
    83 	  return TestStepResult();
    84 	}
    85 
    86 
    87 
    88 TVerdict CUloggerServerTest5Step::doTestStepPostambleL()
    89 /**
    90  * @return - TVerdict code
    91  * Override of base class virtual
    92  */
    93 	{
    94 	delete iScheduler;
    95 	iScheduler = NULL;
    96 	
    97 	return TestStepResult();
    98 	}
    99 
   100 
   101 
   102 
   103 TInt CUloggerServerTest5Step::Test1L()
   104 	{
   105 	TInt errors = 0;
   106 	
   107 	return errors;
   108 	}
   109 
   110 }