1 TWellBehavedObjectTestOfInterfaceMacro(TSampleObjectWellBehavedObjectTest, TSampleObject); 2 3 TWellBehavedObjectTestOfImplementationMacro( TSampleObjectWellBehavedObjectTest, 4 TSampleObject, TOperatorComparator, TPolymorphicStreamer, (1), (2));
Line numbers 3 and 4 show the call to the implementation macro. The constructor for TSampleObject requires a single numeric value. The (1)
on line 4 represents the parameter for the first TSampleObject object. The (2)
on line 4 represents the parameter for the second TSampleObject object.
NOTE Compilers sometimes automatically define the empty constructor, copy constructor, and assignment operators. If you define these member functions as private, you will not be able to use TWellBehavedObjectTestOf because the template cannot be created.
The following table lists the protocol test macros syntax and shows an example of each macro.
Protocol test macro | Description |
TCopyTestOf | |
Tests copying of the target class using the global Copy function. | |
TCopyTestOfInterfaceMacro(testClass, targetClass) | |
Example: |
|
TCopyTestOfImplementationMacro(testClass, targetClass, comparatorClass, parameterList) | |
Example: |
TCopyTestOfImplementationMacro(TSampleObjectCopyTest,TSampleObject, TOrderedOperatorComparator, (1)); |
TFlattenResurectTestOf | |
Tests the flattening and resurrecting of the target object using the global Flatten and Resurrect functions. | |
TFlattenRessurectTestOfInterfaceMacro(testClass, targetClass) | |
Example: | TFlattenResurrectTestOfInterfaceMacro(TSampleObjectFlattenResurrectTest, TSampleObject); |
TFlattenRessurectTestOfImplementationMacro(testClass, targetClass, comparatorClass, parameterList) | |
Example: |
TFlattenResurrectTestOfImplementationMacro(TSampleObjectFlattenResurrectTest, TSampleObject, TOrderedOperatorComparator, (1)); TFlattenResurrectTestOfImplementationMacro(TSampleObjectFlattenResurrectTest, TSampleObject, TOrderedOperatorComparator,); |
TStreamTestOf | |
Tests streaming of the target object. | |
TStreamTestOfInterfaceMacro(testClass, targetClass) | |
Example: | TStreamTestOfInterfaceMacro(TSampleObjectStreamTest, TSampleObject); |
TStreamTestOfImplementationMacro(testClass, targetClass, comparatorClass, streamerClass, parameterList) | |
Example: |
TStreamTestOfImplementationMacro(TSampleObjectStreamTest, TSampleObject, TOperatorComparator, TPolymorphicStreamer, (1));
|
TPrimitiveComparisonTestOf | |
Tests the constructor, destructor, copy constructor, and assignment operator for a concrete class only. | |
TPrimitiveComparisonTestOfInterfaceMacro(testClass, targetClass) | |
Example: | TPrimitiveComparisonTestOfInterfaceMacro(TSampleObjectPrimitiveComparisonTest, TSampleObject); |
TPrimitiveComparisonTestOfImplementationMacro(testClass, targetClass, comparatorClass, parameterList, unequalParameterList) | |
Example: |
TPrimitiveComparisonTestOfImplementationMacro( TSampleObjectPrimitiveComparisonTest, TSampleObject, TOrderedOperatorComparator, (1), (2));
|
TPrimitiveComparisonTestOfEqualOnly | |
Tests the constructor, destructor, copy constructor, and assignment operator. This macro does not test the target against an unequal object of the same type. | |
TPrimitiveComparisonTestOfEqualOnlyInterfaceMacro(testClass, targetClass) | |
Example: | TPrimitiveComparisonTestOfEqualOnlyInterfaceMacro (TSampleObjectPrimitiveComparisonTestEqualOnly, TSampleObject); |
TPrimitiveComparisonTestOfEqualOnlyImplementationMacro(testClass, targetClass, comparatorClass, parameterList) | |
Example: |
TPrimitiveComparisonTestOfImplementationMacro( TSampleObjectPrimitiveComparisonTest, TSampleObject, TOrderedOperatorComparator, (1));
|
TWellBehavedObjectTestOf | |
Creates and performs the TCopyTestOf, TStreamTestOf, TFlattenResurrectTestOf, and TPrimitiveComparisonTestOf. Turn off the TPrimitiveComparisonTestOf by specifying -p after the -o option when you use RunTest. | |
TWellBehavedObjectTestOfInterfaceMacro(testClass, targetClass) | |
Example: |
|
TWellBehavedObjectTestOfImplementationMacro(testClass, targetClass, comparatorClass, streamerClass, parameterList, unequalParameterList) | |
Example: |
TWellBehavedObjectTestOfImplementationMacro( TSampleObjectWellBehavedObjectTest, TSampleObject, TOrderedOperatorComparator,TPolymorphicStreamer, (1), (2)); TWellBehavedObjectTestOfImplementationMacro(TSampleObjectWellBehavedObjectTest, TSampleObject, TOrderedOperatorComparator, TPolymorphicStreamer,, (2)); |
TWellBehavedObjectTestOfEqualOnly | |
Creates and performs the TCopyTestOf, TStreamTestOf, TFlattenResurrectTestOf, and TPrimitiveComparisonTestOf. This macro does not test the target against an unequal object of the same type. | |
TWellBehavedObjectTestOfEqualOnlyInterfaceMacro(testClass, targetClass) | |
Example: |
|
TWellBehavedObjectTestOfEqualOnlyImplementationMacro(testClass, targetClass, comparatorClass, streamerClass, parameterList, unequalParameterList) | |
Example: |
TWellBehavedObjectTestOfEqualOnlyImplementationMacro (TSampleObjectWellBehavedObjectTestEqualOnly, TSampleObject, TOrderedOperatorComparator, TPolymorphicStreamer, (1), (2)); |