29 cout <<
"*** AthenaOutputStream_test starts ***" <<endl;
30 ISvcLocator* pSvcLoc(0);
31 if (!initGaudi(
"AthenaOutputStream_test.txt", pSvcLoc)) {
32 cerr <<
"This test can not be run" << endl;
38 const bool CREATEIF(
true);
39 IClassIDSvc* pCLIDSvc(0);
40 assert( (pSvcLoc->service(
"ClassIDSvc", pCLIDSvc, CREATEIF)).isSuccess() );
43 StoreGateSvc* pStore(0);
44 assert( (pSvcLoc->service(
"StoreGateSvc", pStore, CREATEIF)).isSuccess() );
47 SmartIF<IAlgManager> algMan(IID_IAlgManager, pSvcLoc);
48 assert( algMan.isValid() );
50 assert( (algMan->createAlgorithm(
"AthenaOutputStream",
"AthenaOutputStream", pAlg)).isSuccess() );
52 assert( (pAlg->sysInitialize()).isSuccess() );
53 assert( (pAlg->initialize()).isSuccess() );
55 assert( (pStore->record(
new Foo(),
"uno")).isSuccess());
56 assert( (pStore->record(
new Foo(),
"due")).isSuccess());
57 assert( (pStore->record(
new Bar(),
"uno")).isSuccess());
58 assert( (pStore->record(
new Bar(),
"due")).isSuccess());
60 AthenaOutputStream* pStream(
dynamic_cast<AthenaOutputStream*
>(pAlg));
64 pStream->collectAllObjects();
70 assert( 4 == (pStream->selectedObjects()->end() -
71 pStream->selectedObjects()->begin()) );
73 pStream->clearSelection();
74 assert( 0 == (pStream->selectedObjects()->end() -
75 pStream->selectedObjects()->begin()) );
79 cout <<
"*** AthenaOutputStream_test OK ***" <<endl;