Creating CopyInfo keywords

To create keys for the information about the test you need to store:

  1. Override the CopyInfo member function, if you have not already done so.
  2. Make sure your CopyInfo member function calls the parent CopyInfo function.
    This makes sure that any information added to the parent class is available.
  3. Define your key by creating a TStandardText object on the heap that contains the keyword for your key. In the keyword, capitalization and spacing are significant.
  4. Use the AddKeyValuePair member function to specify the information you want to store in the key.
      void TSampleObjectBaseTest::CopyInfo(TDictionaryOf<TStandardText,TText>& infoDict) const
      {
          TTest::CopyInfo;
          TAllocationHeap heap(&infoDict);
          
          // You can define your own keywords
          static const TStandardText kSampleTestInformationKey("Sample Info");
          
          // Developer defined key
          infoDict.AddKeyValuePair(new(heap) TStandardText(kSampleTestInformationKey), new(heap) TStandardText(
              "This is the way to add your test information"));
      }

[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