Placing test code in shared libraries

To work around this restriction on flattening and resurrecting persistent objects in test programs, write your test code inside of a function with a name like MyMain, or TestMain. Place this code inside a module that is built as a shared library, then call MyMain or TestMain from the actual test program.

      // MainProgramModule.C
    
      main()
    { MyMain(); } // SharedLibraryForMyMain.C void MyMain() { TSetOf<TDocument> aDocumentSet; // Code to flatten aDocumentSet ... // Code to resurrect aDocumentSet }
The code inside SharedLibraryForMyMain.C should work properly. Type information to support object persistence for all classes defined in the module is automatically appended when the shared library is built.


[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