testexecfw/symbianunittestfw/sutfw/sutfwcore/sutfwframework/tsrc/src/ut_symbianunittestfailure.cpp
changeset 0 3e07fef1e154
child 1 bbd31066657e
equal deleted inserted replaced
-1:000000000000 0:3e07fef1e154
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 #include "ut_symbianunittestfailure.h"
       
    19 #include "symbianunittestfailure.h"
       
    20 #include <symbianunittestmacros.h>
       
    21 
       
    22 _LIT8( KFailedTestName8, "FailedTest" );
       
    23 _LIT( KFailedTestName, "FailedTest" );
       
    24 _LIT8( KFailureMessage, "FailureMessage" );
       
    25 const TInt KFailureLineNumber = 123;
       
    26 _LIT8( KFailedTestFileName, "UT_Failure.cpp" );
       
    27 
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 // ---------------------------------------------------------------------------
       
    31 //
       
    32 UT_CSymbianUnitTestFailure* UT_CSymbianUnitTestFailure::NewL()
       
    33     {
       
    34     UT_CSymbianUnitTestFailure* self = UT_CSymbianUnitTestFailure::NewLC(); 
       
    35     CleanupStack::Pop( self );
       
    36     return self;
       
    37     }
       
    38 
       
    39 // ---------------------------------------------------------------------------
       
    40 //
       
    41 // ---------------------------------------------------------------------------
       
    42 //
       
    43 UT_CSymbianUnitTestFailure* UT_CSymbianUnitTestFailure::NewLC()
       
    44     {
       
    45     UT_CSymbianUnitTestFailure* self = 
       
    46         new( ELeave )UT_CSymbianUnitTestFailure();
       
    47     CleanupStack::PushL( self );
       
    48     self->ConstructL();
       
    49     return self;
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 //
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 UT_CSymbianUnitTestFailure::UT_CSymbianUnitTestFailure()
       
    57     {
       
    58     }
       
    59 
       
    60 // ---------------------------------------------------------------------------
       
    61 //
       
    62 // ---------------------------------------------------------------------------
       
    63 //
       
    64 void UT_CSymbianUnitTestFailure::ConstructL()
       
    65     {
       
    66     BASE_CONSTRUCT
       
    67     ADD_SUT( UT_GettersL )
       
    68     }
       
    69 
       
    70 // ---------------------------------------------------------------------------
       
    71 //
       
    72 // ---------------------------------------------------------------------------
       
    73 //
       
    74 UT_CSymbianUnitTestFailure::~UT_CSymbianUnitTestFailure()
       
    75     {
       
    76     }
       
    77 
       
    78 // ---------------------------------------------------------------------------
       
    79 //
       
    80 // ---------------------------------------------------------------------------
       
    81 //
       
    82 void UT_CSymbianUnitTestFailure::SetupL()
       
    83     {
       
    84     iUnitTestFailure = 
       
    85         CSymbianUnitTestFailure::NewL(
       
    86             KFailedTestName,
       
    87             KFailureMessage,
       
    88             KFailureLineNumber,
       
    89             KFailedTestFileName );
       
    90     }
       
    91 
       
    92 // ---------------------------------------------------------------------------
       
    93 //
       
    94 // ---------------------------------------------------------------------------
       
    95 //
       
    96 void UT_CSymbianUnitTestFailure::Teardown()
       
    97     {
       
    98     delete iUnitTestFailure;
       
    99     iUnitTestFailure = NULL;
       
   100     }
       
   101 
       
   102 // ---------------------------------------------------------------------------
       
   103 //
       
   104 // ---------------------------------------------------------------------------
       
   105 //
       
   106 void UT_CSymbianUnitTestFailure::UT_GettersL()
       
   107     {
       
   108     SUT_ASSERT_EQUALS( 
       
   109         KFailedTestName8, iUnitTestFailure->TestName() )
       
   110     SUT_ASSERT_EQUALS( 
       
   111         KFailureMessage, iUnitTestFailure->FailureMessage() )
       
   112     SUT_ASSERT_EQUALS( 
       
   113         KFailureLineNumber, iUnitTestFailure->LineNumber() )
       
   114     SUT_ASSERT_EQUALS( 
       
   115         KFailedTestFileName, iUnitTestFailure->FileName() )
       
   116     }