os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/DataLoggerTest/DataLoggerTransitions.inl
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 1997-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 // The implementation of the transition classes upon the CDataLogger class methods.
    15 // 
    16 //
    17 
    18 // ______________________________________________________________________________
    19 //
    20 _LIT(KDataLoggerNewLTransition,"CDataLogger_NewL_Transition");
    21 
    22 inline CDataLogger_NewL_Transition::CDataLogger_NewL_Transition(CUnitTestContext& aUTContext,
    23 													TTransitionValidator& aValidator)
    24 : CTransitionType(KDataLoggerNewLTransition, aUTContext, aValidator)
    25 	{
    26 	// Do nothing here.
    27 	}
    28 
    29 inline void CDataLogger_NewL_Transition::TransitMethodL()
    30 	{
    31 	_LIT(KDataLoggerNewLTransitMethod, "CDataLogger::NewL transition");
    32 	Context().DataLogger().LogInformation(KDataLoggerNewLTransitMethod);
    33 	Context().iDataLogger = CDataLogger::NewL(Context().iLoggingInfo);
    34 	}
    35 
    36 inline CDataLogger_UnitTestContext& CDataLogger_NewL_Transition::Context() const
    37 	{
    38 	return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
    39 	}
    40 
    41 // ______________________________________________________________________________
    42 //
    43 _LIT(KDataLoggerDtorTransition,"CDataLogger_Dtor_Transition");
    44 
    45 inline CDataLogger_Dtor_Transition::CDataLogger_Dtor_Transition(CUnitTestContext& aUTContext,
    46 													TTransitionValidator& aValidator)
    47 : CTransition(KDataLoggerDtorTransition, aUTContext, aValidator)
    48 	{
    49 	// Do nothing here.
    50 	}
    51 
    52 inline void CDataLogger_Dtor_Transition::TransitMethodL()
    53 	{
    54 	_LIT(KDataLoggerDtorTransitMethod, "CDataLogger::Dtor transition");
    55 	Context().DataLogger().LogInformation(KDataLoggerDtorTransitMethod);
    56 	delete Context().iDataLogger;
    57 	Context().iDataLogger = NULL;
    58 	}
    59 
    60 inline CDataLogger_UnitTestContext& CDataLogger_Dtor_Transition::Context() const
    61 	{
    62 	return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
    63 	}
    64 
    65 // ______________________________________________________________________________
    66 //
    67 _LIT(KDataLoggerDumpMemoryBlockTransition,"CDataLogger_DumpMemoryBlock_Transition");
    68 
    69 inline CDataLogger_DumpMemoryBlock_Transition::CDataLogger_DumpMemoryBlock_Transition(CUnitTestContext& aUTContext,
    70 													TTransitionValidator& aValidator)
    71 : CTransition(KDataLoggerDumpMemoryBlockTransition, aUTContext, aValidator)
    72 	{
    73 	// Do nothing here.
    74 	}
    75 
    76 inline void CDataLogger_DumpMemoryBlock_Transition::TransitMethodL()
    77 	{
    78 	_LIT(KDataLoggerDumpMemoryBlockTransitMethod, "CDataLogger::DumpMemoryBlock transition");
    79 	Context().DataLogger().LogInformation(KDataLoggerDumpMemoryBlockTransitMethod);
    80 	Context().iDataLogger->DumpMemoryBlock(Context().iAddress, Context().iLength);
    81 	}
    82 
    83 inline CDataLogger_UnitTestContext& CDataLogger_DumpMemoryBlock_Transition::Context() const
    84 	{
    85 	return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
    86 	}
    87 
    88 // ______________________________________________________________________________
    89 //
    90 _LIT(KDataLoggerLogInformationTransition,"CDataLogger_LogInformation_Transition");
    91 
    92 inline CDataLogger_LogInformation_Transition::CDataLogger_LogInformation_Transition(CUnitTestContext& aUTContext,
    93 													TTransitionValidator& aValidator)
    94 : CTransition(KDataLoggerLogInformationTransition, aUTContext, aValidator)
    95 	{
    96 	// Do nothing here.
    97 	}
    98 
    99 inline void CDataLogger_LogInformation_Transition::TransitMethodL()
   100 	{
   101 	_LIT(KDataLoggerLogInformationTransitMethod, "CDataLogger::LogInformation transition");
   102 	_LIT(KComment, "This is a wide descriptor comment");
   103 	Context().DataLogger().LogInformation(KDataLoggerLogInformationTransitMethod);
   104 	Context().iDataLogger->LogInformation(KComment);
   105 	}
   106 
   107 inline CDataLogger_UnitTestContext& CDataLogger_LogInformation_Transition::Context() const
   108 	{
   109 	return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
   110 	}
   111 
   112 
   113 // ______________________________________________________________________________
   114 //
   115 _LIT(KDataLoggerLogInformationNarrowTransition,"CDataLogger_LogInformationNarrow_Transition");
   116 
   117 inline CDataLogger_LogInformationNarrow_Transition::CDataLogger_LogInformationNarrow_Transition(CUnitTestContext& aUTContext,
   118 													TTransitionValidator& aValidator)
   119 : CTransition(KDataLoggerLogInformationNarrowTransition, aUTContext, aValidator)
   120 	{
   121 	// Do nothing here.
   122 	}
   123 
   124 inline void CDataLogger_LogInformationNarrow_Transition::TransitMethodL()
   125 	{
   126 	_LIT(KDataLoggerLogInformationNarrowTransitMethod, "CDataLogger::LogInformationNarrow transition");
   127 	_LIT8(KCommentNarrow, "This is a narrow descriptor comment");
   128 	Context().DataLogger().LogInformation(KDataLoggerLogInformationNarrowTransitMethod);
   129 	Context().iDataLogger->LogInformation(KCommentNarrow);
   130 	}
   131 
   132 inline CDataLogger_UnitTestContext& CDataLogger_LogInformationNarrow_Transition::Context() const
   133 	{
   134 	return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
   135 	}
   136 
   137 // ______________________________________________________________________________
   138 //
   139 _LIT(KDataLoggerLogInformationWithParametersTransition,"CDataLogger_LogInformationWithParameters_Transition");
   140 
   141 inline CDataLogger_LogInformationWithParameters_Transition::CDataLogger_LogInformationWithParameters_Transition(CUnitTestContext& aUTContext,
   142 													TTransitionValidator& aValidator)
   143 : CTransition(KDataLoggerLogInformationWithParametersTransition, aUTContext, aValidator)
   144 	{
   145 	// Do nothing here.
   146 	}
   147 
   148 inline void CDataLogger_LogInformationWithParameters_Transition::TransitMethodL()
   149 	{
   150 	_LIT(KDataLoggerLogInformationWithParametersTransitMethod, "CDataLogger::LogInformationWithParameters transition");
   151 	_LIT(KFormat, "This text will be followed by a parameter: %S");
   152 	Context().DataLogger().LogInformation(KDataLoggerLogInformationWithParametersTransitMethod);
   153 	Context().iDataLogger->LogInformationWithParameters(KFormat, Context().iArg);
   154 	}
   155 
   156 inline CDataLogger_UnitTestContext& CDataLogger_LogInformationWithParameters_Transition::Context() const
   157 	{
   158 	return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
   159 	}
   160 
   161 // ______________________________________________________________________________
   162 //
   163 _LIT(KDataLoggerLogInformationWithParametersNarrowTransition,"CDataLogger_LogInformationWithParametersNarrow_Transition");
   164 
   165 inline CDataLogger_LogInformationWithParametersNarrow_Transition::CDataLogger_LogInformationWithParametersNarrow_Transition(CUnitTestContext& aUTContext,
   166 													TTransitionValidator& aValidator)
   167 : CTransition(KDataLoggerLogInformationWithParametersNarrowTransition, aUTContext, aValidator)
   168 	{
   169 	// Do nothing here.
   170 	}
   171 
   172 inline void CDataLogger_LogInformationWithParametersNarrow_Transition::TransitMethodL()
   173 	{
   174 	_LIT(KDataLoggerLogInformationWithParametersNarrowTransitMethod, "CDataLogger::LogInformationWithParametersNarrow transition");
   175 	_LIT8(KFormatNarrow, "This text will be followed by a parameter: %S");
   176 	Context().DataLogger().LogInformation(KDataLoggerLogInformationWithParametersNarrowTransitMethod);
   177 	Context().iDataLogger->LogInformationWithParameters(KFormatNarrow, Context().iArgNarrow);
   178 	}
   179 
   180 inline CDataLogger_UnitTestContext& CDataLogger_LogInformationWithParametersNarrow_Transition::Context() const
   181 	{
   182 	return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
   183 	}
   184 
   185 
   186 // ______________________________________________________________________________
   187 //
   188 _LIT(KDataLoggerReportInformationTransition,"CDataLogger_ReportInformation_Transition");
   189 
   190 inline CDataLogger_ReportInformation_Transition::CDataLogger_ReportInformation_Transition(CUnitTestContext& aUTContext,
   191 													TTransitionValidator& aValidator)
   192 : CTransition(KDataLoggerReportInformationTransition, aUTContext, aValidator)
   193 	{
   194 	// Do nothing here.
   195 	}
   196 
   197 inline void CDataLogger_ReportInformation_Transition::TransitMethodL()
   198 	{
   199 	_LIT(KDataLoggerReportInformationTransitMethod, "CDataLogger::ReportInformation transition");
   200 	Context().DataLogger().LogInformation(KDataLoggerReportInformationTransitMethod);
   201 	Context().iDataLogger->ReportInformation(*(Context().iReportComment));
   202 	}
   203 
   204 inline CDataLogger_UnitTestContext& CDataLogger_ReportInformation_Transition::Context() const
   205 	{
   206 	return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
   207 	}
   208 
   209 
   210 // ______________________________________________________________________________
   211 //
   212 _LIT(KDataLoggerReportInformationWithParametersTransition,"CDataLogger_ReportInformationWithParameters_Transition");
   213 
   214 inline CDataLogger_ReportInformationWithParameters_Transition::CDataLogger_ReportInformationWithParameters_Transition(CUnitTestContext& aUTContext,
   215 													TTransitionValidator& aValidator)
   216 : CTransition(KDataLoggerReportInformationWithParametersTransition, aUTContext, aValidator)
   217 	{
   218 	// Do nothing here.
   219 	}
   220 
   221 inline void CDataLogger_ReportInformationWithParameters_Transition::TransitMethodL()
   222 	{
   223 	_LIT(KDataLoggerReportInformationWithParametersTransitMethod, "CDataLogger::ReportInformationWithParameters transition");
   224 	Context().DataLogger().LogInformation(KDataLoggerReportInformationWithParametersTransitMethod);
   225 	Context().iDataLogger->ReportInformationWithParameters(*(Context().iFormatReport), Context().iReportArg);
   226 	}
   227 
   228 inline CDataLogger_UnitTestContext& CDataLogger_ReportInformationWithParameters_Transition::Context() const
   229 	{
   230 	return REINTERPRET_CAST(CDataLogger_UnitTestContext&,iUTContext);
   231 	}
   232 
   233 
   234 // Add additional Transition class Implementations here...
   235