camerasrv_plat/camera_application_engine_api/tsrc/inc/TestFrameWork/TestResult.h
branchRCL_3
changeset 21 27fe719c32e6
parent 0 9b3e960ffc8a
equal deleted inserted replaced
20:e3cdd00b5ae3 21:27fe719c32e6
       
     1 /*
       
     2 * Copyright (c) 2002 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: CTestResult
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CPPUNIT_TESTRESULT_H
       
    21 #define __CPPUNIT_TESTRESULT_H
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 class MTest;
       
    26 class CAssertFailure;
       
    27 class CTestFailure;
       
    28 
       
    29 
       
    30 /*
       
    31  * A CTestResult collects the results of executing a test case. It is an 
       
    32  * instance of the Collecting Parameter pattern.
       
    33  *
       
    34  * The test framework distinguishes between failures and errors.
       
    35  * A failure is anticipated and checked for with assertions. Errors are
       
    36  * unanticipated problems that are caused by "leaves" that are not generated
       
    37  * by the framework.
       
    38  *
       
    39  * see MTest
       
    40  */
       
    41 
       
    42 class CTestResult : public CBase
       
    43 	{
       
    44 public:
       
    45 
       
    46 	IMPORT_C static CTestResult* NewLC();
       
    47 	IMPORT_C static CTestResult* NewL();
       
    48 
       
    49     IMPORT_C ~CTestResult ();
       
    50 
       
    51     IMPORT_C TInt TestCount ();
       
    52     IMPORT_C RPointerArray<CTestFailure>& Errors ();
       
    53     IMPORT_C RPointerArray<CTestFailure>& Failures ();
       
    54     IMPORT_C TBool WasSuccessful ();
       
    55 
       
    56 	void IncrementTestCount ();
       
    57     void AddErrorL (MTest& aTest, TInt aError);
       
    58     void AddFailureL (MTest& aTest, CAssertFailure* aAssertFailure);
       
    59 
       
    60 private:
       
    61 
       
    62 	void ConstructL ();
       
    63 	CTestResult ();
       
    64 
       
    65     RPointerArray<CTestFailure> iErrors;
       
    66     RPointerArray<CTestFailure> iFailures;
       
    67 	TInt iTestCount; 
       
    68 	};
       
    69 
       
    70 #endif
       
    71 
       
    72