Overriding inherited TTest member functions

Derived classes of TTest need to override the streaming operators when member variables are added to the class. These new member variables must also be streamed for the test to be functional.

Override Hash and IsEqual when you want additional derived class information to be considered for hashing and equality testing. In your derived class, you must call the corresponding parent class member function. For example, your Hash member function needs to call the parent class Hash member function. The following example shows a test class Hash member function.

      long TSampleObjectLengthTest::Hash() const
      {
          long hash = TSampleObjectBaseTest::Hash();
      
          hash += (long)fIntegerOption;
          
          return hash;
      }

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker