### IStreamTestOf

  Tests the streaming of the target object using operator<<= and operator>>=

  IStreamTestOf is a subclass of ITest which tests the streaming of the target. Clients should create a subclass of IStreamTestOf or use streamTestMacro (see below).

  This test is a good way to leverage testing effort since it allows one to test classes if those classes are expected to adhere to some protocol. This protocol test is implemented using a template class. Target classes MUST have operator= defined to be tested by IStreamTestOf. One macro and one global function are provided for easy use of this class.

  The macro streamTestMacro does everything you need in one line. It writes the entire header and the entire implementation. Just supply the name of the test class, target class and the parameter list for the constructor that creates the target. The parameter list may be left blank to indicate that the empty constructor is to be used to create the target. For example, ISample is the target class that we want to test streaming. ISample has operator<<=, operator>>=, and operator== defined.

            streamTestMacro(ISampleTest,ISample,(1));

  The following is an example of a class which creates the target object using the empty constructor:

            streamTestMacro(ISampleTest,ISample,);

  Now you can run ISampleTest with runTestImplementationMacro:

            runTestImplementationMacro(ISampleTest);

  Or you can use this global function which creates and returns an instance of IStreamTestOf, as follows:

                   createStreamTest(new ISample(2));

  This can be used with the adoptTest method in the ITestCollection class.

### IStreamTestOf - Member Functions and Data by Group

### Constructors & Destructor

Class constructors and destructors.

~IStreamTestOf

      public:
      virtual ~IStreamTestOf()

  Destructs objects of this class.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

IStreamTestOf
  Constructs objects of this class.

  Overload 1

      public:
      IStreamTestOf(const IStreamTestOf < AType >&)

  Copy constructor.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

  Overload 2

      public:
      IStreamTestOf(AType* target)

  Constructor which specifies the target object to perform tests on.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Assignment Operators

Use this operator to replace the existing object with the assigned, given one.

operator =

      public:
      IStreamTestOf < AType >&
        operator =( const IStreamTestOf < AType >& )

  Standard assignment operator.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Meta Information

Class member functions used to provide information about the tests.

copyInfo

      public:
      virtual void copyInfo()

  Within copyInfo, ISteamTestOf calls the inherited implementation. For example, IDerived::copyInfo should call IBase::copyInfo. Then copyInfo should add key/value pairs to infoMap by calling the addInfo() method.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Output Methods

Class members used to display information to the user.

targetClassNameAsString

      protected:
      virtual const char* targetClassNameAsString() const

  Returns the name of the target class. Be default, it returns null. You can override this method if the target class name is to be reported in the test output.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Test Methods

Methods used to run the streaming test.

test

      protected:
      virtual void test()

  Streams the target object out to and in from the memory stream and compares the streamed-in object with the original.

  The test method also verifies that the stream position is consistent after stream-out and stream-in.

  Note: Do not override this method. The best way to use the IStreamTestOf framework is to use the protocol StreamTestMacro.

  ITest overrides; these methods are called by the framework ITest::run()

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### IStreamTestOf - Inherited Member Functions and Data

#### Inherited Public Functions

  ITest

  -     virtual ~ITest()

  -     void copyInputs(int& argc, char * *& argv) const

  -     virtual EStage exceptionStage() const

  -     virtual bool lookupInfo(const IString& key, IString& info)

  -     ITest& operator =(const ITest& test)

  -     ITieredTextBuffer& outputTextStream()

  -     virtual void run()

  -     virtual unsigned long runCount() const

  -     void setInputs(const int argc, const char * const* argv)

  -     bool success() const

#### Inherited Public Data

  ITest

  -     static const IString & _Import kComponentKey

  -     static const IString& kComponentKey

  -     static const IString& kDescriptionKey

  -     static const IString & _Import kDescriptionKey

  -     static const IString & _Import kInputSyntaxKey

  -     static const IString& kInputSyntaxKey

  -     static const IString& kTargetClassKey

  -     static const IString & _Import kTargetClassKey

  -     static const IString & _Import kTestNameKey

  -     static const IString& kTestNameKey

  -     static const IString & _Import kTestTypeKey

  -     static const IString& kTestTypeKey

  -     static const IString& kTestVersionKey

  -     static const IString & _Import kTestVersionKey

#### Inherited Protected Functions

  ITest

  -     virtual void addInfo(const IString&, const IString&)

  -     virtual void cleanup()

  -     virtual bool isReset() const

  -     virtual bool isSuccessUndecided() const

  -     ITest()

  -     ITest(const ITest& test)

  -     virtual void print(ITieredTextBuffer&)

  -     virtual void reset()

  -     virtual void setStickySuccess(bool success)

  -     virtual void setSuccess(bool success)

  -     virtual void setup()

  -     virtual void test() = 0

#### Inherited Protected Data

  - None