29 cout <<
"*** AthenaOutputStream_test starts ***" << endl;
30 ISvcLocator* pSvcLoc( 0 );
31 if ( !initGaudi(
"AthenaOutputStream_test.txt", pSvcLoc ) )
33 cerr <<
"This test can not be run" << endl;
39 const bool CREATEIF(
true );
40 IClassIDSvc* pCLIDSvc( 0 );
41 assert( ( pSvcLoc->service(
"ClassIDSvc", pCLIDSvc, CREATEIF ) ).isSuccess() );
44 StoreGateSvc* pStore( 0 );
45 assert( ( pSvcLoc->service(
"StoreGateSvc", pStore, CREATEIF ) ).isSuccess() );
48 SmartIF<IAlgManager> algMan( IID_IAlgManager, pSvcLoc );
49 assert( algMan.isValid() );
50 IAlgorithm* pAlg( 0 );
51 assert( ( algMan->createAlgorithm(
"AthenaOutputStream",
"AthenaOutputStream", pAlg ) )
54 assert( ( pAlg->sysInitialize() ).isSuccess() );
55 assert( ( pAlg->initialize() ).isSuccess() );
57 assert( ( pStore->record(
new Foo(),
"uno" ) ).isSuccess() );
58 assert( ( pStore->record(
new Foo(),
"due" ) ).isSuccess() );
59 assert( ( pStore->record(
new Bar(),
"uno" ) ).isSuccess() );
60 assert( ( pStore->record(
new Bar(),
"due" ) ).isSuccess() );
62 AthenaOutputStream* pStream(
dynamic_cast<AthenaOutputStream*
>( pAlg ) );
66 pStream->collectAllObjects();
72 assert( 4 == ( pStream->selectedObjects()->end() - pStream->selectedObjects()->begin() ) );
74 pStream->clearSelection();
75 assert( 0 == ( pStream->selectedObjects()->end() - pStream->selectedObjects()->begin() ) );
78 cout <<
"*** AthenaOutputStream_test OK ***" << endl;