os/ossrv/genericopenlibs/posixrealtimeextensions/test/testclock/src/tclock.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/posixrealtimeextensions/test/testclock/src/tclock.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,174 @@
     1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// Name        : tclock.cpp
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#include "tclock.h"
    1.22 +
    1.23 +
    1.24 +CTestclock::~CTestclock() 
    1.25 +	{ 
    1.26 +	}  
    1.27 +
    1.28 +CTestclock::CTestclock(const TDesC& aStepName)
    1.29 +	{
    1.30 +	// MANDATORY Call to base class method to set up the human readable name for logging.
    1.31 +	SetTestStepName(aStepName);		
    1.32 +	}
    1.33 +
    1.34 +TVerdict CTestclock::doTestStepPreambleL()
    1.35 +	{
    1.36 +	__UHEAP_MARK;	
    1.37 +	SetTestStepResult(EPass);
    1.38 +	return TestStepResult();
    1.39 +	}
    1.40 +
    1.41 +
    1.42 +
    1.43 +TVerdict CTestclock::doTestStepPostambleL()
    1.44 +	{
    1.45 +	__UHEAP_MARKEND;	
    1.46 +	iParamCnt=0;
    1.47 +	return TestStepResult();
    1.48 +	}
    1.49 +
    1.50 +
    1.51 +TVerdict CTestclock::doTestStepL()
    1.52 +	{
    1.53 +	int err;
    1.54 +	if(TestStepName() == KTestgetclockid1)
    1.55 +   		{
    1.56 +   	   	INFO_PRINTF1(_L("Testgetclockid1():"));
    1.57 +   	   	err = Testgetclockid1();
    1.58 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    1.59 +   	   	}   	
    1.60 +	if(TestStepName() == KTestgetclockid2)
    1.61 +   		{
    1.62 +   	   	INFO_PRINTF1(_L("Testgetclockid2():"));
    1.63 +   	   	err = Testgetclockid2();
    1.64 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    1.65 +   	   	}     	
    1.66 +	if(TestStepName() == KTestgetclockid3)
    1.67 +   		{
    1.68 +   	   	INFO_PRINTF1(_L("Testgetclockid3():"));
    1.69 +   	   	err = Testgetclockid3();
    1.70 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    1.71 +   	   	}     	
    1.72 +	if(TestStepName() == KTestgetclockid4)
    1.73 +   		{
    1.74 +   	   	INFO_PRINTF1(_L("Testgetclockid4():"));
    1.75 +   	   	err = Testgetclockid4();
    1.76 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    1.77 +   	   	}      	
    1.78 +	if(TestStepName() == KTestgetclockid5)
    1.79 +   		{
    1.80 +   	   	INFO_PRINTF1(_L("Testgetclockid5():"));
    1.81 +   	   	err = Testgetclockid5();
    1.82 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    1.83 +   	   	}      	
    1.84 +	if(TestStepName() == KTestclockresolution1)
    1.85 +   		{
    1.86 +   	   	INFO_PRINTF1(_L("Testclockresolution1():"));
    1.87 +   	   	err = Testclockresolution1();
    1.88 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    1.89 +   	   	}       	
    1.90 +	if(TestStepName() == KTestclockresolution2)
    1.91 +   		{
    1.92 +   	   	INFO_PRINTF1(_L("Testclockresolution2():"));
    1.93 +   	   	err = Testclockresolution2();
    1.94 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    1.95 +   	   	}      	
    1.96 +	if(TestStepName() == KTestclockresolution3)
    1.97 +   		{
    1.98 +   	   	INFO_PRINTF1(_L("Testclockresolution3():"));
    1.99 +   	   	err = Testclockresolution3();
   1.100 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   1.101 +   	   	}     	
   1.102 +	if(TestStepName() == KTestclocknanosleep1)
   1.103 +   		{
   1.104 +   	   	INFO_PRINTF1(_L("Testclocknanosleep1():"));
   1.105 +   	   	err = Testclocknanosleep1();
   1.106 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   1.107 +   	   	}         	
   1.108 +	if(TestStepName() == KTestclocknanosleep2)
   1.109 +   		{
   1.110 +   	   	INFO_PRINTF1(_L("Testclocknanosleep2():"));
   1.111 +   	   	err = Testclocknanosleep2();
   1.112 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   1.113 +   	   	}      	
   1.114 +	if(TestStepName() == KTestclocknanosleep3)
   1.115 +   		{
   1.116 +   	   	INFO_PRINTF1(_L("Testclocknanosleep3():"));
   1.117 +   	   	err = Testclocknanosleep3();
   1.118 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   1.119 +   	   	}         	
   1.120 +	if(TestStepName() == KTestclocknanosleep4)
   1.121 +   		{
   1.122 +   	   	INFO_PRINTF1(_L("Testclocknanosleep4():"));
   1.123 +   	   	err = Testclocknanosleep4();
   1.124 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   1.125 +   	   	}     	
   1.126 +	if(TestStepName() == KTestclocknanosleep5)
   1.127 +   		{
   1.128 +   	   	INFO_PRINTF1(_L("Testclocknanosleep5():"));
   1.129 +   	   	err = Testclocknanosleep5();
   1.130 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   1.131 +   	   	}         	
   1.132 +	if(TestStepName() == KTestclocknanosleep6)
   1.133 +   		{
   1.134 +   	   	INFO_PRINTF1(_L("Testclocknanosleep6():"));
   1.135 +   	   	err = Testclocknanosleep6();
   1.136 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   1.137 +   	   	}  	
   1.138 +	if(TestStepName() == KTestclockgettime1)
   1.139 +   		{
   1.140 +   	   	INFO_PRINTF1(_L("Testclockgettime1():"));
   1.141 +   	   	err = Testclockgettime1();
   1.142 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   1.143 +   	   	}      	
   1.144 +	if(TestStepName() == KTestclockgettime2)
   1.145 +   		{
   1.146 +   	   	INFO_PRINTF1(_L("Testclockgettime2():"));
   1.147 +   	   	err = Testclockgettime2();
   1.148 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   1.149 +   	   	}      	
   1.150 +	if(TestStepName() == KTestclockgettime3)
   1.151 +   		{
   1.152 +   	   	INFO_PRINTF1(_L("Testclockgettime3():"));
   1.153 +   	   	err = Testclockgettime3();
   1.154 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   1.155 +   	   	}    	
   1.156 +	if(TestStepName() == KTestclocksettime1)
   1.157 +   		{
   1.158 +   	   	INFO_PRINTF1(_L("Testclocksettime1():"));
   1.159 +   	   	err = Testclocksettime1();
   1.160 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   1.161 +   	   	}      	
   1.162 +	if(TestStepName() == KTestclocksettime2)
   1.163 +   		{
   1.164 +   	   	INFO_PRINTF1(_L("Testclocksettime2():"));
   1.165 +   	   	err = Testclocksettime2();
   1.166 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   1.167 +   	   	}      	
   1.168 +	if(TestStepName() == KTestclocksettime3)
   1.169 +   		{
   1.170 +   	   	INFO_PRINTF1(_L("Testclocksettime3():"));
   1.171 +   	   	err = Testclocksettime3();
   1.172 +   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   1.173 +   	   	} 
   1.174 +	return TestStepResult();
   1.175 +	}
   1.176 + 
   1.177 +