genericopenlibs/posixrealtimeextensions/test/testclock/src/tclock.cpp
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 2008-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        : tclock.cpp
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "tclock.h"
       
    19 
       
    20 
       
    21 CTestclock::~CTestclock() 
       
    22 	{ 
       
    23 	}  
       
    24 
       
    25 CTestclock::CTestclock(const TDesC& aStepName)
       
    26 	{
       
    27 	// MANDATORY Call to base class method to set up the human readable name for logging.
       
    28 	SetTestStepName(aStepName);		
       
    29 	}
       
    30 
       
    31 TVerdict CTestclock::doTestStepPreambleL()
       
    32 	{
       
    33 	__UHEAP_MARK;	
       
    34 	SetTestStepResult(EPass);
       
    35 	return TestStepResult();
       
    36 	}
       
    37 
       
    38 
       
    39 
       
    40 TVerdict CTestclock::doTestStepPostambleL()
       
    41 	{
       
    42 	__UHEAP_MARKEND;	
       
    43 	iParamCnt=0;
       
    44 	return TestStepResult();
       
    45 	}
       
    46 
       
    47 
       
    48 TVerdict CTestclock::doTestStepL()
       
    49 	{
       
    50 	int err;
       
    51 	if(TestStepName() == KTestgetclockid1)
       
    52    		{
       
    53    	   	INFO_PRINTF1(_L("Testgetclockid1():"));
       
    54    	   	err = Testgetclockid1();
       
    55    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
    56    	   	}   	
       
    57 	if(TestStepName() == KTestgetclockid2)
       
    58    		{
       
    59    	   	INFO_PRINTF1(_L("Testgetclockid2():"));
       
    60    	   	err = Testgetclockid2();
       
    61    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
    62    	   	}     	
       
    63 	if(TestStepName() == KTestgetclockid3)
       
    64    		{
       
    65    	   	INFO_PRINTF1(_L("Testgetclockid3():"));
       
    66    	   	err = Testgetclockid3();
       
    67    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
    68    	   	}     	
       
    69 	if(TestStepName() == KTestgetclockid4)
       
    70    		{
       
    71    	   	INFO_PRINTF1(_L("Testgetclockid4():"));
       
    72    	   	err = Testgetclockid4();
       
    73    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
    74    	   	}      	
       
    75 	if(TestStepName() == KTestgetclockid5)
       
    76    		{
       
    77    	   	INFO_PRINTF1(_L("Testgetclockid5():"));
       
    78    	   	err = Testgetclockid5();
       
    79    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
    80    	   	}      	
       
    81 	if(TestStepName() == KTestclockresolution1)
       
    82    		{
       
    83    	   	INFO_PRINTF1(_L("Testclockresolution1():"));
       
    84    	   	err = Testclockresolution1();
       
    85    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
    86    	   	}       	
       
    87 	if(TestStepName() == KTestclockresolution2)
       
    88    		{
       
    89    	   	INFO_PRINTF1(_L("Testclockresolution2():"));
       
    90    	   	err = Testclockresolution2();
       
    91    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
    92    	   	}      	
       
    93 	if(TestStepName() == KTestclockresolution3)
       
    94    		{
       
    95    	   	INFO_PRINTF1(_L("Testclockresolution3():"));
       
    96    	   	err = Testclockresolution3();
       
    97    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
    98    	   	}     	
       
    99 	if(TestStepName() == KTestclocknanosleep1)
       
   100    		{
       
   101    	   	INFO_PRINTF1(_L("Testclocknanosleep1():"));
       
   102    	   	err = Testclocknanosleep1();
       
   103    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
   104    	   	}         	
       
   105 	if(TestStepName() == KTestclocknanosleep2)
       
   106    		{
       
   107    	   	INFO_PRINTF1(_L("Testclocknanosleep2():"));
       
   108    	   	err = Testclocknanosleep2();
       
   109    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
   110    	   	}      	
       
   111 	if(TestStepName() == KTestclocknanosleep3)
       
   112    		{
       
   113    	   	INFO_PRINTF1(_L("Testclocknanosleep3():"));
       
   114    	   	err = Testclocknanosleep3();
       
   115    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
   116    	   	}         	
       
   117 	if(TestStepName() == KTestclocknanosleep4)
       
   118    		{
       
   119    	   	INFO_PRINTF1(_L("Testclocknanosleep4():"));
       
   120    	   	err = Testclocknanosleep4();
       
   121    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
   122    	   	}     	
       
   123 	if(TestStepName() == KTestclocknanosleep5)
       
   124    		{
       
   125    	   	INFO_PRINTF1(_L("Testclocknanosleep5():"));
       
   126    	   	err = Testclocknanosleep5();
       
   127    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
   128    	   	}         	
       
   129 	if(TestStepName() == KTestclocknanosleep6)
       
   130    		{
       
   131    	   	INFO_PRINTF1(_L("Testclocknanosleep6():"));
       
   132    	   	err = Testclocknanosleep6();
       
   133    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
   134    	   	}  	
       
   135 	if(TestStepName() == KTestclockgettime1)
       
   136    		{
       
   137    	   	INFO_PRINTF1(_L("Testclockgettime1():"));
       
   138    	   	err = Testclockgettime1();
       
   139    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
   140    	   	}      	
       
   141 	if(TestStepName() == KTestclockgettime2)
       
   142    		{
       
   143    	   	INFO_PRINTF1(_L("Testclockgettime2():"));
       
   144    	   	err = Testclockgettime2();
       
   145    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
   146    	   	}      	
       
   147 	if(TestStepName() == KTestclockgettime3)
       
   148    		{
       
   149    	   	INFO_PRINTF1(_L("Testclockgettime3():"));
       
   150    	   	err = Testclockgettime3();
       
   151    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
   152    	   	}    	
       
   153 	if(TestStepName() == KTestclocksettime1)
       
   154    		{
       
   155    	   	INFO_PRINTF1(_L("Testclocksettime1():"));
       
   156    	   	err = Testclocksettime1();
       
   157    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
   158    	   	}      	
       
   159 	if(TestStepName() == KTestclocksettime2)
       
   160    		{
       
   161    	   	INFO_PRINTF1(_L("Testclocksettime2():"));
       
   162    	   	err = Testclocksettime2();
       
   163    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
   164    	   	}      	
       
   165 	if(TestStepName() == KTestclocksettime3)
       
   166    		{
       
   167    	   	INFO_PRINTF1(_L("Testclocksettime3():"));
       
   168    	   	err = Testclocksettime3();
       
   169    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
       
   170    	   	} 
       
   171 	return TestStepResult();
       
   172 	}
       
   173  
       
   174