os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/DataLoggerTest/DataLoggerTransitions.inl
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/DataLoggerTest/DataLoggerTransitions.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,235 @@
1.4 +// Copyright (c) 1997-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 +// The implementation of the transition classes upon the CDataLogger class methods.
1.18 +//
1.19 +//
1.20 +
1.21 +// ______________________________________________________________________________
1.22 +//
1.23 +_LIT(KDataLoggerNewLTransition,"CDataLogger_NewL_Transition");
1.24 +
1.25 +inline CDataLogger_NewL_Transition::CDataLogger_NewL_Transition(CUnitTestContext& aUTContext,
1.26 + TTransitionValidator& aValidator)
1.27 +: CTransitionType(KDataLoggerNewLTransition, aUTContext, aValidator)
1.28 + {
1.29 + // Do nothing here.
1.30 + }
1.31 +
1.32 +inline void CDataLogger_NewL_Transition::TransitMethodL()
1.33 + {
1.34 + _LIT(KDataLoggerNewLTransitMethod, "CDataLogger::NewL transition");
1.35 + Context().DataLogger().LogInformation(KDataLoggerNewLTransitMethod);
1.36 + Context().iDataLogger = CDataLogger::NewL(Context().iLoggingInfo);
1.37 + }
1.38 +
1.39 +inline CDataLogger_UnitTestContext& CDataLogger_NewL_Transition::Context() const
1.40 + {
1.41 + return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
1.42 + }
1.43 +
1.44 +// ______________________________________________________________________________
1.45 +//
1.46 +_LIT(KDataLoggerDtorTransition,"CDataLogger_Dtor_Transition");
1.47 +
1.48 +inline CDataLogger_Dtor_Transition::CDataLogger_Dtor_Transition(CUnitTestContext& aUTContext,
1.49 + TTransitionValidator& aValidator)
1.50 +: CTransition(KDataLoggerDtorTransition, aUTContext, aValidator)
1.51 + {
1.52 + // Do nothing here.
1.53 + }
1.54 +
1.55 +inline void CDataLogger_Dtor_Transition::TransitMethodL()
1.56 + {
1.57 + _LIT(KDataLoggerDtorTransitMethod, "CDataLogger::Dtor transition");
1.58 + Context().DataLogger().LogInformation(KDataLoggerDtorTransitMethod);
1.59 + delete Context().iDataLogger;
1.60 + Context().iDataLogger = NULL;
1.61 + }
1.62 +
1.63 +inline CDataLogger_UnitTestContext& CDataLogger_Dtor_Transition::Context() const
1.64 + {
1.65 + return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
1.66 + }
1.67 +
1.68 +// ______________________________________________________________________________
1.69 +//
1.70 +_LIT(KDataLoggerDumpMemoryBlockTransition,"CDataLogger_DumpMemoryBlock_Transition");
1.71 +
1.72 +inline CDataLogger_DumpMemoryBlock_Transition::CDataLogger_DumpMemoryBlock_Transition(CUnitTestContext& aUTContext,
1.73 + TTransitionValidator& aValidator)
1.74 +: CTransition(KDataLoggerDumpMemoryBlockTransition, aUTContext, aValidator)
1.75 + {
1.76 + // Do nothing here.
1.77 + }
1.78 +
1.79 +inline void CDataLogger_DumpMemoryBlock_Transition::TransitMethodL()
1.80 + {
1.81 + _LIT(KDataLoggerDumpMemoryBlockTransitMethod, "CDataLogger::DumpMemoryBlock transition");
1.82 + Context().DataLogger().LogInformation(KDataLoggerDumpMemoryBlockTransitMethod);
1.83 + Context().iDataLogger->DumpMemoryBlock(Context().iAddress, Context().iLength);
1.84 + }
1.85 +
1.86 +inline CDataLogger_UnitTestContext& CDataLogger_DumpMemoryBlock_Transition::Context() const
1.87 + {
1.88 + return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
1.89 + }
1.90 +
1.91 +// ______________________________________________________________________________
1.92 +//
1.93 +_LIT(KDataLoggerLogInformationTransition,"CDataLogger_LogInformation_Transition");
1.94 +
1.95 +inline CDataLogger_LogInformation_Transition::CDataLogger_LogInformation_Transition(CUnitTestContext& aUTContext,
1.96 + TTransitionValidator& aValidator)
1.97 +: CTransition(KDataLoggerLogInformationTransition, aUTContext, aValidator)
1.98 + {
1.99 + // Do nothing here.
1.100 + }
1.101 +
1.102 +inline void CDataLogger_LogInformation_Transition::TransitMethodL()
1.103 + {
1.104 + _LIT(KDataLoggerLogInformationTransitMethod, "CDataLogger::LogInformation transition");
1.105 + _LIT(KComment, "This is a wide descriptor comment");
1.106 + Context().DataLogger().LogInformation(KDataLoggerLogInformationTransitMethod);
1.107 + Context().iDataLogger->LogInformation(KComment);
1.108 + }
1.109 +
1.110 +inline CDataLogger_UnitTestContext& CDataLogger_LogInformation_Transition::Context() const
1.111 + {
1.112 + return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
1.113 + }
1.114 +
1.115 +
1.116 +// ______________________________________________________________________________
1.117 +//
1.118 +_LIT(KDataLoggerLogInformationNarrowTransition,"CDataLogger_LogInformationNarrow_Transition");
1.119 +
1.120 +inline CDataLogger_LogInformationNarrow_Transition::CDataLogger_LogInformationNarrow_Transition(CUnitTestContext& aUTContext,
1.121 + TTransitionValidator& aValidator)
1.122 +: CTransition(KDataLoggerLogInformationNarrowTransition, aUTContext, aValidator)
1.123 + {
1.124 + // Do nothing here.
1.125 + }
1.126 +
1.127 +inline void CDataLogger_LogInformationNarrow_Transition::TransitMethodL()
1.128 + {
1.129 + _LIT(KDataLoggerLogInformationNarrowTransitMethod, "CDataLogger::LogInformationNarrow transition");
1.130 + _LIT8(KCommentNarrow, "This is a narrow descriptor comment");
1.131 + Context().DataLogger().LogInformation(KDataLoggerLogInformationNarrowTransitMethod);
1.132 + Context().iDataLogger->LogInformation(KCommentNarrow);
1.133 + }
1.134 +
1.135 +inline CDataLogger_UnitTestContext& CDataLogger_LogInformationNarrow_Transition::Context() const
1.136 + {
1.137 + return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
1.138 + }
1.139 +
1.140 +// ______________________________________________________________________________
1.141 +//
1.142 +_LIT(KDataLoggerLogInformationWithParametersTransition,"CDataLogger_LogInformationWithParameters_Transition");
1.143 +
1.144 +inline CDataLogger_LogInformationWithParameters_Transition::CDataLogger_LogInformationWithParameters_Transition(CUnitTestContext& aUTContext,
1.145 + TTransitionValidator& aValidator)
1.146 +: CTransition(KDataLoggerLogInformationWithParametersTransition, aUTContext, aValidator)
1.147 + {
1.148 + // Do nothing here.
1.149 + }
1.150 +
1.151 +inline void CDataLogger_LogInformationWithParameters_Transition::TransitMethodL()
1.152 + {
1.153 + _LIT(KDataLoggerLogInformationWithParametersTransitMethod, "CDataLogger::LogInformationWithParameters transition");
1.154 + _LIT(KFormat, "This text will be followed by a parameter: %S");
1.155 + Context().DataLogger().LogInformation(KDataLoggerLogInformationWithParametersTransitMethod);
1.156 + Context().iDataLogger->LogInformationWithParameters(KFormat, Context().iArg);
1.157 + }
1.158 +
1.159 +inline CDataLogger_UnitTestContext& CDataLogger_LogInformationWithParameters_Transition::Context() const
1.160 + {
1.161 + return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
1.162 + }
1.163 +
1.164 +// ______________________________________________________________________________
1.165 +//
1.166 +_LIT(KDataLoggerLogInformationWithParametersNarrowTransition,"CDataLogger_LogInformationWithParametersNarrow_Transition");
1.167 +
1.168 +inline CDataLogger_LogInformationWithParametersNarrow_Transition::CDataLogger_LogInformationWithParametersNarrow_Transition(CUnitTestContext& aUTContext,
1.169 + TTransitionValidator& aValidator)
1.170 +: CTransition(KDataLoggerLogInformationWithParametersNarrowTransition, aUTContext, aValidator)
1.171 + {
1.172 + // Do nothing here.
1.173 + }
1.174 +
1.175 +inline void CDataLogger_LogInformationWithParametersNarrow_Transition::TransitMethodL()
1.176 + {
1.177 + _LIT(KDataLoggerLogInformationWithParametersNarrowTransitMethod, "CDataLogger::LogInformationWithParametersNarrow transition");
1.178 + _LIT8(KFormatNarrow, "This text will be followed by a parameter: %S");
1.179 + Context().DataLogger().LogInformation(KDataLoggerLogInformationWithParametersNarrowTransitMethod);
1.180 + Context().iDataLogger->LogInformationWithParameters(KFormatNarrow, Context().iArgNarrow);
1.181 + }
1.182 +
1.183 +inline CDataLogger_UnitTestContext& CDataLogger_LogInformationWithParametersNarrow_Transition::Context() const
1.184 + {
1.185 + return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
1.186 + }
1.187 +
1.188 +
1.189 +// ______________________________________________________________________________
1.190 +//
1.191 +_LIT(KDataLoggerReportInformationTransition,"CDataLogger_ReportInformation_Transition");
1.192 +
1.193 +inline CDataLogger_ReportInformation_Transition::CDataLogger_ReportInformation_Transition(CUnitTestContext& aUTContext,
1.194 + TTransitionValidator& aValidator)
1.195 +: CTransition(KDataLoggerReportInformationTransition, aUTContext, aValidator)
1.196 + {
1.197 + // Do nothing here.
1.198 + }
1.199 +
1.200 +inline void CDataLogger_ReportInformation_Transition::TransitMethodL()
1.201 + {
1.202 + _LIT(KDataLoggerReportInformationTransitMethod, "CDataLogger::ReportInformation transition");
1.203 + Context().DataLogger().LogInformation(KDataLoggerReportInformationTransitMethod);
1.204 + Context().iDataLogger->ReportInformation(*(Context().iReportComment));
1.205 + }
1.206 +
1.207 +inline CDataLogger_UnitTestContext& CDataLogger_ReportInformation_Transition::Context() const
1.208 + {
1.209 + return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
1.210 + }
1.211 +
1.212 +
1.213 +// ______________________________________________________________________________
1.214 +//
1.215 +_LIT(KDataLoggerReportInformationWithParametersTransition,"CDataLogger_ReportInformationWithParameters_Transition");
1.216 +
1.217 +inline CDataLogger_ReportInformationWithParameters_Transition::CDataLogger_ReportInformationWithParameters_Transition(CUnitTestContext& aUTContext,
1.218 + TTransitionValidator& aValidator)
1.219 +: CTransition(KDataLoggerReportInformationWithParametersTransition, aUTContext, aValidator)
1.220 + {
1.221 + // Do nothing here.
1.222 + }
1.223 +
1.224 +inline void CDataLogger_ReportInformationWithParameters_Transition::TransitMethodL()
1.225 + {
1.226 + _LIT(KDataLoggerReportInformationWithParametersTransitMethod, "CDataLogger::ReportInformationWithParameters transition");
1.227 + Context().DataLogger().LogInformation(KDataLoggerReportInformationWithParametersTransitMethod);
1.228 + Context().iDataLogger->ReportInformationWithParameters(*(Context().iFormatReport), Context().iReportArg);
1.229 + }
1.230 +
1.231 +inline CDataLogger_UnitTestContext& CDataLogger_ReportInformationWithParameters_Transition::Context() const
1.232 + {
1.233 + return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
1.234 + }
1.235 +
1.236 +
1.237 +// Add additional Transition class Implementations here...
1.238 +