smsprotocols/smsstack/smsprot/Test/TE_Smsprt/te_smsprttestcase.cpp
changeset 20 244d7c5f118e
parent 19 1f776524b15c
child 23 6b1d113cdff3
equal deleted inserted replaced
19:1f776524b15c 20:244d7c5f118e
     1 // Copyright (c) 1999-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 #include "Te_smsprttestcase.h"
       
    17 #include "TE_smsprtbase.h"
       
    18 
       
    19 TTestCase::TTestCase()
       
    20 //
       
    21 // Constructor
       
    22 //
       
    23 	{
       
    24 
       
    25 	CommonInit();
       
    26 	}
       
    27 
       
    28 TTestCase::TTestCase(const TDesC& aMsg, const TDesC& aMatch)
       
    29 //
       
    30 // Constructor
       
    31 //
       
    32 : iMatchType(ESmsAddrMatchText), iMsg(aMsg), iMatch(aMatch)
       
    33 	{
       
    34 
       
    35 	CommonInit();
       
    36 	}
       
    37 
       
    38 void TTestCase::CommonInit()
       
    39 //
       
    40 // Reset member variables
       
    41 //
       
    42 	{
       
    43 
       
    44 	iTestSmsClass = EFalse;
       
    45 	iTestValidityPeriod = EFalse;
       
    46 	iTestForever=EFalse;
       
    47 	iTestIndicators=EFalse;
       
    48 	}
       
    49 
       
    50 TTestCase::TTestCase(const TDesC& aMsg, CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier)
       
    51 //
       
    52 // Constructor
       
    53 //
       
    54 : iMatchType(ESmsAddrMatchIEI), iMsg(aMsg), iIdentifierMatch(aIdentifier)
       
    55 	{
       
    56 
       
    57 	CommonInit();
       
    58 	}
       
    59 
       
    60 TTestCase::TTestCase(const TDesC& aMsg, TSmsFirstOctet::TSmsStatusReportRequest /*aSRR*/)
       
    61 //
       
    62 // Match on status report - ignore actual value of aSRR
       
    63 //
       
    64 : iMatchType(ESmsAddrStatusReport), iMsg(aMsg)
       
    65 	{
       
    66 
       
    67 	CommonInit();
       
    68 	}
       
    69 
       
    70 TTestCase::TTestCase(const TDesC& aMsg, TSmsDataCodingScheme::TSmsIndicationType aIndicationType,
       
    71 					 TSmsDataCodingScheme::TSmsDCSBits7To4 aBits7To4,
       
    72 					 TSmsDataCodingScheme::TSmsIndicationState aIndicationState)
       
    73 //
       
    74 // Match on a type of message indication
       
    75 //
       
    76 : iMatchType(ESmsAddrMessageIndication), iMsg(aMsg), iIndicationType(aIndicationType),
       
    77 	iBits7To4(aBits7To4), iIndicationState(aIndicationState)
       
    78 	{
       
    79 
       
    80 	__ASSERT_ALWAYS(iBits7To4==TSmsDataCodingScheme::ESmsDCSMessageWaitingIndicationDiscardMessage
       
    81 		|| iBits7To4==TSmsDataCodingScheme::ESmsDCSMessageWaitingIndication7Bit
       
    82 		|| iBits7To4==TSmsDataCodingScheme::ESmsDCSMessageWaitingIndicationUCS2,
       
    83 		User::Panic(_L("TestCase"), KErrNotSupported));
       
    84 
       
    85 	CommonInit();
       
    86 	iTestIndicators=ETrue;
       
    87 
       
    88 	}
       
    89 
       
    90 TTestCase::TTestCase(const TDesC& aMsg)
       
    91 //
       
    92 // Constructor
       
    93 //
       
    94 : iMatchType(ESmsAddrRecvAny), iMsg(aMsg)
       
    95 	{
       
    96 
       
    97 	CommonInit();
       
    98 	}
       
    99 
       
   100 const TTestCase& TTestCase::operator=(const TTestCase& aTest)
       
   101 //
       
   102 // Assignment operator
       
   103 //
       
   104 	{
       
   105 
       
   106 	iMatchType = aTest.iMatchType;
       
   107 	iMsg.Set(aTest.iMsg);
       
   108 	iMatch.Set(aTest.iMatch);
       
   109 	iIdentifierMatch = aTest.iIdentifierMatch;
       
   110 	iTestForever = aTest.iTestForever;
       
   111 	return *this;
       
   112 	}
       
   113 
       
   114 void TTestCase::SetSmsClass(TSmsDataCodingScheme::TSmsClass aClass)
       
   115 //
       
   116 // Set Sms Class
       
   117 //
       
   118 	{
       
   119 
       
   120 	iTestSmsClass = ETrue;
       
   121 	iSmsClass = aClass;
       
   122 	}
       
   123 
       
   124 void TTestCase::SetValidityPeriod(const TTimeIntervalMinutes& aTimeInterval)
       
   125 //
       
   126 // Set the validity period
       
   127 //
       
   128 	{
       
   129 
       
   130 	iTestValidityPeriod = ETrue;
       
   131 	iValidityPeriod = aTimeInterval;
       
   132 	}
       
   133 
       
   134 void TTestCase::SetRecvForever()
       
   135 //
       
   136 // Recv all messages forever
       
   137 //
       
   138 	{
       
   139 
       
   140 	iTestForever = ETrue;
       
   141 	iMatchType = ESmsAddrRecvAny;
       
   142 	}