testexecfw/symbianunittestfw/symbianunittestfw_pub/symbian_unit_test_api/inc/symbianunittest.h
changeset 1 bbd31066657e
parent 0 3e07fef1e154
equal deleted inserted replaced
0:3e07fef1e154 1:bbd31066657e
    96         * 
    96         * 
    97         * @param aName the name of the unit test class
    97         * @param aName the name of the unit test class
    98         */        
    98         */        
    99         IMPORT_C void ConstructL( const TDesC8& aName );
    99         IMPORT_C void ConstructL( const TDesC8& aName );
   100     
   100     
   101     protected: // New functions    
   101     public: // New functions    
   102 
   102 
   103         /**
   103         /**
   104         * This function should be overidden in the actual unit test classes.
   104         * This function should be overidden in the actual unit test classes.
   105         * It is the default setup function that gets executed 
   105         * It is the default setup function that gets executed 
   106         * by the framework before each unit test case.
   106         * by the framework before each unit test case.
   112         * It is the default teardown function that gets executed 
   112         * It is the default teardown function that gets executed 
   113         * by the framework after each unit test case.
   113         * by the framework after each unit test case.
   114         */        
   114         */        
   115         IMPORT_C virtual void Teardown();
   115         IMPORT_C virtual void Teardown();
   116 
   116 
       
   117     protected:    // New functions    
   117         /**
   118         /**
   118         * Checks whteher the test case is being run using memory 
   119         * Checks whteher the test case is being run using memory 
   119         * allocation failure simulation.
   120         * allocation failure simulation.
   120         * @return ETrue if the test case is being run using memory 
   121         * @return ETrue if the test case is being run using memory 
   121         *         allocation failure simulation, EFalse if not
   122         *         allocation failure simulation, EFalse if not
   257         */        
   258         */        
   258         IMPORT_C void RecordNoLeaveFromStatementL(
   259         IMPORT_C void RecordNoLeaveFromStatementL(
   259             const TDesC8& aStatement,
   260             const TDesC8& aStatement,
   260             TInt aLineNumber,
   261             TInt aLineNumber,
   261             const TDesC8& aFileName ); 
   262             const TDesC8& aFileName ); 
       
   263 
       
   264 
       
   265 
       
   266 	 /**
       
   267         * Asserts that two TInt values are equal.
       
   268         * Leaves with a Symbian unit test framework specific error code
       
   269         * if the values are not equal.
       
   270         * In case of a failed assertion, the framework records 
       
   271         * the failure reason, line number and file name to the test results.
       
   272         * Use macro SYMBIAN_UT_ASSERT_EQUALS in symbianunittestmacros.h 
       
   273         * instead to avoid the need to pass the other parameters 
       
   274         * than the actual asserted values.  
       
   275         * 
       
   276         * @param aExpectedValue the expected value
       
   277         * @param aActualValue the actual value
       
   278         * @param aLineNumber the line number of the assertion
       
   279         * @param aFileName the name of the file where the assertion is located
       
   280         * @param aFailureMessage the error message
       
   281         */        
       
   282         IMPORT_C void AssertEqualsL( 
       
   283             TInt aExpectedValue,
       
   284             TInt aActualValue,
       
   285             TInt aLineNumber,
       
   286             const TDesC8& aFileName,
       
   287 	    const TDesC8& aFailureMessage );        
       
   288 
       
   289         /**
       
   290         * Asserts that two TDesC8 values are equal.
       
   291         * Leaves with a Symbian unit test framework specific error code
       
   292         * if the values are not equal.
       
   293         * In case of a failed assertion, the framework records 
       
   294         * the failure reason, line number and file name to the test results.
       
   295         * Use macro SYMBIAN_UT_ASSERT_EQUALS in symbianunittestmacros.h 
       
   296         * instead to avoid the need to pass the other parameters 
       
   297         * than the actual asserted values.  
       
   298         * 
       
   299         * @param aExpectedValue the expected value
       
   300         * @param aActualValue the actual value
       
   301         * @param aLineNumber the line number of the assertion
       
   302         * @param aFileName the name of the file where the assertion is located
       
   303         * @param aFailureMessage the error message
       
   304         */ 
       
   305         IMPORT_C void AssertEqualsL(
       
   306             const TDesC8& aExpectedValue,
       
   307             const TDesC8& aActualValue, 
       
   308             TInt aLineNumber, 
       
   309             const TDesC8& aFileName,
       
   310 	    const TDesC8& aFailureMessage );
       
   311 
       
   312         /**
       
   313         * Asserts that two TDesC16 values are equal.
       
   314         * Leaves with a Symbian unit test framework specific error code
       
   315         * if the values are not equal.
       
   316         * In case of a failed assertion, the framework records 
       
   317         * the failure reason, line number and file name to the test results.
       
   318         * Use macro SYMBIAN_UT_ASSERT_EQUALS in symbianunittestmacros.h 
       
   319         * instead to avoid the need to pass the other parameters 
       
   320         * than the actual asserted values.  
       
   321         * 
       
   322         * @param aExpectedValue the expected value
       
   323         * @param aActualValue the actual value
       
   324         * @param aLineNumber the line number of the assertion
       
   325         * @param aFileName the name of the file where the assertion is located
       
   326         * @param aFailureMessage the error message
       
   327         */        
       
   328         IMPORT_C void AssertEqualsL(
       
   329             const TDesC16& aExpectedValue,
       
   330             const TDesC16& aActualValue,
       
   331             TInt aLineNumber,
       
   332             const TDesC8& aFileName,
       
   333 	    const TDesC8& aFailureMessage );      
   262         
   334         
   263     private: // Internal class for a unit test function's data
   335     private: // Internal class for a unit test function's data
   264         
   336         
   265         class CSymbianUnitTestCase : public CBase
   337         class CSymbianUnitTestCase : public CBase
   266             {            
   338             {