Revision: 201019
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 27 May 2010 13:59:44 +0300
changeset 3 ae3f1779f6da
parent 2 6c1a2771f4b7
child 7 a5fbfefd615f
Revision: 201019 Kit: 2010121
qcpix/src/platform/s60/src/qcpixsearcherprivate.cpp
qcpix/src/qcpixsearcher.cpp
qcpix/tsrc/qtcpixunittests/src/ut_qtcpixsearcher.cpp
searchengine/cpix/cpix/inc/public/appclass-hierarchy.txt
searchengine/cpix/cpix/src/fileparser/fileparser.cpp
searchengine/cpix/cpix/src/qrytypes/prefixqrytype.cpp
searchengine/cpix/tsrc/cpixsample/src/cpixsample.cpp
searchengine/cpix/tsrc/cpixunittest/group/cpixunittest.mmp
searchengine/cpix/tsrc/cpixunittest/inc/std_log_result.h
searchengine/cpix/tsrc/cpixunittest/src/aggregatetests.cpp
searchengine/cpix/tsrc/cpixunittest/src/analysis.cpp
searchengine/cpix/tsrc/cpixunittest/src/analysiswhitebox.cpp
searchengine/cpix/tsrc/cpixunittest/src/asynctests.cpp
searchengine/cpix/tsrc/cpixunittest/src/deletiontests.cpp
searchengine/cpix/tsrc/cpixunittest/src/destructivetests.cpp
searchengine/cpix/tsrc/cpixunittest/src/documenttest.cpp
searchengine/cpix/tsrc/cpixunittest/src/domainselectiontests.cpp
searchengine/cpix/tsrc/cpixunittest/src/en_stemtests.cpp
searchengine/cpix/tsrc/cpixunittest/src/flushtests.cpp
searchengine/cpix/tsrc/cpixunittest/src/geotests.cpp
searchengine/cpix/tsrc/cpixunittest/src/heartbeattests.cpp
searchengine/cpix/tsrc/cpixunittest/src/mapstests.cpp
searchengine/cpix/tsrc/cpixunittest/src/multivolumetests.cpp
searchengine/cpix/tsrc/cpixunittest/src/negativetests.cpp
searchengine/cpix/tsrc/cpixunittest/src/partialsmstests.cpp
searchengine/cpix/tsrc/cpixunittest/src/pdftests.cpp
searchengine/cpix/tsrc/cpixunittest/src/prematureqrytests.cpp
searchengine/cpix/tsrc/cpixunittest/src/querytest.cpp
searchengine/cpix/tsrc/cpixunittest/src/randomtest.cpp
searchengine/cpix/tsrc/cpixunittest/src/std_log_result.cpp
searchengine/cpix/tsrc/cpixunittest/src/terms.cpp
searchengine/cpix/tsrc/cpixunittest/src/testutils.cpp
searchengine/cpix/tsrc/cpixunittest/src/utf8.cpp
searchengine/cpix/tsrc/cpixunittest/src/whiteboxtests.cpp
--- a/qcpix/src/platform/s60/src/qcpixsearcherprivate.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/qcpix/src/platform/s60/src/qcpixsearcherprivate.cpp	Thu May 27 13:59:44 2010 +0300
@@ -35,8 +35,10 @@
 void QCPixSearcherPrivate::Construct( QString aDefaultSearchField )
     {
     qt_symbian_throwIfError( iSearchSession.Connect() );//throw exception on error.
+    QT_TRAP_THROWING(
     TBuf<KMaxStringLength> defaultSearchField( aDefaultSearchField.utf16() );
-    QT_TRAP_THROWING( iSearcher = CCPixSearcher::NewL( iSearchSession, defaultSearchField  ) );
+    iSearcher = CCPixSearcher::NewL( iSearchSession, defaultSearchField  ) 
+    ); //end of QT_TRAP_THROWING
     }
 
 QCPixSearcherPrivate::~QCPixSearcherPrivate()
--- a/qcpix/src/qcpixsearcher.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/qcpix/src/qcpixsearcher.cpp	Thu May 27 13:59:44 2010 +0300
@@ -71,26 +71,49 @@
 
 void QCPixSearcher::setDatabase( QString aBaseAppClass )
     {
+    QT_TRAP_THROWING( 
     TBuf<KMaxStringLength> baseAppClass( aBaseAppClass.utf16() );
-    QT_TRAP_THROWING( iPvtImpl->iSearcher->OpenDatabaseL( baseAppClass ) );
+    iPvtImpl->iSearcher->OpenDatabaseL( baseAppClass ) 
+    ); //end of QT_TRAP_THROWING
     }
 
 void QCPixSearcher::setDatabaseAsync( QString aBaseAppClass )
     {
+    QT_TRAP_THROWING( 
     TBuf<KMaxStringLength> baseAppClass( aBaseAppClass.utf16() );
-    QT_TRAP_THROWING( iPvtImpl->iSearcher->OpenDatabaseL( *iPvtImpl, baseAppClass ) );
+    iPvtImpl->iSearcher->OpenDatabaseL( *iPvtImpl, baseAppClass ) 
+    ); //end of QT_TRAP_THROWING
     }
 
+//The following bit of code is common to two functions - this helps to avoid duplication.
+//However, macros make debugging difficult - so, if you need to debug, copy the code below
+//and replace the macro, fix the code and bring the fix back to the macro.
+#define CREATE_SEARCH_VARS \
+        HBufC* searchString = HBufC::NewL( aSearchString.length() + 1 );                    \
+        TPtrC searchStringPtr( reinterpret_cast<const TUint16*>( aSearchString.utf16() ) ); \
+        searchString->Des().Copy( searchStringPtr );                                        \
+                                                                                            \
+        HBufC* defaultSearchField = HBufC::NewL( aDefaultSearchField.length() + 1 );        \
+        TPtrC aDefaultSearchFieldPtr( reinterpret_cast<const TUint16*>( aDefaultSearchField.utf16() ) );\
+        defaultSearchField->Des().Copy( aDefaultSearchFieldPtr );                           
+
+#define DELETE_SEARCH_VARS  \
+        delete searchString;\
+        delete defaultSearchField;
+
 int QCPixSearcher::search( QString aSearchString, QString aDefaultSearchField )
     {
     PERF_SEARCH_RESTART_TIMER
-    TBuf<KMaxStringLength> searchString( aSearchString.utf16() );
-    TBuf<KMaxStringLength> defaultSearchField( aDefaultSearchField.utf16() );
-    //ideally would have had just the following single line:
-    //QT_TRAP_THROWING( return iPvtImpl->iSearcher->SearchL( searchString, defaultSearchField ) );
-    //But the RCVT compiler throws up warnings. The following is just to suppress those warnings.
     int tmp = 0;
-    QT_TRAP_THROWING( tmp = iPvtImpl->iSearcher->SearchL( searchString, defaultSearchField ) );
+    QT_TRAP_THROWING(
+        CREATE_SEARCH_VARS;
+        //ideally would have had just the following single line:
+        //QT_TRAP_THROWING( return iPvtImpl->iSearcher->SearchL( searchString, defaultSearchField ) );
+        //But the RCVT compiler throws up warnings. The following is just to suppress those warnings.
+        tmp = iPvtImpl->iSearcher->SearchL( *searchString, *defaultSearchField );
+        DELETE_SEARCH_VARS;
+    ); //QT_TRAP_THROWING
+    
     PERF_SEARCH_ENDLOG
     return tmp;
     }
@@ -98,9 +121,11 @@
 void QCPixSearcher::searchAsync( QString aSearchString, QString aDefaultSearchField )
     {
     PERF_TIME_NOW("Async search start")
-    TBuf<KMaxStringLength> searchString( aSearchString.utf16() );
-    TBuf<KMaxStringLength> defaultSearchField( aDefaultSearchField.utf16() );
-    QT_TRAP_THROWING( iPvtImpl->iSearcher->SearchL( *iPvtImpl, searchString, defaultSearchField ) );
+    QT_TRAP_THROWING(
+        CREATE_SEARCH_VARS;
+        iPvtImpl->iSearcher->SearchL( *iPvtImpl, *searchString, *defaultSearchField );
+        DELETE_SEARCH_VARS;
+    ); //QT_TRAP_THROWING
     }
 
 QCPixDocument* QCPixSearcher::getDocument( int aIndex )
--- a/qcpix/tsrc/qtcpixunittests/src/ut_qtcpixsearcher.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/qcpix/tsrc/qtcpixunittests/src/ut_qtcpixsearcher.cpp	Thu May 27 13:59:44 2010 +0300
@@ -31,7 +31,8 @@
     QTest::newRow("Robert") << "Robert" << 53; \
     QTest::newRow("Leonar") << "Leonar" << 74; \
     QTest::newRow("Leas") << "Leas" << 8; \
-    QTest::newRow("Not Found") << "Not Found" << 0;
+    QTest::newRow("Not Found") << "Not Found" << 0; \
+    QTest::newRow("This is a very long string. Trying to make the search string more than 255 characters. Is it more than 255 yet? Not sure. Dont think so. Guess this should do. No It does not. How much more do I have to type to make the string 255 characters long...bored of typing...hope this would do...Yes, now about 300 chars!") << "Long String" << 0;
     
 #define TEST_SEARCH_DATA_FETCH \
     QFETCH( QString, searchString ); \
--- a/searchengine/cpix/cpix/inc/public/appclass-hierarchy.txt	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/cpix/inc/public/appclass-hierarchy.txt	Thu May 27 13:59:44 2010 +0300
@@ -1,124 +1,146 @@
+Summary:
+This document summarizes the various content types and their fields that indexed by the CPiX engine.
 
+Note: 
+1. By default, all EIndexTokenized fields are aggregated, unless explicitly chosen to ENoAggregate.
+2. By default, the contents of all EIndexTokenized fields that are aggregated are meant to be added to the Excerpt field. 
+3. Any fields starting with an underscore (_) are designated as system fields and by default are neither aggregated nor added to excerpt field.
+4. The order of fields in the excerpt field is the order in which they appear below. The order has been chosen based on the 'Details/Edit' view of the corresponding application.
 
+Legend for excerpt field:
+ExcerptYes: the field has been chosen to be part of the excerpt field.
+ExcerptNo : the field has been explicity opted out of the excerpt field (even though it is EIndexTokenized).
+ExcerptNA : the field is not EIndexTokenized, and hence will not be applicable to be added to the excerpt field.
+
+Indexed content types:
+----------------------
   root
-    | [ _docuid      ]		{EStoreYes | EIndexUnTokenized}
-    | [ _appclass    ]		{EStoreYes | EIndexTokenized}	
-    | [ _appclass_ut ]		{EStoreNo  | EIndexUnTokenized}
-    | [ _aggregate   ]      {EStoreNo  | EIndexUnTokenized} 	
-    | [ _excerpt     ]		{EStoreYes | EIndexNo}
-    | [ _mimetype (opt) ]	{EStoreYes | EIndexNo}
+    | [ _docuid      ]        {EStoreYes | EIndexUnTokenized}
+    | [ _appclass    ]        {EStoreYes | EIndexTokenized}    
+    | [ _appclass_ut ]        {EStoreNo  | EIndexUnTokenized}
+    | [ _aggregate   ]        {EStoreNo  | EIndexUnTokenized}     
+    | [ _excerpt     ]        {EStoreYes | EIndexNo}
+    | [ _mimetype (opt) ]     {EStoreYes | EIndexNo}
     |
     +-- msg
-    | [ To     		]	{EStoreYes | EIndexTokenized}
-    | [ From   		]	{EStoreYes | EIndexTokenized}
-    | [ Body   		]	{EStoreYes | EIndexTokenized}
-    | [ Folder 		]	{EStoreYes | EIndexNo}
-    | [ Subject 	] 	{EStoreYes | EIndexTokenized}
+    | [ To         ]    {EStoreYes | EIndexTokenized} {ExcerptYes, if present}
+    | [ From       ]    {EStoreYes | EIndexTokenized} {ExcerptYes, if present}
+    | [ Body       ]    {EStoreYes | EIndexTokenized} {ExcerptYes}
+    | [ Folder     ]    {EStoreYes | EIndexNo}        {ExcerptNA}
+    | [ Subject    ]    {EStoreYes | EIndexTokenized} {ExcperptNo}
     |
     |
     +-- file
     |     |
-    | 		|
+    |         |
     |     +-- content
-    |			|	[ Contents 	]			{EStoreYes | EIndexTokenized}
-    |			| [ Name      ]     {EStoreNo  | EIndexTokenized}
-    |			| [ BaseName  ]     {EStoreNo  | EIndexTokenized}
-    |     | [ Extension ]     {EStoreNo  | EIndexTokenized}
-    |			|
-    |			+-- folder
-    |			  [ Name  	  ]     {EStoreYes | EIndexTokenized}
-    |			  [ Extension ]     {EStoreYes | EIndexUnTokenized}
+    |            | [ Contents  ]     {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |            | [ Name      ]     {EStoreYes | EIndexTokenized}   {ExcerptNo}
+    |            | [ BaseName  ]     {EStoreNo  | EIndexTokenized}   {ExcerptNo}
+    |            | [ Extension ]     {EStoreNo  | EIndexTokenized}      {ExcerptNo}
+    |            |
+    |            +-- folder
+    |              [ Name      ]     {EStoreYes | EIndexTokenized}      {ExcerptNo}
+    |              [ Extension ]     {EStoreYes | EIndexUnTokenized}    {ExcerptNA}
     |
     |      
     +-- media
     |     | 
     |     |
     |     +-- audio
-    |     | [ Name           ]	{EStoreYes | EIndexTokenized}
-    |     | [ MediaId        ]	{EStoreYes | EIndexUnTokenized}
-    |     | [ Title          ]  {EStoreYes | EIndexTokenized}
-    |     | [ ItemType       ]  {EStoreYes | EIndexUnTokenized}
-    |     | [ Extension      ]  {EStoreYes | EIndexTokenized}
-    |     | [ Album          ]  {EStoreYes | EIndexTokenized}
-    |	    | [ AlbumArtist    ]	{EStoreYes | EIndexTokenized}
-    |     | [ OriginalArtist ]	{EStoreYes | EIndexTokenized}
-    |     | [ Composer       ]	{EStoreYes | EIndexTokenized}
-    |     | [ Artist         ]	{EStoreYes | EIndexTokenized}
+    |     | [ Name           ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |     | [ MediaId        ]    {EStoreYes | EIndexUnTokenized} {ExcerptNo}
+    |     | [ Title          ]    {EStoreYes | EIndexTokenized}   {ExcerptNo}
+    |     | [ ItemType       ]    {EStoreYes | EIndexUnTokenized} {ExcerptNo} 
+    |     | [ Extension      ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |     | [ Album          ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |     | [ AlbumArtist    ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |     | [ OriginalArtist ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |     | [ Composer       ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |     | [ Artist         ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
     |     | 
     |     |
     |     +-- image
-    |     | [ Name           ]	{EStoreYes | EIndexTokenized}
-    |     | [ MediaId        ]	{EStoreYes | EIndexUnTokenized}
-    |     | [ Title          ]  {EStoreYes | EIndexTokenized}
-    |     | [ ItemType       ]  {EStoreYes | EIndexUnTokenized}
-    |     | [ Extension      ]  {EStoreYes | EIndexTokenized}    
-    |     | [ Comment        ]  {EStoreYes | EIndexTokenized}
-    |     | [ DateTimeOrignal]	{EStoreYes | EIndexUnTokenized}
+    |     | [ Name           ]    {EStoreYes | EIndexTokenized}   {ExcerptNo}
+    |     | [ MediaId        ]    {EStoreYes | EIndexUnTokenized} {ExcerptNA}
+    |     | [ Title          ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |     | [ ItemType       ]    {EStoreYes | EIndexUnTokenized} {ExcerptNA}
+    |     | [ Extension      ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |     | [ Comment        ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |     | [ DateTimeOrignal]    {EStoreYes | EIndexUnTokenized} {ExcerptNA}
     |     |
     |     |    
     |     +-- video
-    |	      [ Name           ]	{EStoreYes | EIndexTokenized}
-    |       [ MediaId        ]	{EStoreYes | EIndexUnTokenized}
-    |       [ Title          ]  {EStoreYes | EIndexTokenized}
-    |       [ ItemType       ]  {EStoreYes | EIndexUnTokenized}
-    |       [ Extension      ]  {EStoreYes | EIndexTokenized}
-    |	      [ Artist         ]  {EStoreYes | EIndexTokenized}
-    |       [ Author         ]	{EStoreYes | EIndexTokenized}
-    |       [ Copyright      ]  {EStoreYes | EIndexTokenized}
-    |       [ Description    ]	{EStoreYes | EIndexTokenized}
-    |	      [ Comment        ]	{EStoreYes | EIndexTokenized}  
+    |       [ Name           ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |       [ MediaId        ]    {EStoreYes | EIndexUnTokenized} {ExcerptNo}
+    |       [ Title          ]    {EStoreYes | EIndexTokenized}   {ExcerptNo}
+    |       [ ItemType       ]    {EStoreYes | EIndexUnTokenized} {ExcerptYes}
+    |       [ Extension      ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |       [ Artist         ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |       [ Author         ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |       [ Copyright      ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |       [ Description    ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |       [ Comment        ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
     |
     |
     +-- contact
-    | [ GivenName   		]	{EStoreYes | EIndexTokenized}
-    | [ FamilyName  		]	{EStoreYes | EIndexTokenized}	
-    | [ CompanyName 		]	{EStoreYes | EIndexTokenized}
-    | [ PhoneNumber 		]	{EStoreYes | EIndexTokenized}
-    | [ Address     		]	{EStoreYes | EIndexTokenized}
-    | [ Note        		]	{EStoreYes | EIndexTokenized}
-    | [ JobTitle    		]	{EStoreYes | EIndexTokenized}
-    | [ SecondName  		]	{EStoreYes | EIndexTokenized}
-    | [ Suffix      		]	{EStoreYes | EIndexTokenized}
-    | [ EMail       		]	{EStoreYes | EIndexTokenized}
-    | [ URL         		]	{EStoreYes | EIndexTokenized}
-    | [ PostOffice  		]	{EStoreYes | EIndexTokenized}
-    | [ ExtendedAddress  	]	{EStoreYes | EIndexTokenized}
-    | [ Locality  		]	{EStoreYes | EIndexTokenized}
-    | [ Region  		]	{EStoreYes | EIndexTokenized}
-    | [ PostCode  		]	{EStoreYes | EIndexTokenized}
-    | [ Country  		]	{EStoreYes | EIndexTokenized}
-    | [ SIPID  			]	{EStoreYes | EIndexTokenized}
-    | [ Spouse  		]	{EStoreYes | EIndexTokenized}
-    | [ Children  		]	{EStoreYes | EIndexTokenized}
-    | [ Class  			]	{EStoreYes | EIndexTokenized}	
-    | [ Prefix  		]	{EStoreYes | EIndexTokenized}
-    | [ AdditionalName  	]	{EStoreYes | EIndexTokenized}
-    | [ Fax  			]	{EStoreYes | EIndexTokenized}
-    | [ GivenNamePronunciation 	]	{EStoreYes | EIndexTokenized}
-    | [ FamilyNamePronunciation ]	{EStoreYes | EIndexTokenized}
-    | [ CompanyNamePronunciation]	{EStoreYes | EIndexTokenized}
+	/* The order of fields in excerpt is as below. The order in this case
+	 * is the order of fields shown when you 'Edit' the contact.
+	 */
+    | [ GivenName           ]    {EStoreYes | EIndexTokenized}   {ExcerptNo}
+    | [ FamilyName          ]    {EStoreYes | EIndexTokenized}   {ExcerptNo}
+    | [ PhoneNumber         ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+	| [ EMail               ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+	| [ SIPID               ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+	| [ CompanyName         ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ JobTitle            ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ Note                ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+	/* The following fields are not displayed when 'Edit'-ing the contact.
+	 * The order here is arbitrary.
+	 */
+    | [ Address             ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ SecondName          ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ Suffix              ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ URL                 ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ PostOffice          ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ ExtendedAddress     ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ Locality            ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ Region              ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ PostCode            ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ Country             ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ Spouse              ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ Children            ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ Class               ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ Prefix              ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ AdditionalName      ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ Fax                 ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ GivenNamePronunciation      ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ FamilyNamePronunciation     ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ CompanyNamePronunciation    ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
     |
     |
     +-- calendar
-    | [ Summary     	]   	{EStoreYes | EIndexTokenized}
-    | [ Description 	]	{EStoreYes | EIndexTokenized}
-    | [ Location    	]	{EStoreYes | EIndexTokenized}
-    | [ StartTime   	] (YYYYMMDDHHSS) (TimeZone UTC)	{EStoreYes | EIndexUnTokenized}
-    | [ EndTime     	] (YYYYMMDDHHSS) (TimeZone UTC)	{EStoreYes | EIndexUnTokenized}
+    | [ Summary         ]    {EStoreYes | EIndexTokenized}   {ExcerptNo}
+    | [ Description     ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ Location        ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    | [ StartTime       ] (YYYYMMDDHHSS) (TimeZone UTC)    {EStoreYes | EIndexUnTokenized}   {ExcerptNA}
+    | [ EndTime         ] (YYYYMMDDHHSS) (TimeZone UTC)    {EStoreYes | EIndexUnTokenized}   {ExcerptNA}
     | 
     |    
     +-- bookmark
-    | [ Name       ] 		{EStoreYes | EIndexTokenized}
-    | [ Url 	   ] 		{EStoreYes | EIndexTokenized} 
+    | [ Name       ]    {EStoreYes | EIndexTokenized}   {ExcerptNo}
+    | [ Url        ]    {EStoreYes | EIndexTokenized}   {ExcerptYes}
+    |
     |
     +-- applications
-    | [ Name       ]       	{EStoreYes | EIndexTokenized}
-    | [ Uid        ]       	{EStoreYes | EIndexTokenized}
-    | [ Path       ]       	{EStoreYes | EIndexTokenized}
+    | [ Name       ]    {EStoreYes | EIndexTokenized}                     {ExcerptNo}
+    | [ Uid        ]    {EStoreYes | EIndexTokenized | ENoAggregate}      {ExcerptNo}
+    | [ Path       ]    {EStoreYes | EIndexTokenized}                     {ExcerptNo}
+    |
     |
     +-- notes
-    | [ Date       ]  (YYYYMMDDHHSS)  {EStoreYes | EIndexUnTokenized}
-    | [ Memo       ]       	{EStoreYes | EIndexTokenized}
+    | [ Date       ]  (YYYYMMDDHHSS)    {EStoreYes | EIndexUnTokenized}   {ExcerptNA}
+    | [ Memo       ]                    {EStoreYes | EIndexTokenized}     {ExcerptNo}
 
 
 For instance, a document for an email message should have the
--- a/searchengine/cpix/cpix/src/fileparser/fileparser.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/cpix/src/fileparser/fileparser.cpp	Thu May 27 13:59:44 2010 +0300
@@ -160,7 +160,7 @@
         auto_ptr<Field>
             newField(new Field(LFULLNAME_FIELD,
                                wFullName.c_str(),
-                               cpix_STORE_NO 
+                               cpix_STORE_YES
                              | cpix_INDEX_TOKENIZED
                              | cpix_AGGREGATE_YES));
 
--- a/searchengine/cpix/cpix/src/qrytypes/prefixqrytype.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/cpix/src/qrytypes/prefixqrytype.cpp	Thu May 27 13:59:44 2010 +0300
@@ -31,6 +31,7 @@
 #include "initparams.h"
 #include "cpixutil.h"
 #include "iqrytype.h"
+#include "analyzer.h"
 
 #include "cpixmaindefs.h"
 
@@ -63,20 +64,28 @@
                            const std::list<std::wstring> & args,
                            const wchar_t                 * qryStr)
         {
-            wchar_t mQryStr[250];
-
-            wmemset(mQryStr,0,250);
-            getAnalyzedString(qryStr, mQryStr );
-            
-            clQueryParser_ = Cast2Native<cpix_QueryParser>(queryParser);
+            wchar_t *mQryStr = NULL;
             
             if (args.size() > 0)
             {
                 THROW_CPIXEXC(PL_ERROR "No arguments needed here");
             }
+
+            mQryStr = (wchar_t*) malloc(sizeof(wchar_t)* (2 * wcslen(qryStr)));
             
+            if(mQryStr == NULL)
+                {
+                    THROW_CPIXEXC("Memory allocation failed. Query parsing failed.");
+                }
+            
+            wmemset(mQryStr,0,(2 * wcslen(qryStr)));
+            getAnalyzedString(qryStr, mQryStr );
+            
+            clQueryParser_ = Cast2Native<cpix_QueryParser>(queryParser);
             clQuery_ = clQueryParser_->parse((const wchar_t *)mQryStr);
             
+            free(mQryStr);
+            
             if (clQuery_ == NULL)
                 {
                     THROW_CPIXEXC("Query reduced to empty query.");
@@ -99,42 +108,43 @@
 
         void getAnalyzedString(const wchar_t* input, wchar_t* output)
             {
-
-            CL_NS_USE(index)
-            CL_NS_USE(util)
-            CL_NS_USE(store)
-            CL_NS_USE(search)
-            CL_NS_USE(document)
-            CL_NS_USE(queryParser)
-            CL_NS_USE(analysis)
-            CL_NS_USE2(analysis,standard)
-
-            StandardAnalyzer sAnalyser;
-
-            Reader* reader = _CLNEW StringReader(input);
-            TokenStream* ts = sAnalyser.tokenStream(_T("dummy"), reader );
-            Token t;
-
-            while(ts->next(&t))
-                {
-                wcscat(output,t.termText());
-                wcscat(output,L"* ");
-                }
-            size_t len = wcslen(output);
-
-            if(len == 0)
+                CL_NS_USE(index)
+                CL_NS_USE(util)
+                CL_NS_USE(store)
+                CL_NS_USE(search)
+                CL_NS_USE(document)
+                CL_NS_USE(queryParser)
+                CL_NS_USE(analysis)
+                CL_NS_USE2(analysis,standard)
+                
+                /*
+                 * StandardAnalyzer sAnalyser;
+                 * Used before but this but this includes stopwords filters
+                 */
+                CustomAnalyzer sAnalyser((const wchar_t*)L"stdtokens>stdfilter>lowercase");
+                
+                Reader* reader = _CLNEW StringReader(input);
+                TokenStream* ts = sAnalyser.tokenStream(_T("dummy"), reader );
+                Token t;
+    
+                while(ts->next(&t))
+                    {
+                    wcscat(output,t.termText());
+                    wcscat(output,L"* ");
+                    }
+                size_t len = wcslen(output);
+    
+                if(len == 0)
                 wcscpy(output,L"*");
-            else
-                {
-                if(output[len-1] == L' ')
+                else
+                    {
+                    if(output[len-1] == L' ')
                     output[len-1] = L'\0';
-                }
-
-            ts->close();
-            _CLDELETE(ts);
-            _CLDELETE(reader);
-
-
+                    }
+    
+                ts->close();
+                _CLDELETE(ts);
+                _CLDELETE(reader);
             }
 
 
--- a/searchengine/cpix/tsrc/cpixsample/src/cpixsample.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixsample/src/cpixsample.cpp	Thu May 27 13:59:44 2010 +0300
@@ -43,12 +43,12 @@
 #define FIELD_ALPHA L"Alpha"
 
 
-#define DOC1CONTENT L"mary had a little lamb its fleece was black as coal"
+#define DOC1CONTENT L"mary had little lamb issue its anirban fleece was black as coal"
 #define DOC2CONTENT L"sri rama jeyam shankar.rajendran@yahoo.co.in www.google.com U.S.A. file.txt"
 
 
 // The term that will be present in multiple documents.
-#define SEARCH_TERM L"$prefix(\"yahoo\")"
+#define SEARCH_TERM L"$prefix(\"a\")"
 
 
 int testInit(cpix_Analyzer **analyzer_, cpix_IdxDb **idxDb_)
@@ -220,16 +220,20 @@
 
         query_ = cpix_QueryParser_parse(queryParser_, SEARCH_TERM);
 
+        if ( query_ == NULL) { // sometimes the query parser returns NULL then we crash
+            return 0;
+        }
         if (cpix_Failed(queryParser_))
             {
             printf("Could not create query parser \n");
+            return 0;
             }
 
         hits_ = cpix_IdxDb_search(idxDb_, query_);
         printHits( hits_); 
 
 
-        int32_t hits_len = cpix_Hits_length(hits_); 
+        int32_t hits_len = cpix_Hits_length(hits_);
         
         cleanUp(&analyzer_, &queryParser_,&query_,&idxDb_,&hits_);
 
--- a/searchengine/cpix/tsrc/cpixunittest/group/cpixunittest.mmp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/group/cpixunittest.mmp	Thu May 27 13:59:44 2010 +0300
@@ -71,7 +71,7 @@
 SOURCE          config.cpp
 SOURCE          clq/uxqry.cpp
 SOURCE          clq/clqry.cpp 
-SOURCE		pdftests.cpp querytest.cpp
+SOURCE		pdftests.cpp querytest.cpp std_log_result.cpp
 
 USERINCLUDE     ../../../../../searchsrv_plat/cpix_utility_api/inc
 USERINCLUDE     ../inc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/searchengine/cpix/tsrc/cpixunittest/inc/std_log_result.h	Thu May 27 13:59:44 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef _STD_LOG_FILE_H__
+#define _STD_LOG_FILE_H__
+
+#include <stdio.h>
+#include <time.h>
+#include <string.h>
+#include <stdarg.h>
+extern int assert_failed;
+extern void testResultXml(char *filename);
+
+#endif
+
--- a/searchengine/cpix/tsrc/cpixunittest/src/aggregatetests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/aggregatetests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -32,6 +32,7 @@
 
 #include "testcorpus.h"
 
+#include "std_log_result.h"
 
 cpix_FieldDesc MultiFieldSchema[] = {
     
@@ -81,6 +82,7 @@
 };
 
 
+
 class MultiFieldIdxUtil : public FileIdxUtil
 {
 public:
@@ -346,11 +348,13 @@
     void testAddFiles(Itk::TestMgr * testMgr)
     {
         testMgr_ = testMgr;
-
+        char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
         Cpt::traverse(FILE_TEST_CORPUS_PATH "\\en",
                       this);
 
         util_->flush();
+        testResultXml(xml_file);
     }
 
 
@@ -358,45 +362,56 @@
     {
         const wchar_t
             * word = L"happy";
-
+            char *xml_file = (char*)__FUNCTION__;
+            assert_failed = 0;
         testSearchFor(testMgr,
                       word);
+        testResultXml(xml_file);
+        
     }
 
     void testSearchForImportant(Itk::TestMgr * testMgr)
     {
         const wchar_t
             * word = L"important";
-
+        char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
         testSearchFor(testMgr,
                       word);
+        testResultXml(xml_file);
     }
 
     void testSearchForHappening(Itk::TestMgr * testMgr)
     {
         const wchar_t
             * word = L"happening";
-
+        char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
         testSearchFor(testMgr,
                       word);
+        testResultXml(xml_file);
     }
 
     void testSearchForLook(Itk::TestMgr * testMgr)
     {
         const wchar_t
             * word = L"look";
-
+        char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
         testSearchFor(testMgr,
                       word);
+        testResultXml(xml_file);
     }
 
     void testSearchForChristmas(Itk::TestMgr * testMgr)
     {
         const wchar_t
             * word = L"christmas";
-
+        char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
         testSearchFor(testMgr,
                       word);
+        testResultXml(xml_file);
     }
 
 
@@ -405,7 +420,7 @@
     // private methods
     //
     void testSearchFor(Itk::TestMgr  * testMgr,
-                       const wchar_t * word)
+                       const wchar_t * word, int expected = 1)
     {
         wchar_t
             report[512];
@@ -430,6 +445,10 @@
                         cpix_Error_report(util_->idxDb()->err_,
                                           report,
                                           sizeof(report)/sizeof(wchar_t));
+                        if(expected)
+                            assert_failed = 1;
+                        else
+                            assert_failed = 0;  
                         ITK_EXPECT(testMgr,
                                    false,
                                    "Failed to search: %S",
@@ -444,7 +463,10 @@
                 cpix_Error_report(query->err_,
                                   report,
                                   sizeof(report)/sizeof(wchar_t));
-
+                if(expected)
+                    assert_failed = 1;
+                else
+                    assert_failed = 0;  
                 ITK_EXPECT(testMgr,
                            false,
                            "Failed to parse '%S': %S",
--- a/searchengine/cpix/tsrc/cpixunittest/src/analysis.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/analysis.cpp	Thu May 27 13:59:44 2010 +0300
@@ -30,6 +30,7 @@
 
 #include "cpixdoc.h"
 
+#include "std_log_result.h"
 const char * AnalysisTestDocsToIndex[5] = {
     FILE_TEST_CORPUS_PATH "\\en\\1.txt",
     FILE_TEST_CORPUS_PATH "\\en\\2.txt",
@@ -46,7 +47,7 @@
 };
 
 
-void TestAnalyzerParsing(Itk::TestMgr * , const wchar_t* definition) 
+void TestAnalyzerParsing(Itk::TestMgr * , const wchar_t* definition, int expected = 1) 
 {
 	cpix_Result result; 
 	
@@ -55,6 +56,10 @@
 	cpix_Analyzer* analyzer = cpix_Analyzer_create( &result, definition);
 
 	if ( cpix_Failed( &result) ) {
+        if(expected)
+            assert_failed = 1;
+        else
+            assert_failed = 0;            
 		printf("Analyzer creation failed with %S\n", result.err_->msg_);
 		return; 
 	}
@@ -63,6 +68,8 @@
 
 void TestAnalyzersParsing(Itk::TestMgr * testMgr) 
 {
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
 	TestAnalyzerParsing(testMgr, L"stdtokens>lowercase"); 
 	TestAnalyzerParsing(testMgr, L"whitespace>lowercase"); 
 	TestAnalyzerParsing(testMgr, L"letter>lowercase"); 
@@ -75,16 +82,19 @@
 	TestAnalyzerParsing(testMgr, L"letter>lowercase>stop('a', 'an', 'the')");
 
 	// bad syntaxes
-	TestAnalyzerParsing(testMgr, L"letter><lowercase" ); 
-	TestAnalyzerParsing(testMgr, L"38j_d fad23 4?q ca'wRA" ); 
+	TestAnalyzerParsing(testMgr, L"letter><lowercase" ,0); 
+	TestAnalyzerParsing(testMgr, L"38j_d fad23 4?q ca'wRA", 0 ); 
 	// parsing failures
-	TestAnalyzerParsing(testMgr, L"letter>>lowercase" ); 
-	TestAnalyzerParsing(testMgr, L">letter>>lowercase lowercase" ); 
-	TestAnalyzerParsing(testMgr, L"letter lowercase" ); 
+	TestAnalyzerParsing(testMgr, L"letter>>lowercase", 0 ); 
+	TestAnalyzerParsing(testMgr, L">letter>>lowercase lowercase", 0 ); 
+	TestAnalyzerParsing(testMgr, L"letter lowercase", 0 );
+	testResultXml(xml_file);
 }
 
 void TestSwitchParsing(Itk::TestMgr * testMgr) 
 {
+    char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
 	// Per field query syntax
 	TestAnalyzerParsing(testMgr, L"switch {"
 									 L"case '_docuid':          keyword; "
@@ -95,12 +105,14 @@
 	TestAnalyzerParsing(testMgr, L"switch{ case '_qnr': whitespace; default: standard; }>lowercase");
 	TestAnalyzerParsing(testMgr, L"switch{ default: 	standard; }");
 	TestAnalyzerParsing(testMgr, L"switch{ case '_qnr': switch{ case '_docuid': keyword; default: whitespace; }; default: standard; }");
+	testResultXml(xml_file);
 }
 
 void TestAnalyzerUsage(Itk::TestMgr * testMgr, const wchar_t* definition) 
 {
 	printf("Indexing and searching with %S\n", definition); 
-	
+	char *xml_file = (char*)__FUNCTION__;
+	    assert_failed = 0;
 	cpix_Result
         result;
 
@@ -179,6 +191,7 @@
 
 		if (cpix_Failed(util->idxDb())) 
 			{
+            assert_failed = 1;
 			cpix_Analyzer_destroy(analyzer);
 			cpix_ClearError(queryParser);
 			cpix_QueryParser_destroy(queryParser);
@@ -192,15 +205,19 @@
 	}
 	cpix_QueryParser_destroy(queryParser);
 	cpix_Analyzer_destroy( analyzer ); 
+	testResultXml(xml_file);
 }
 
 void TestAnalyzersUsage(Itk::TestMgr * testMgr) 
 	{
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
 	TestAnalyzerUsage(testMgr, L"whitespace" ); 
 	TestAnalyzerUsage(testMgr, L"letter>lowercase" ); 
 	TestAnalyzerUsage(testMgr, L"stdtokens>lowercase>stem(en)"); 
 	TestAnalyzerUsage(testMgr, L"letter>lowercase>stop(en)"); 
-	TestAnalyzerUsage(testMgr, L"letter>lowercase>stop('a', 'an', 'the')"); 
+	TestAnalyzerUsage(testMgr, L"letter>lowercase>stop('a', 'an', 'the')");
+	testResultXml(xml_file);
 	}
 
 
--- a/searchengine/cpix/tsrc/cpixunittest/src/analysiswhitebox.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/analysiswhitebox.cpp	Thu May 27 13:59:44 2010 +0300
@@ -27,6 +27,8 @@
 #include "config.h"
 #include "testutils.h"
 
+#include "std_log_result.h"
+
 // For testing custom analyzer
 #include "CLucene.h"
 #include "CLucene\analysis\AnalysisHeader.h"
@@ -66,7 +68,9 @@
 
 void TestTokenization6(Itk::TestMgr * )
 {
-	Cpix::AnalyzerExp::Tokenizer tokenizer; 
+    char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
+    Cpix::AnalyzerExp::Tokenizer tokenizer; 
 	Tokens source(tokenizer, 
 		L"switch { "
 		  L"case '_docuid', '_mimetype': keywords;"
@@ -76,13 +80,15 @@
     WhiteSpaceFilter 
         tokens(source); 
 
-    while (tokens) PrintToken(tokens++); 
+    while (tokens) PrintToken(tokens++);
+    testResultXml(xml_file);
 }
 
 void TestParsing(Itk::TestMgr* )
 { 
 	Cpix::AnalyzerExp::Tokenizer tokenizer; 
-	
+    char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
 	Tokens source(tokenizer, L"foobar(zap, foo, 'bar', 'a', raboof)");
 	WhiteSpaceFilter tokens(source);
 	Lexer lexer(tokens);
@@ -112,16 +118,20 @@
 		printf("Invoke identifier: %S\n", (invoke->id()).c_str()); 
 		printf("%d parameters\n", invoke->params().size()); 
 	} catch (ParseException& e) {
+        assert_failed = 1;
 		printf("ParseException: %S\n", e.wWhat()); 
 	} catch (LexException& e) {
+        assert_failed = 1;	
 		printf("LexException: %S\n", e.wWhat()); 
 	}
+	testResultXml(xml_file);
 }
 
 void TestSwitch(Itk::TestMgr* )
 { 
 	Cpix::AnalyzerExp::Tokenizer tokenizer; 
-	
+    char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
 	const wchar_t* text; 
 	Tokens source(tokenizer, text = 
 		L"switch { "
@@ -150,17 +160,22 @@
 		}
 	} catch (ParseException& e) {
 		// OBS wcout<<L"ParseException: "<<e.describe(text)<<endl; 
+        assert_failed = 1;
 		e.setContext(text);
 		printf("ParseException: %S\n", e.wWhat()); 
 	} catch (LexException& e) {
 		// OBS wcout<<L"LexException: "<<e.describe(text)<<endl; 
+        assert_failed = 1;
 		e.setContext(text);
 		printf("LexException: %S\n", e.wWhat()); 
 	}
+	testResultXml(xml_file);
 }
 
 void TestParsingErrors(Itk::TestMgr* )
 {
+    char *xml_file = (char*)__FUNCTION__;
+            assert_failed = 0;
 	Cpix::AnalyzerExp::Tokenizer tokenizer; 
 	// eof
 	const wchar_t* text; 
@@ -211,7 +226,7 @@
 		e.setContext(text);
 		printf("ParseException: %S\n", e.wWhat()); 
 	} 
-
+	testResultXml(xml_file);
 }
 
 
@@ -265,6 +280,8 @@
 
 void TestCustomAnalyzers(Itk::TestMgr * testMgr)
 {
+    char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
 	TestCustomAnalyzer(testMgr, L"stdtokens");
 	TestCustomAnalyzer(testMgr, L"whitespace");
 	TestCustomAnalyzer(testMgr, L"whitespace>lowercase");
@@ -277,6 +294,7 @@
 	TestCustomAnalyzer(testMgr, L"letter>lowercase>accent>stop(en)"); 
 	TestCustomAnalyzer(testMgr, L"letter>lowercase>stop('i', 'oh', 'nyt', 'näin')"); 
 	TestCustomAnalyzer(testMgr, L"letter>length(2, 4)");
+	testResultXml(xml_file);
 }
 
 void TestAnalyzerWithField(Itk::TestMgr * , const wchar_t* definition, const wchar_t* field)
@@ -298,7 +316,9 @@
 
 void TestSwitchAnalyzers(Itk::TestMgr * testMgr)
 {
-	const wchar_t* sw = L"\n"
+    char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
+    const wchar_t* sw = L"\n"
 		L"switch {\n"
 		L"    case '_docuid':          keyword;\n"
 		L"    case '_appclass':        whitespace>lowercase;\n"
@@ -310,6 +330,7 @@
 	TestAnalyzerWithField(testMgr, sw, L"Title"); 
 	TestAnalyzerWithField(testMgr, sw, L"message"); 
 	TestAnalyzerWithField(testMgr, sw, L"field"); 
+	testResultXml(xml_file);
 }
 
 
@@ -318,14 +339,14 @@
     using namespace Itk;
 
     SuiteTester
-        * analysisTests = new SuiteTester("whitebox");
+        * analysisTests = new SuiteTester("analysiswhitebox");
     
     analysisTests->add("analyzer",
 					   &TestCustomAnalyzers,
 					   "analyzer");
-    analysisTests->add("switchAnalyzer",
+    analysisTests->add("switchanalyzer",
 					   &TestSwitchAnalyzers,
-					   "switchAnalyzer");
+					   "switchanalyzer");
     analysisTests->add("tokenization",
     				   TestTokenization6,
     				   "tokenization");
--- a/searchengine/cpix/tsrc/cpixunittest/src/asynctests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/asynctests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -37,6 +37,7 @@
 #include "testcorpus.h"
 #include "setupsentry.h"
 
+#include "std_log_result.h"
 
 // TODO PROPER, EXAMPLARY error clearing (cpix_ClearError())
 
@@ -1217,6 +1218,8 @@
     
     void testSingleThreadIdx(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
         testMgr_ = testMgr;
 
         // cpix_setLogLevel(CPIX_LL_DEBUG);
@@ -1246,7 +1249,11 @@
         ITK_EXPECT(testMgr,
                    result == 0,
                    "Could not join indexer thread");
-
+        if(result != 0) 
+            {
+            assert_failed = 1;
+            }
+        testResultXml(xml_file);
         // cpix_setLogLevel(CPIX_LL_TRACE);
 
         printStatistics();
@@ -1256,6 +1263,8 @@
 
     void testSingleThreadQry(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
         testMgr_ = testMgr;
 
         // cpix_setLogLevel(CPIX_LL_DEBUG);
@@ -1285,7 +1294,11 @@
         ITK_EXPECT(testMgr,
                    result == 0,
                    "Could not join searcher thread");
-
+        if(result != 0) 
+            {
+            assert_failed = 1;
+            }
+        testResultXml(xml_file);
         // cpix_setLogLevel(CPIX_LL_TRACE);
 
         printStatistics();
@@ -1295,6 +1308,8 @@
 
     void testMultiThreads(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
         cleanup();
         setup();
 
@@ -1350,14 +1365,22 @@
         ITK_EXPECT(testMgr,
                    result == 0,
                    "Could not join indexer thread");
-
+        if(result != 0) 
+            {
+            assert_failed = 1;
+            }
+        
         result = pthread_join(searcherThreadHndl,
                               &rv);
 
         ITK_EXPECT(testMgr,
                    result == 0,
                    "Could not join searcher thread");
-
+        if(result != 0) 
+            {
+            assert_failed = 1;
+            }
+        testResultXml(xml_file);
         // cpix_setLogLevel(CPIX_LL_TRACE);
 
         printStatistics();
@@ -1536,6 +1559,7 @@
             }
         catch (...)
             {
+                assert_failed = 1;
                 ITK_EXPECT(testMgr_,
                            false,
                            "INDEXER: Failed indexing\n");
@@ -1610,6 +1634,7 @@
             }
         catch (...)
             {
+                assert_failed = 1;
                 ITK_EXPECT(testMgr_,
                            false,
                            "SEARCHER: Failed searching\n");
--- a/searchengine/cpix/tsrc/cpixunittest/src/deletiontests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/deletiontests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -33,7 +33,7 @@
 #include "testcorpus.h"
 #include "setupsentry.h"
 
-
+#include "std_log_result.h"
 class DeletionContext : public Itk::ITestContext
 {
 private:
@@ -119,96 +119,132 @@
     //
     void testAdd_00(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testAddSms(testMgr,
                    1,
                    L"This is a happy message");
         util_->flush();
         testSearch(testMgr);
+        testResultXml(xml_file);
     }
 
     void testAdd_01(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testAddSms(testMgr,
                    2,
                    L"This is another happy message");
         util_->flush();
         testSearch(testMgr);
+        testResultXml(xml_file);
     }
 
     void testFlush_02(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testFlush(testMgr);
+        testResultXml(xml_file);
     }
 
     void testAdd_03(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testAddSms(testMgr,
                    3,
                    L"This is a 3rd happy message");
         util_->flush();
         testSearch(testMgr);
+        testResultXml(xml_file);
     }
 
     void testDelete_04(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testDeleteSms(3,
                       testMgr);
         util_->flush();
         testSearch(testMgr);
+        testResultXml(xml_file);
     }
 
     void testDelete_05(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testDeleteSms(1,
                       testMgr);
         util_->flush();
         testSearch(testMgr);
+        testResultXml(xml_file);
     }
 
     void testReOpenIdx_06(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testReOpenIdxDb(testMgr);
         testSearch(testMgr);
+        testResultXml(xml_file);
     }
     
     void testAdd_07(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testAddSms(testMgr,
                    4,
                    L"This is the 4th happy message");
         util_->flush();
         testSearch(testMgr);
+        testResultXml(xml_file);
     }
 
     void testAdd_08(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testAddSms(testMgr,
                    5,
                    L"This is the 5th happy message");
         util_->flush();
         testSearch(testMgr);
+        testResultXml(xml_file);
     }
 
     void testDelete_09(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testDeleteSms(2,
                       testMgr);
         util_->flush();
         testSearch(testMgr);
+        testResultXml(xml_file);
     }
 
     void testDelete_10(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testDeleteSms(4,
                       testMgr);
         util_->flush();
         testSearch(testMgr);
+        testResultXml(xml_file);
     }
 
     void testReOpenIdx_11(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testReOpenIdxDb(testMgr);
         testSearch(testMgr);
+        testResultXml(xml_file);
     }
     
 
@@ -264,6 +300,11 @@
         ITK_EXPECT(testMgr,
                    cpix_Succeeded(util_->idxDb()),
                    "Could not flush idx");
+        if(!cpix_Succeeded(util_->idxDb()))
+        {
+        assert_failed = 1;
+        }
+                
     }
 
 
@@ -289,6 +330,7 @@
                            false,
                            "Failed to search");
                 cpix_ClearError(util_->idxDb());
+                assert_failed = 1;
             }
         else
             {
--- a/searchengine/cpix/tsrc/cpixunittest/src/destructivetests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/destructivetests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -25,6 +25,8 @@
 
 #include "cpixsearch.h"
 
+#include "std_log_result.h"
+
 // Disable test cases, which prevent running other cases
 #define DISABLE_CRASHING_TEST_CASES
 
@@ -131,22 +133,30 @@
     }
 		
     void testWritingWhenHitIterating(Itk::TestMgr* testMgr) {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testWritingWhenHitIterating(testMgr,
                                     idxUtil_->idxDb(),
                                     &cpix_IdxDb_search,
                                     3);
+        testResultXml(xml_file);
     }
 
 
     void testWritingWhenHitIterating2(Itk::TestMgr* testMgr) {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testWritingWhenHitIterating(testMgr,
                                     searcher(testMgr),
                                     &cpix_IdxSearcher_search,
                                     3);
+        testResultXml(xml_file);
     }
 
     void testInvalidation(Itk::TestMgr* testMgr) 
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         for (int i = 0; i < 25; i++) 
             {
                 idxUtil_->indexSms( i, 
@@ -167,6 +177,7 @@
         if ( cpix_Failed( idxUtil_->idxDb() ) ) {
             cpix_Query_destroy( query );
             ITK_PANIC( "Search failed" );
+            assert_failed = 1;
         }
         printf("Accessing hits before closing... ");
 
@@ -192,7 +203,10 @@
         ITK_EXPECT(testMgr,
                    cpix_Succeeded(idxUtil_->idxDb()),
                    "Flushing failed");
-        
+        if(cpix_Succeeded(idxUtil_->idxDb()))
+        {
+        assert_failed = 1;
+        }
 
         cpix_IdxSearcher_releaseDb(searcher_);
         searcher_ = NULL;
@@ -221,6 +235,7 @@
                                   sizeof(buf) / sizeof(wchar_t));
                 printf("%S\n", buf);
                 cpix_ClearError(hits);
+                
             }
 
         printf("\ndoc #20: ");
@@ -240,8 +255,9 @@
                                   sizeof(buf) / sizeof(wchar_t));
                 printf("%S\n", buf);
                 cpix_ClearError(hits);
+                assert_failed = 1;
             }
-        
+        testResultXml(xml_file);
         cpix_Hits_destroy( hits );
         cpix_Query_destroy( query );
     }
@@ -254,6 +270,8 @@
      */
     void testStackunwinding(Itk::TestMgr* testMgr) 
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         SchemaId wrongSchema = idxUtil_->schemaId();
         cpix_Result
             result;
@@ -270,6 +288,7 @@
         if (cpix_Failed(&result))
             {
                 ITK_PANIC("Index could not be opened");
+                assert_failed = 1;
             }
 
         // Try to index things
@@ -299,9 +318,10 @@
                 bool
                     succeeded = cpix_Succeeded(idxDb);
 
-                ITK_ASSERT( testMgr, !succeeded, "Schema is persistent?" ); 
+                ITK_ASSERT( testMgr, !succeeded, "Schema is persistent?" );
+
             }
-			
+        testResultXml(xml_file);	
         cpix_IdxDb_releaseDb(idxDb);
         idxDb = NULL; 
 			
@@ -319,7 +339,7 @@
                                      int32_t       matches) 
     {
         wprintf(L"Testing writing to index, while hit object is continuosly read.\n");
-	
+
         // Index 
         for (int i = 0; i < 25; i++) {
             idxUtil_->indexSms( i, 
@@ -363,13 +383,19 @@
 	
                     cpix_Hits_length( hits );
                     ITK_EXPECT( testMgr, cpix_Succeeded( hits  ), "Accessing hit of index 1 failed" ); 
-					
+					if(!cpix_Succeeded( hits  ))
+					    {
+                        assert_failed = 1;
+					    }
                     printf("Hits after adding 1 item.\n");
                     idxUtil_->printHits( hits, testMgr ); 
 								
                     cpix_IdxDb_deleteDocuments(idxUtil_->idxDb(), GetItemId( 15 ).c_str() );
                     ITK_EXPECT( testMgr, cpix_Succeeded( idxUtil_->idxDb() ), "Deleting document 15 failed" ); 
-					
+					if(!cpix_Succeeded( idxUtil_->idxDb() ))
+	                       {
+	                        assert_failed = 1;
+	                        }
                     printf("Line 16 deleted.\n");
 	
                     printf("Hits after deletion: \n");
@@ -378,20 +404,30 @@
                     cpix_IdxDb_flush(idxUtil_->idxDb() );
                     ITK_EXPECT( testMgr, cpix_Succeeded( idxUtil_->idxDb() ), "Flushing failed" );
                     printf("Flushed.\n");
+                    if(!cpix_Succeeded( idxUtil_->idxDb() ))
+                           {
+                            assert_failed = 1;
+                            }
 					
                     printf("Hits after flush:\n");
                     idxUtil_->printHits( hits, testMgr, true ); 
 					 
                     cpix_IdxDb_deleteDocuments(idxUtil_->idxDb(), GetItemId( 14 ).c_str() );
                     ITK_EXPECT( testMgr, cpix_Succeeded( idxUtil_->idxDb() ), "Deleting document 14 failed" ); 
-	
+                    if(!cpix_Succeeded( idxUtil_->idxDb() ))
+                           {
+                            assert_failed = 1;
+                            }
                     printf("Line 15 deleted.\n");
                     printf("Hits after deletion:\n");
                     idxUtil_->printHits( hits, testMgr ); 
 	
                     cpix_IdxDb_deleteDocuments(idxUtil_->idxDb(), GetItemId( 9 ).c_str() );
                     ITK_EXPECT( testMgr, cpix_Succeeded( idxUtil_->idxDb() ), "Deleting document 9 failed" ); 
-	
+                    if(!cpix_Succeeded( idxUtil_->idxDb() ))
+                           {
+                            assert_failed = 1;
+                            }
                     printf("Line 10 deleted.\n");
                     printf("Hits after deletion:\n");
                     idxUtil_->printHits( hits, testMgr ); 
@@ -399,7 +435,10 @@
                     cpix_IdxDb_flush(idxUtil_->idxDb() );
                     ITK_EXPECT( testMgr, cpix_Succeeded( idxUtil_->idxDb() ), "Flushing failed" );
                     printf("Flushed.\n");
-					
+                    if(!cpix_Succeeded( idxUtil_->idxDb() ))
+                            {
+                             assert_failed = 1;
+                             }
                     printf("Hits after flush:\n");
                     idxUtil_->printHits( hits, testMgr, true ); 
 					 
@@ -411,11 +450,14 @@
             else 
                 {
                     ITK_PANIC("Hits was null"); 
+                    assert_failed = 1;
                 }
             cpix_Query_destroy( query );
         } else  {
             ITK_PANIC("Could not create query"); 
+            assert_failed = 1;
         }
+        
     }
 
 
@@ -662,7 +704,8 @@
 
     suiteTester->add( "stackUnwinding", 
                     context,
-                    &DestructiveTests::testStackunwinding );
+                    &DestructiveTests::testStackunwinding,
+                    "stackUnwinding");
 
 #define TEST "writingWhenHitIterating"
     suiteTester->add(TEST, 
--- a/searchengine/cpix/tsrc/cpixunittest/src/documenttest.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/documenttest.cpp	Thu May 27 13:59:44 2010 +0300
@@ -35,6 +35,8 @@
 #include "testutils.h"
 #include "setupsentry.h"
 
+#include "std_log_result.h"
+
 #define TEST_DOCUMENT_QBASEAPPCLASS "@0:root test document"
 #define TEST_DOCUMENT_INDEXDB_PATH "c:\\Data\\indexing\\indexdb\\root\\test\\document"
 
@@ -294,7 +296,8 @@
     void testNoBoostingFields(Itk::TestMgr * testMgr)
     {
         // Don't boost Field Alpha in doc1
-
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         addDocument(testMgr,
                     LDOCUID1,
                     DOC1CONTENT);
@@ -306,6 +309,10 @@
         ITK_EXPECT(testMgr,
                    cpix_Succeeded(idxDb_),
                    "Flushing index has failed");
+        if(!cpix_Succeeded(idxDb_))
+            {
+            assert_failed = 1;
+            }
 
         executeSearch(testMgr);
         //  EXPECTED result is that doc2 first, doc1 second.
@@ -323,9 +330,14 @@
             ITK_ASSERT(testMgr,
                 str.compare(LDOCUID2) == 0,
                 "wrong document");
+            if(str.compare(LDOCUID2) != 0)
+                {
+                assert_failed = 1;
+                }
         }
         else
         {
+            assert_failed = 1;
             ITK_PANIC("failed to get _docuid");
         }
 
@@ -342,17 +354,25 @@
             ITK_ASSERT(testMgr,
                 str.compare(LDOCUID1) == 0,
                 "wrong document");
+            if(str.compare(LDOCUID1) != 0)
+                {
+                assert_failed = 1;
+                }
         }
         else
         {
+        assert_failed = 1;
             ITK_PANIC("failed to get _docuid");
         }
+        testResultXml(xml_file);
     }
 
 
 
     void testBoostField(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         tearDown();
         setup();
 
@@ -369,6 +389,10 @@
         ITK_EXPECT(testMgr,
                    cpix_Succeeded(idxDb_),
                    "Flushing index has failed");
+        if(!cpix_Succeeded(idxDb_))
+            {
+            assert_failed = 1;
+            }
 
         executeSearch(testMgr);
         //  EXPECTED result is that doc1 first, doc2 second.
@@ -386,10 +410,15 @@
             ITK_ASSERT(testMgr,
                 str.compare(LDOCUID1) == 0,
                 "wrong document");
+            if(str.compare(LDOCUID1) != 0)
+                {
+                assert_failed = 1;
+                }
         }
         else
         {
             ITK_PANIC("failed to get _docuid");
+            assert_failed = 1;
         }
 
         cpix_Document
@@ -405,15 +434,23 @@
             ITK_ASSERT(testMgr,
                 str.compare(LDOCUID2) == 0,
                 "wrong document");
+            if(str.compare(LDOCUID2) != 0)
+                {
+                assert_failed = 1;
+                }
         }
         else
         {
             ITK_PANIC("failed to get _docuid");
+            assert_failed = 1;
         }
+        testResultXml(xml_file);
     }
 
     void testBoostDocument(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         tearDown();
         setup();
     
@@ -430,7 +467,10 @@
         ITK_EXPECT(testMgr,
                    cpix_Succeeded(idxDb_),
                    "Flushing index has failed");
-
+        if(!cpix_Succeeded(idxDb_))
+            {
+            assert_failed = 1;
+            }
         executeSearch(testMgr);
         //  EXPECTED result is that doc1 first, doc2 second.
 
@@ -447,10 +487,15 @@
             ITK_ASSERT(testMgr,
                 str.compare(LDOCUID1) == 0,
                 "wrong document");
+            if(str.compare(LDOCUID1) != 0)
+                {
+                assert_failed = 1;
+                }
         }
         else
         {
             ITK_PANIC("failed to get _docuid");
+            assert_failed = 1;
         }
 
         cpix_Document
@@ -466,16 +511,24 @@
             ITK_ASSERT(testMgr,
                 str.compare(LDOCUID2) == 0,
                 "wrong document");
+            if(str.compare(LDOCUID2) != 0)
+                {
+                assert_failed = 1;
+                }
         }
         else
         {
             ITK_PANIC("failed to get _docuid");
+            assert_failed = 1;
         }
+        testResultXml(xml_file);
     }
 
 
     void testBoostQuery(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         tearDown();
         setup();
 
@@ -490,7 +543,10 @@
         ITK_EXPECT(testMgr,
                    cpix_Succeeded(idxDb_),
                    "Flushing index has failed");
-
+        if(!cpix_Succeeded(idxDb_))
+            {
+            assert_failed = 1;
+            }
         // doc1_ should be the first result given the following query boost.
         cpix_Query_destroy(query_);
 
@@ -505,6 +561,10 @@
         ITK_ASSERT(testMgr,
                   hits_len == 2,
                   "wrong amount of documents returned in hits");
+        if(hits_len != 2)
+            {
+            assert_failed = 1;
+            }
 
         //  EXPECTED result is that doc2 first.
         cpix_Document
@@ -520,10 +580,15 @@
             ITK_ASSERT(testMgr,
                 str.compare(LDOCUID1) == 0,
                 "wrong document");
+            if(str.compare(LDOCUID2) != 0)
+                {
+                assert_failed = 1;
+                }
         }
         else
         {
             ITK_PANIC("failed to get _docuid");
+            assert_failed = 1;
         }
 
         cpix_Document
@@ -539,11 +604,17 @@
             ITK_ASSERT(testMgr,
                 str.compare(LDOCUID2) == 0,
                 "wrong document");
+            if(str.compare(LDOCUID2) != 0)
+                {
+                assert_failed = 1;
+                }
         }
         else
         {
             ITK_PANIC("failed to get _docuid");
+            assert_failed = 1;
         }
+        testResultXml(xml_file);
     }
 };
 
--- a/searchengine/cpix/tsrc/cpixunittest/src/domainselectiontests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/domainselectiontests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -38,6 +38,7 @@
 #include "testcorpus.h"
 #include "setupsentry.h"
 
+#include "std_log_result.h"
 
 struct MatchTest
 {
@@ -227,6 +228,8 @@
 
     void testCreateIdxs(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         const MVFTest
             * mvfTest = filesAndVols_;
 
@@ -279,6 +282,7 @@
         searchAll(testMgr);
         suggestAll(testMgr);
         dumpAll(testMgr);
+        testResultXml(xml_file);
     }
 
     
@@ -588,7 +592,7 @@
     // some blackbox tests doing idx manipulation & searches
     
     DomainSelectionContext
-        * domainSelectionContext = new DomainSelectionContext();
+        * domainSelectionContext = new DomainSelectionContext;
     ContextTester
         * contextTester = new ContextTester("selection",
                                             domainSelectionContext);
--- a/searchengine/cpix/tsrc/cpixunittest/src/en_stemtests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/en_stemtests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -32,6 +32,8 @@
 #include "testcorpus.h"
 #include "setupsentry.h"
 
+#include "std_log_result.h"
+
 class StemContext : public Itk::ITestContext, public Cpt::IFileVisitor
 {
 
@@ -190,6 +192,7 @@
                     {
                         printf("Failed to delete\n");
                         cpix_ClearError(util_->idxDb());
+                        assert_failed = 1;
                         break;
                     }
                 else
@@ -208,6 +211,10 @@
                    "Only %d docs instead of %d have been deleted",
                    result,
                    expectedDelCount);
+        if(result != expectedDelCount)
+            {
+                assert_failed = 1;
+            }
 
         for (size_t i = 0; i < count; ++i)
             {
@@ -270,10 +277,13 @@
 
     void testAddFiles(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testMgr_ = testMgr;
         Cpt::traverse(FILE_TEST_CORPUS_PATH "\\en",
                       this);
         util_->flush();
+        testResultXml(xml_file);
     }
 
 
@@ -281,7 +291,8 @@
     void testSearchFiles(Itk::TestMgr * testMgr)
     {
         using namespace Itk;
-
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         cpix_Hits
             * hits = cpix_IdxDb_search(util_->idxDb(),
                                        query_);
@@ -292,6 +303,7 @@
                            false,
                            "Failed to search index");
                 cpix_ClearError(util_->idxDb());
+                assert_failed = 1;
             }
         else
             {
@@ -300,17 +312,21 @@
 
                 cpix_Hits_destroy(hits);
             }
+        testResultXml(xml_file);
 
     }
 
 
     void testDeleteFiles(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         deleteFiles(testMgr,
                     EnglishDocsToDelete,
                     sizeof(EnglishDocsToDelete)/sizeof(wchar_t*),
                     2);
         util_->flush();
+        testResultXml(xml_file);
     }
 
 
--- a/searchengine/cpix/tsrc/cpixunittest/src/flushtests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/flushtests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -31,7 +31,7 @@
 #include "setupsentry.h"
 #include "testcorpus.h"
 
-
+#include "std_log_result.h"
 
 class FlushContext : public Itk::ITestContext, public Cpt::IFileVisitor
 {
@@ -126,34 +126,47 @@
 
     void testEmptyIndex(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         checkIndexFiles(testMgr);
+        testResultXml(xml_file);
+        
     }
 
     
     void testAddingBy512B(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         setMaxInsertBufferSize(testMgr,
                          512); // 512 B buffer
         addItems(testMgr,
                  10);
+        testResultXml(xml_file);
     }
 
 
     void testAddingBy10KB(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         setMaxInsertBufferSize(testMgr,
                                10*1024); // 10 KB buffer
         addItems(testMgr,
                  40);
+        testResultXml(xml_file);
     }
 
 
     void testFlushing(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         addItems(testMgr,
                  15);
         flush(testMgr);
         checkIndexFiles(testMgr);
+        testResultXml(xml_file);
     }
 
 
@@ -199,6 +212,10 @@
                    cpix_Succeeded(util_->idxDb()),
                    "Could not set the maxInsertBufferSize to %d",
                    trunkated); 
+        if(!cpix_Succeeded(util_->idxDb()))
+            {
+                assert_failed = 1;
+            }
         printf("Set max insert buffer size to %d\n",
         	   trunkated);
     }
@@ -210,6 +227,10 @@
         ITK_ASSERT(testMgr,
                    cpix_Succeeded(util_->idxDb()),
                    "Could not flush index database");
+        if(!cpix_Succeeded(util_->idxDb()))
+            {
+                assert_failed = 1;
+            }
         printf("Flushed index database\n");
     }
     
--- a/searchengine/cpix/tsrc/cpixunittest/src/geotests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/geotests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -33,6 +33,7 @@
 #include "testutils.h"
 #include "setupsentry.h"
 
+#include "std_log_result.h"
 
 #define VATTUNIEMENRANTA_2_GPS L"60.154023,24.887724"
 
@@ -282,15 +283,20 @@
 
     void testHarvestJpg(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testMgr_ = testMgr;
         Cpt::traverse(JPG_TEST_CORPUS_PATH,
                       this);
         util_->flush();
+        testResultXml(xml_file);
     }
 
 
     void testSearchJpg(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         testMgr_ = testMgr;
 
         cpix_Hits
@@ -301,6 +307,7 @@
                             10);
 
         cpix_Hits_destroy(hits);
+        testResultXml(xml_file);
     }
 
 private:
@@ -430,6 +437,10 @@
                    cpix_Succeeded(queryParser_),
                    "Failed to parse: %S\n",
                    qryStr);
+        if(!cpix_Succeeded(queryParser_))
+            {
+                assert_failed = 1;
+            }
         
         cpix_Hits
             * hits = cpix_IdxDb_search(util_->idxDb(),
@@ -437,6 +448,10 @@
         ITK_ASSERT(testMgr_,
                    cpix_Succeeded(util_->idxDb()),
                    "Failed to search (geo)");
+        if(!cpix_Succeeded(util_->idxDb()))
+            {
+                assert_failed = 1;
+            }
         
         int32_t
             hitCount = cpix_Hits_length(hits);
--- a/searchengine/cpix/tsrc/cpixunittest/src/heartbeattests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/heartbeattests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -38,6 +38,7 @@
 #include "testutils.h"
 #include "testcorpus.h"
 #include "setupsentry.h"
+#include "std_log_result.h"
 
 //
 // these constants are set so that a cpix_XXX entity should be
@@ -141,7 +142,8 @@
     void testCreateFileIdxDb(Itk::TestMgr * testMgr)
     {
         using namespace std;
-
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         doCommonJobs(testMgr,
                      false);
 
@@ -150,12 +152,15 @@
         fiu->init(true);
 
         fileIdxUtil_ = fiu.release();
+        testResultXml(xml_file);        
     }
 
 
     void testCreateSmsIdxDb(Itk::TestMgr * testMgr)
     {
         using namespace std;
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
 
         doCommonJobs(testMgr);
 
@@ -164,11 +169,14 @@
         siu->init(true);
         
         smsIdxUtil_ = siu.release();
+        testResultXml(xml_file);  
     }
     
 
     void testAddSomeSms(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         using namespace std;
 
         doCommonJobs(testMgr);
@@ -187,6 +195,7 @@
                                    ".");
                     }
             }
+        testResultXml(xml_file);  
     }
 
 
@@ -198,6 +207,8 @@
 
     void testUseMultiSearcher(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         doCommonJobs(testMgr);
 
         if (searcher_ == NULL)
@@ -222,6 +233,10 @@
         ITK_EXPECT(testMgr,
                    cpix_Succeeded(query_),
                    "Could not search with multisearcher");
+        if( !cpix_Succeeded(query_))
+            {
+                assert_failed = 1;
+            }
         if (hits != NULL)
             {
                 PrintHits(hits,
@@ -229,21 +244,27 @@
 
                 cpix_Hits_destroy(hits);
             }
+        testResultXml(xml_file);  
     }
 
     
     void testAddSomeFile(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         doCommonJobs(testMgr);
 
         fileIdxUtil_->indexFile(FILE_TEST_CORPUS_PATH "\\en\\1.txt",
                                 analyzer_,
                                 testMgr);
+        testResultXml(xml_file); 
     }
 
     
     void testReleaseAll(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         doCommonJobs(testMgr);
 
         delete fileIdxUtil_;
@@ -254,6 +275,7 @@
 
         cpix_IdxSearcher_releaseDb(searcher_);
         searcher_ = NULL;
+        testResultXml(xml_file);
     }
     
 
--- a/searchengine/cpix/tsrc/cpixunittest/src/mapstests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/mapstests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -32,6 +32,7 @@
 #include "testutils.h"
 #include "setupsentry.h"
 
+#include "std_log_result.h"
 
 const Volume Volumes[] = {
     { "@fin:root maps city",
@@ -211,6 +212,8 @@
 
     void testLoadMaps(Itk::TestMgr * testMgr)
     {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         cpix_Result
             result;
 
@@ -219,6 +222,10 @@
         ITK_ASSERT(testMgr,
                    cpix_Succeeded(&result),
                    "Could not reset qbac-path registry");
+        if(!cpix_Succeeded(&result))
+            {
+        assert_failed = 1;    
+            }
 
         const Volume
             *p = Volumes;
@@ -233,6 +240,10 @@
                            cpix_Succeeded(&result),
                            "Could not define volume '%s'",
                            p->qbac_);
+                if(!cpix_Succeeded(&result))
+                    {
+                    assert_failed = 1;    
+                    }
             }
 
         idxSearcher_ = cpix_IdxSearcher_openDb(&result,
@@ -241,13 +252,19 @@
         ITK_ASSERT(testMgr,
                    cpix_Succeeded(&result),
                    "Could not create searcher for 'root maps'");
+        if(!cpix_Succeeded(&result))
+            {
+            assert_failed = 1;    
+            }
+        testResultXml(xml_file);
     }
 
 
     void testSearchMaps(Itk::TestMgr * testMgr)
     {
         printf("Testing searching maps index\n");
-
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         const wchar_t
             ** p = MapsSearchTerms;
         for (; *p != NULL; ++p)
@@ -290,10 +307,12 @@
                         ITK_EXPECT(testMgr,
                                    false,
                                    "Failed to do address search");
+                        assert_failed = 1;
                     }
 
                 cpix_Query_destroy(query);
             }
+        testResultXml(xml_file);
     }
 
 
--- a/searchengine/cpix/tsrc/cpixunittest/src/multivolumetests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/multivolumetests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -32,6 +32,7 @@
 #include "testcorpus.h"
 #include "setupsentry.h"
 
+#include "std_log_result.h"
 
 class PlainMVContext : public Itk::ITestContext
 {
--- a/searchengine/cpix/tsrc/cpixunittest/src/negativetests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/negativetests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -32,6 +32,7 @@
 #include "cpixdoc.h"
 #include "cpixsearch.h"
 #include "cpixidxdb.h"
+#include "std_log_result.h"
 
 #define TEST_DOCUMENT_QBASEAPPCLASS "@0:root test document"
 #define TEST_SAMPLE_QBASEAPPCLASS "@:root test sample"
@@ -270,6 +271,8 @@
 
 void testCreateDb(Itk::TestMgr* /*testMgr */)
 {
+    char *xml_file = (char *)__FUNCTION__;
+    assert_failed = 0;
     cpix_IdxDb   *itestDb_ = NULL, *inewDb_ = NULL;                
     cpix_Result  result;
     
@@ -286,6 +289,7 @@
     if (cpix_Failed(&result))
         {
         ITK_PANIC("Failed to open indexDb");
+        assert_failed = 1;
         }
      
      if ( itestDb_ ) 
@@ -300,10 +304,13 @@
             inewDb_ = 0;
          }
      cpix_IdxDb_undefineVolume(TEST_SAMPLE_QBASEAPPCLASS);
+     testResultXml(xml_file);
 }
 
 void testOpenDb(Itk::TestMgr * testMgr)
 {
+        char *xml_file = (char *)__FUNCTION__;
+        assert_failed = 0;
         cpix_Result  result;            
         cpix_IdxDb   *idxDb_ = NULL;
         
@@ -313,18 +320,22 @@
                                        cpix_IDX_CREATE);
         if(idxDb_ == NULL )
             {
-            ITK_MSG(testMgr, "Tried to open a database of undefined volume");             
+            ITK_MSG(testMgr, "Tried to open a database of undefined volume");
+            assert_failed = 1;
             }
         
         if (idxDb_) 
             {
                 cpix_IdxDb_releaseDb(idxDb_);
                 idxDb_ = 0; 
-            }        
+            }       
+        testResultXml(xml_file);
 }
 
 void testCorruptedIndex(Itk::TestMgr * testMgr)
 {
+     char *xml_file = (char *)__FUNCTION__;
+     assert_failed = 0;
      cpix_Analyzer * analyzer_ = NULL ;       
      cpix_IdxDb * iCrptDb1_ = NULL, *iCrptDb2_ = NULL;
      
@@ -370,7 +381,10 @@
      if(iCrptDb2_)
          hit_search2= search(&analyzer_,&iCrptDb2_, SEARCH_TERM);
      else
-         ITK_MSG(testMgr, "Corrupted database, search not possible");              
+         {
+         ITK_MSG(testMgr, "Corrupted database, search not possible");
+         assert_failed = 0;
+         }
      
      cleanUp(&analyzer_,&iCrptDb1_);
      
@@ -382,6 +396,7 @@
      
      cpix_IdxDb_undefineVolume(TEST_CORRUPTTEST1_QBASEAPPCLASS);
      cpix_IdxDb_undefineVolume(TEST_CORRUPTTEST2_QBASEAPPCLASS);
+     testResultXml(xml_file);
  }
 
 };
--- a/searchengine/cpix/tsrc/cpixunittest/src/partialsmstests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/partialsmstests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -33,6 +33,8 @@
 #include "testcorpus.h"
 #include "setupsentry.h"
 
+#include "std_log_result.h"
+
 /****
  * Simple test cases (one client)
  */
--- a/searchengine/cpix/tsrc/cpixunittest/src/pdftests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/pdftests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -36,6 +36,7 @@
 #include "config.h"
 #include "testutils.h"
 #include "suggestion.h"
+#include "std_log_result.h"
 
 const char * PdfDocsToIndex[7] = {
     "c:\\data\\cpixunittestcorpus\\pdf\\ctutor.pdf",
@@ -73,7 +74,11 @@
     
     cpix_Analyzer* analyzer = cpix_CreateSimpleAnalyzer(&result); 
     
-    if ( cpix_Failed( &result) ) ITK_PANIC("Analyzer could not be created");
+    if ( cpix_Failed( &result) ) 
+        {
+            ITK_PANIC("Analyzer could not be created");
+            assert_failed = 1;
+        }
     
     for (int i = 0; PdfDocsToIndex[i]; i++) 
     {
@@ -92,6 +97,7 @@
             {
                 cpix_Analyzer_destroy( analyzer );
                 ITK_PANIC("Could not create query parser");
+                assert_failed = 1;
             }
         
         std::wostringstream queryString;
@@ -105,6 +111,7 @@
                 cpix_ClearError(queryParser);
                 cpix_QueryParser_destroy(queryParser);
                 ITK_PANIC("Could not parse query string");
+                assert_failed = 1;
             }
        
         cpix_Hits
@@ -123,23 +130,28 @@
         cpix_Hits_destroy( hits );
         cpix_Query_destroy( query );
         cpix_QueryParser_destroy(queryParser);
+        
     }
 
 }
 // int32_t hitsLength = cpix_Hits_length(hits);
 void CreateSimplePdfSearch(Itk::TestMgr * testMgr) 
 {
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
     pdfTestAppclassFilteredTermSearch(testMgr, LPDFAPPCLASS);
+    testResultXml(xml_file);
 }
 
+
 Itk::TesterBase * CreatePdfSearchTests()
 {
     using namespace Itk;
 
-    ContextTester
-        * pdfTests = new ContextTester("pdfTests", NULL);
+    SuiteTester
+        * pdfTests = new SuiteTester("pdfTests");
 
-    pdfTests->add("pdfterms", &CreateSimplePdfSearch);
-    
+    pdfTests->add("pdfterms", &CreateSimplePdfSearch, "pdfterms");
+        
     return pdfTests;
 }
--- a/searchengine/cpix/tsrc/cpixunittest/src/prematureqrytests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/prematureqrytests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -19,6 +19,7 @@
 #include "config.h"
 #include "itk.h"
 #include "setupsentry.h"
+#include "std_log_result.h"
 
 #include <iostream>
 
@@ -168,16 +169,21 @@
     //
     void testBeforeVolDefs(Itk::TestMgr * mgr)
     {
+        char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
         printf("Before volume definitions\n");
 
         qry(mgr,
             false);
+        testResultXml(xml_file);
     }
 
 
     void testBeforeContentDefs(Itk::TestMgr * mgr)
     {
         printf("Defining volumes\n");
+        char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
 
         cpix_Result
             result;
@@ -200,13 +206,15 @@
 
         qry(mgr,
             true);
+        testResultXml(xml_file);
     }
 
 
     void testReady(Itk::TestMgr * mgr)
     {
         printf("Defining contents\n");
-
+        char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
         const MVFTest
             * mvfTest = FilesAndVols;
 
@@ -234,6 +242,7 @@
 
         qry(mgr,
             true);
+        testResultXml(xml_file);
     }
 
 
@@ -304,6 +313,7 @@
                    "Querying idx should %s have succeeded and it did %s",
                    shouldSucceed ? "" : "not",
                    succeeded ? "" : "not");
+        assert_failed = 1;
     }
 
 
@@ -353,6 +363,7 @@
                    "Querying searcher should %s have succeeded and it did %s",
                    shouldSucceed ? "" : "not",
                    succeeded ? "" : "not");
+        assert_failed = 1;
     }
 
 
--- a/searchengine/cpix/tsrc/cpixunittest/src/querytest.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/querytest.cpp	Thu May 27 13:59:44 2010 +0300
@@ -31,6 +31,7 @@
 #include "testutils.h"
 #include "suggestion.h"
 
+#include "std_log_result.h"
 
 const char * docsToIndex[5] = {
 CORPUS_PATH "\\query\\query1.txt",
@@ -135,6 +136,7 @@
         }
         if (queryParser == NULL)
             {
+                assert_failed = 1;
                 cpix_Analyzer_destroy( analyzer );
                 ITK_PANIC("Could not create query parser");
             }
@@ -146,6 +148,7 @@
         if (cpix_Failed(queryParser)
             || query == NULL)
             {
+                assert_failed = 1;
                 cpix_Analyzer_destroy(analyzer);
                 cpix_ClearError(queryParser);
                 cpix_QueryParser_destroy(queryParser);
@@ -169,7 +172,7 @@
                     }
                 else
                     {
-                   
+                    assert_failed = 1;
                     ITK_MSG(testMgr, "Query %S, didnt return expected hits. Expected is %d hits. Returned is %d. Failed \n",qryStr,hitLen,hitsLength);
                     }
                     
@@ -182,6 +185,8 @@
 
 void CreatePlainQueryTest(Itk::TestMgr * testMgr) 
 {
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
     setupPlainQuery(testMgr);
     testQuery(testMgr,L"Nokia", 2);
     testQuery(testMgr,L"iNdia", 1);
@@ -215,11 +220,13 @@
     testQuery(testMgr,L"NOT India", 1);
     testQuery(testMgr,L"(india OR Mobile) AND Nokia", 2);
     testQuery(testMgr,L"(india OR Mobile) AND Country", 1);
-  //  create_xml(val,__func__,__FILE__,__LINE__);
+    testResultXml(xml_file);
 }
 
 void CreatePrefixQueryTest(Itk::TestMgr * testMgr) 
 {
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
     setupPrefixQuery(testMgr);
     testQuery(testMgr,L"$prefix(\"new-notes\")", 1);
     testQuery(testMgr,L"$prefix(\"notes\")", 1);
@@ -261,11 +268,13 @@
     testQuery(testMgr,L"$prefix(\"<lessthan\")", 1);
     testQuery(testMgr,L"$prefix(\">greaterthan\")", 1);
     testQuery(testMgr,L"$prefix(\"worked for motorola .\")", 1);
-    
+    testResultXml(xml_file);
 }
 
 void CreatePrefixOptimiseQueryTest(Itk::TestMgr * testMgr)
     {
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
     setupPrefixOptimiseQuery(testMgr);
     testQuery(testMgr,L"i*", 3,LCPIX_DEFAULT_PREFIX );
     testQuery(testMgr,L"in*", 2,LCPIX_DEFAULT_PREFIX );
@@ -288,17 +297,18 @@
     testQuery(testMgr,L"ru*", 2,LCPIX_DEFAULT_PREFIX );
     testQuery(testMgr,L"ra*", 2,LCPIX_DEFAULT_PREFIX );
     testQuery(testMgr,L"ri*", 2,LCPIX_DEFAULT_PREFIX );
+    testResultXml(xml_file);
     }
 Itk::TesterBase * CreateQueryTests()
 {
     using namespace Itk;
 
-    ContextTester
-        * qryTests = new ContextTester("Query Tests", NULL);
+    SuiteTester
+        * qryTests = new SuiteTester("querytests");
 
-    qryTests->add("PlainQueryTest", &CreatePlainQueryTest);
-    qryTests->add("PrefixQueryTest", &CreatePrefixQueryTest);
-    qryTests->add("PrefixOptimiseQueryTest", &CreatePrefixOptimiseQueryTest);
+    qryTests->add("plainquerytest", &CreatePlainQueryTest, "plainquerytest");
+    qryTests->add("prefixquerytest", &CreatePrefixQueryTest, "prefixquerytest");
+    qryTests->add("prefixoptimisequerytest", &CreatePrefixOptimiseQueryTest, "prefixoptimisequerytest");
     
     return qryTests;
 }
--- a/searchengine/cpix/tsrc/cpixunittest/src/randomtest.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/randomtest.cpp	Thu May 27 13:59:44 2010 +0300
@@ -19,6 +19,7 @@
 
 #include <sstream>
 #include <time.h>
+#include "std_log_result.h"
 
 using namespace std;
 using namespace Itk;
@@ -29,19 +30,28 @@
 	RandomTest * idxDbTest = new RandomTest;
 	ContextTester * random = new ContextTester("random", idxDbTest);
 	random->add( "AddingDeleting", idxDbTest,
-			    &RandomTest::testIndexAndDelete );
+			    &RandomTest::testIndexAndDelete,
+			    "AddingDeleting");
 
 	random->add( "AddingDeletingAll", idxDbTest,
-			    &RandomTest::testDeleteAll );
+			    &RandomTest::testDeleteAll,
+			    "AddingDeletingAll");
 
-	random->add( "AssertContent", idxDbTest, &RandomTest::testContent );
+	random->add( "AssertContent", idxDbTest,
+	            &RandomTest::testContent,
+	            "AssertContent");
 
 	random->add( "Persistence", idxDbTest,
-			     &RandomTest::testPersistence );
+			     &RandomTest::testPersistence,
+			     "Persistence");
 
-	random->add("Searches", idxDbTest, &RandomTest::testSearches );
+	random->add("Searches", idxDbTest, 
+	        &RandomTest::testSearches,
+	        "Searches");
 
-	random->add("CreatedIndex", idxDbTest, &RandomTest::testCreatedIndex );
+	random->add("CreatedIndex", idxDbTest,
+	        &RandomTest::testCreatedIndex,
+	        "CreatedIndex");
 
 	return random;
 	}
@@ -415,6 +425,10 @@
 				    valid,
 				    "Removed item found" );
 		}
+	if(!valid)
+	    {
+            assert_failed = 1;
+	    }
 	}
 
 void RandomTest::assertContent(Itk::TestMgr* testMgr, size_t item)
@@ -459,6 +473,7 @@
                                 }
                             if ( !found )
                                 {
+                                    assert_failed = 1;
                                     ITK_MSG( testMgr, "Failed content %d", item );
                                 }
 
@@ -472,6 +487,7 @@
                         }
                     else
                         {
+                           assert_failed = 1;
                             ITK_MSG( testMgr, "Content asserting is unreliable for item not in index" );
                         }
                     cpix_Hits_destroy( hits );
@@ -480,6 +496,7 @@
         }
     else
         {
+            assert_failed = 1;
             ITK_MSG( testMgr, "Creating query failed for %S", queryText.str().c_str() );
         }
 }
@@ -565,6 +582,10 @@
 				tracedTerms_[i].c_str(),
 				matches,
 				tracedTermsFreq_[i] );
+		if(matches != tracedTermsFreq_[i])
+		    {
+                assert_failed = 1;
+		    }
 		}
 	}
 
@@ -592,7 +613,8 @@
                "RandomSeed",
                "%d",
                randomSeed_);
-
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
 	indexRandoms(testMgr, 50);
 	assertIndexedState(testMgr);
 
@@ -609,10 +631,12 @@
                                                         item);
                             // OBS if ( !( valid &= validState( testMgr, item = indexRandom( testMgr ) ) ) )
                             if (!valid)
-				{
-				ITK_MSG( testMgr, "Indexing item %d had failed", item );
-				goto mainloop_exit; // double break
-				}
+                            {
+                            assert_failed = 1;
+                            ITK_MSG( testMgr, "Indexing item %d had failed", item );
+                            goto mainloop_exit;
+                            // double break
+                            }
 			}
 		for (int i = 0; i < 10; i++)
 			{
@@ -625,6 +649,7 @@
                             // OBS if ( !( valid &= validState( testMgr, item = deleteRandom( testMgr ) ) ) )
                             if (!valid)
 				{
+                assert_failed = 1;
 				ITK_MSG( testMgr, "Deleting item %d had failed", item );
 				goto mainloop_exit; // double break
 				}
@@ -633,6 +658,7 @@
 	deleteRandoms(testMgr, 50);
 
 	mainloop_exit:
+	testResultXml(xml_file);
 	ITK_ASSERT( testMgr, valid, "Operations were not succesful" );
 	}
 
@@ -640,6 +666,8 @@
 	{
 	indexRandoms(testMgr, 50);
 	assertIndexedState(testMgr);
+	char *xml_file = (char*)__FUNCTION__;
+	assert_failed = 0;
 	vector<int> deleted;
 	for (int i = 0; i < 50; i++)
 		{
@@ -653,15 +681,19 @@
 	valid = valid && validState( testMgr, deleted[i] );
                     if ( !( valid ) )
 			{
+                    assert_failed = 1;
 			ITK_MSG( testMgr, "Deleting item %d had failed", deleted[i] );
 			break;
 			}
 		}
+	testResultXml(xml_file);
 	ITK_ASSERT( testMgr, valid, "Deletes were not succesful" );
 	}
 
 void RandomTest::testContent(Itk::TestMgr* testMgr)
 	{
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
 	for (int i = 0; i < 10; i++)
 		{
 		int item = indexRandom(testMgr);
@@ -672,13 +704,15 @@
 	// clean  up 
 	deleteRandoms( testMgr, 10 );
         idxUtil_->flush();
+        testResultXml(xml_file);
 	}
 
 void RandomTest::testPersistence(Itk::TestMgr* testMgr)
 	{
 	indexRandoms(testMgr, 20);
 	assertIndexedState(testMgr);
-
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
 	idxUtil_->reload();
 	
 	assertIndexedState(testMgr);
@@ -697,15 +731,19 @@
                     valid = valid && validState( testMgr, deleted[i] );
                     if ( !( valid ) )
 			{
+                    assert_failed = 1;
 			ITK_MSG( testMgr, "Deleting item %d had failed", deleted[i] );
 			break;
 			}
 		}
 	ITK_ASSERT( testMgr, valid, "Deletes were not succesful" );
+	testResultXml(xml_file);
 	}
 
 void RandomTest::testSearches(Itk::TestMgr* testMgr)
 {
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
 	traceTerm(testMgr, L"happy");
 	traceTerm(testMgr, L"people");
 	traceTerm(testMgr, L"come");
@@ -731,10 +769,12 @@
 	assertTracedTerms( testMgr );
 
 	untraceTerms(testMgr);
+	testResultXml(xml_file);
 }
 
 void RandomTest::testCreatedIndex(Itk::TestMgr* testMgr) {
-
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
 	int item = indexRandom( testMgr ); 
         idxUtil_->flush();
 	assertState( testMgr, item ); 
@@ -764,6 +804,11 @@
         ITK_EXPECT(testMgr,
                    deleted == 0,
                    "There should not have been an item to delete");
+        if(!cpix_Succeeded(idxUtil_->idxDb()) || deleted != 0)
+            {
+                assert_failed = 1;
+            }
+        testResultXml(xml_file);
 }
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/searchengine/cpix/tsrc/cpixunittest/src/std_log_result.cpp	Thu May 27 13:59:44 2010 +0300
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+#include "std_log_result.h"
+#ifdef __SYMBIAN32__
+#define LOG_FILE "c:\\logs\\std_test_log.txt"
+#define LOG_DIR "c:\\logs\\"
+#define LOG_FILE_EXT "xml"
+int assert_failed = 0;
+#else
+#define LOG_DIR ""
+#define LOG_FILE_EXT "xml"
+#define LOG_FILE "std_test_log.txt"
+int assert_failed = 0;
+#endif
+FILE *fp;
+
+int gnutest = 1;
+
+# define VERIFY(fn) gnutest &= (fn)
+
+void std_log(const char *filename,const int lineno,const char* aformat,...)
+{
+    va_list va;
+    if(fp==NULL)
+    {
+        fp = fopen(LOG_FILE,"a");
+    }
+    
+    va_start(va,aformat);    
+    {
+        fprintf(fp,"%s - [%d] : ",filename,lineno);
+        vfprintf(fp,aformat,va);
+        fprintf(fp,"\n");
+    }
+    va_end(va);
+}
+
+
+void init_log_file()
+{
+    if(fp == NULL)
+    {
+        fp = fopen(LOG_FILE, "a");
+    }
+}
+
+void close_log_file()
+{
+   fclose(fp);
+}
+
+// This function is used to generate the xml file used bt ATS
+void testResultXml(char *filename)
+{
+    char time_buf[50];
+
+    char result[10];
+
+    char xmlfilename[256];
+
+    time_t t = time(NULL);
+
+    struct tm *tm1 = localtime(&t);
+
+    char *atsinitmsg        =   "<test-report>\n\t<test-batch>";
+
+    char *atsbatchinit1     =   \
+                                "\n\t\t<batch-init>\
+                                \n\t\t\t<description></description>\
+                                \n\t\t\t<date>";
+    char *atsbatchinit2 =   "</date>\
+                             \n\t\t\t<factory>NA</factory>\
+                             \n\t\t\t<component>\
+                             \n\t\t\t\t<name>NA</name>\
+                             \n\t\t\t\t<version>NA</version>\
+                             \n\t\t\t</component>\
+                             \n\t\t</batch-init>";
+
+    char *atsbatchresult=   \
+                            "\n\t\t<batch-result>\
+                            \n\t\t\t<run-time>00:00:00</run-time>\
+                            \n\t\t</batch-result>";
+
+    char *atsclosemsg       =   \
+                                "\n\t</test-batch>\
+                                \n</test-report>\n ";
+
+    char *atstestinit       =       "\n\t\t<test-case time-stamp=\"00:00:00\">";
+
+
+    char *atscaseinit1      =       \
+                                    "\n\t\t\t<case-init>\
+                                    \n\t\t\t\t<version></version>\
+                                    \n\t\t\t\t<id>";
+
+    char *atscaseinit2 =    "</id>\
+                             \n\t\t\t\t<expected-result description=\"\">0</expected-result>\
+                             \n\t\t\t</case-init>";
+
+    char *atscaseresult1=   \
+                            "\n\t\t\t<case-result status=\"";
+
+    char *atscaseresult2=   "\">\
+                             \n\t\t\t\t<actual-result>0</actual-result>\
+                             \n\t\t\t\t<run-time>00:00:00</run-time>\
+                             \n\t\t\t</case-result>";
+
+    char *atstestclose      =       "\n\t\t</test-case>";
+
+    // create the xml file name
+    FILE *fp_result;
+    sprintf(xmlfilename, "%s%s.%s", LOG_DIR, filename, LOG_FILE_EXT);
+    strftime(time_buf,50,"%c",tm1);
+
+    if(assert_failed )
+        strcpy(result,"FAILED");
+    else
+        strcpy(result,"PASSED");
+
+    fp_result = fopen(xmlfilename,"w");
+
+    if(fp_result)
+    {
+        fprintf(fp_result,"%s%s%s%s%s%s%s%s%s%s%s%s%s%s",atsinitmsg,atsbatchinit1,time_buf,atsbatchinit2,atstestinit,
+                atscaseinit1,filename,atscaseinit2,atscaseresult1,result,atscaseresult2,
+                atstestclose,atsbatchresult,atsclosemsg);
+
+        fclose(fp_result);
+    }
+}
--- a/searchengine/cpix/tsrc/cpixunittest/src/terms.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/terms.cpp	Thu May 27 13:59:44 2010 +0300
@@ -37,6 +37,8 @@
 #include "testutils.h"
 #include "suggestion.h"
 
+#include "std_log_result.h"
+
 const char * TermTestDocsToIndex[5] = {
 	FILE_TEST_CORPUS_PATH "\\en\\1.txt",
 	FILE_TEST_CORPUS_PATH "\\en\\2.txt",
@@ -70,7 +72,10 @@
 	ITK_ASSERT(testMgr,
 			   cpix_Succeeded(&result),
 			   "Could not get rid of all test qbac-idx pairs");
-
+	if(!cpix_Succeeded(&result))
+	    {
+	assert_failed = 1;
+	    }
 	std::auto_ptr<FileIdxUtil> util( new FileIdxUtil ); 
 	
 	util->init(); 
@@ -78,6 +83,10 @@
 	cpix_Analyzer* analyzer = cpix_CreateSimpleAnalyzer(&result); 
 	
 	if ( cpix_Failed( &result) ) ITK_PANIC("Analyzer could not be created");
+	   if(!cpix_Succeeded(&result))
+	        {
+	    assert_failed = 1;
+	        }
 	
 	for (int i = 0; TermTestDocsToIndex[i]; i++) 
 	{
@@ -100,7 +109,8 @@
 		if (queryParser == NULL)
 			{
 				cpix_Analyzer_destroy( analyzer );
-				ITK_PANIC("Could not create query parser");
+			    assert_failed = 1;
+			    ITK_PANIC("Could not create query parser");
 			}
 		
 		std::wostringstream queryString;
@@ -115,6 +125,7 @@
 		if (cpix_Failed(queryParser)
 			|| query == NULL)
 			{
+                assert_failed = 1;
 				cpix_Analyzer_destroy(analyzer);
 				cpix_ClearError(queryParser);
 				cpix_QueryParser_destroy(queryParser);
@@ -149,6 +160,7 @@
 	    
     if (queryParser_ == NULL)
         {
+        assert_failed = 1;
         ITK_PANIC("Could not create query parser");
         }                
 
@@ -162,6 +174,7 @@
     if (cpix_Failed(queryParser_)
                 || query == NULL)
         {
+            assert_failed = 1;
             cpix_Analyzer_destroy(analyzer);
             cpix_ClearError(queryParser_);
             cpix_QueryParser_destroy(queryParser_);
@@ -191,27 +204,35 @@
 }
 
 void TestAllTermSearch(Itk::TestMgr * testMgr) 
-{
+{    
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
 	TestAppclassFilteredTermSearch(testMgr, 0);
+	testResultXml(xml_file);
 }
 
 void TestMp3TermSearch(Itk::TestMgr * testMgr) 
 {
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
 	TestAppclassFilteredTermSearch(testMgr, LMP3APPCLASS);
+	testResultXml(xml_file);
 }
 
 void TestTextTermSearch(Itk::TestMgr * testMgr) 
 {
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
 	TestAppclassFilteredTermSearch(testMgr, LTEXTAPPCLASS);
+	testResultXml(xml_file);
 }
 
 Itk::TesterBase * CreateTermSearchTests()
 {
     using namespace Itk;
 
-    ContextTester
-        * whiteBox = new ContextTester("terms",
-                                       NULL); // default context
+    SuiteTester
+        * whiteBox = new SuiteTester("terms"); // default context
 
     whiteBox->add("allterms",
                   &TestAllTermSearch,
--- a/searchengine/cpix/tsrc/cpixunittest/src/testutils.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/testutils.cpp	Thu May 27 13:59:44 2010 +0300
@@ -34,6 +34,8 @@
 
 #include "testutils.h"
 
+#include "std_log_result.h"
+
 std::wstring GetItemId(int itemIndex)
 {
     using namespace std;
@@ -220,6 +222,7 @@
                       idxDbPath(),
                       qualBaseAppClass(),
                       report);
+            assert_failed = 1;
         }
 
     schemaId_ = addSchema();
@@ -283,6 +286,7 @@
 	
     if ( cpix_Failed( idxDb_ ) )
     {
+        assert_failed = 1;
 		ITK_PANIC("Could not flush idx db '%s' for '%s'",
 				  idxDbPath(),
 				  qualBaseAppClass());
@@ -488,6 +492,10 @@
                     result,
                     docUid.c_str());
         }
+    else
+        {
+            assert_failed = 1;
+        }
 }
 
 
@@ -577,7 +585,7 @@
                        failureStr,
                        id,
                        report);
-
+            assert_failed = 1;
             cpix_ClearError(idxDb());
         }
 }
--- a/searchengine/cpix/tsrc/cpixunittest/src/utf8.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/utf8.cpp	Thu May 27 13:59:44 2010 +0300
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "testutils.h"
 
+#include "std_log_result.h"
+
 const char * Utf8DocsToIndex[5] = {
     FILE_TEST_CORPUS_PATH "\\fi\\1.txt",
     FILE_TEST_CORPUS_PATH "\\fi\\2.txt",
@@ -44,6 +46,8 @@
 
 void TestUtf8(Itk::TestMgr * testMgr)
 {
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
         cpix_Result
             result;
 
@@ -59,7 +63,11 @@
 	
 	cpix_Analyzer* analyzer = cpix_CreateSimpleAnalyzer(&result); 
 	
-	if ( cpix_Failed( &result) ) ITK_PANIC("Analyzer could not be created");
+	if ( cpix_Failed( &result) ) 
+	    {
+        assert_failed = 1;
+        ITK_PANIC("Analyzer could not be created");
+	    }
 	
 	for (int i = 0; Utf8DocsToIndex[i]; i++) 
 	{
@@ -76,6 +84,7 @@
 													analyzer );
 		if (queryParser == NULL)
 			{
+                assert_failed = 1;
 				cpix_Analyzer_destroy( analyzer );
 				ITK_PANIC("Could not create query parser");
 			}
@@ -85,6 +94,7 @@
 		if (cpix_Failed(queryParser)
 			|| query == NULL)
 			{
+                assert_failed = 1;
 				cpix_Analyzer_destroy(analyzer);
 				cpix_ClearError(queryParser);
 				cpix_QueryParser_destroy(queryParser);
@@ -104,15 +114,15 @@
 	}
 	
 	cpix_Analyzer_destroy( analyzer ); 
+	testResultXml(xml_file);
 }
 
 Itk::TesterBase * CreateUtf8Tests()
 {
     using namespace Itk;
 
-    ContextTester
-        * whiteBox = new ContextTester("utf8",
-                                       NULL); // default context
+    SuiteTester
+        * whiteBox = new SuiteTester("utf8"); // default context
 
     whiteBox->add("utf8",
                   &TestUtf8,
--- a/searchengine/cpix/tsrc/cpixunittest/src/whiteboxtests.cpp	Fri May 14 16:57:37 2010 +0300
+++ b/searchengine/cpix/tsrc/cpixunittest/src/whiteboxtests.cpp	Thu May 27 13:59:44 2010 +0300
@@ -36,15 +36,19 @@
 #include "cpixhits.h"
 #include "idxdbdelta.h"
 
+#include "std_log_result.h"
+
 void TestBaseAppClassCollision(Itk::TestMgr * testMgr)
 {
     cpix_Result
         result;
-
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
     cpix_IdxDb_defineVolume(&result,
                             SMS_QBASEAPPCLASS,
                             NULL);
-
+    if(!cpix_Succeeded(&result))
+        assert_failed = 1;        
     ITK_ASSERT(testMgr,
                cpix_Succeeded(&result),
                "Definition of volume (%s, %s) failed.",
@@ -54,7 +58,8 @@
     cpix_IdxDb_defineVolume(&result,
                             SMS_QBASEAPPCLASS,
                             NULL);
-
+    if(!cpix_Succeeded(&result))
+        assert_failed = 1; 
     ITK_ASSERT(testMgr,
                cpix_Succeeded(&result),
                "Re-definition of identical volume (%s, %s) failed.",
@@ -67,7 +72,8 @@
     cpix_IdxDb_defineVolume(&result,
                             SMS_QBASEAPPCLASS,
                             dummyPath);
-
+    if(!cpix_Succeeded(&result))
+        assert_failed = 1; 
     ITK_ASSERT(testMgr,
                cpix_Failed(&result),
                "Volume (%s, %s) definition should have failed.",
@@ -75,6 +81,7 @@
                dummyPath);
 
     cpix_IdxDb_undefineVolume("@0:root foo bar");
+    testResultXml(xml_file);
 }
 
 
@@ -87,10 +94,13 @@
 {
     cpix_Result
         result;
-
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
     cpix_IdxDb_defineVolume(&result,
                       DUMMY_QBASEAPPCLASS,
                       DUMMY_IDXDBPATH);
+    if(!cpix_Succeeded(&result))
+        assert_failed = 1;
     ITK_ASSERT(testMgr,
                cpix_Succeeded(&result),
                "Defining volume %s, %s failed.",
@@ -100,12 +110,14 @@
     cpix_IdxDb_defineVolume(&result,
                       DUMMY2_QBASEAPPCLASS,
                       DUMMY_IDXDBPATH);
-
+    if(!cpix_Succeeded(&result))
+        assert_failed = 1;
     ITK_ASSERT(testMgr,
                cpix_Failed(&result),
                "Defining volume %s, %s should have failed.",
                DUMMY2_QBASEAPPCLASS,
                DUMMY_IDXDBPATH);
+    testResultXml(xml_file);
 }
 
 
@@ -114,6 +126,8 @@
 {
     cpix_Result
         result;
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
 
     cpix_IdxDb_defineVolume(&result,
                             SMS_QBASEAPPCLASS,
@@ -127,6 +141,7 @@
 
             if (cpix_Succeeded(&result))
                 {
+            assert_failed = 1;
                     cpix_IdxDb_releaseDb(idxDb);
                 }
         }
@@ -148,11 +163,16 @@
         {
             cpix_IdxDb_releaseDb(idxDb);
         }
+    else
+        {
+            assert_failed = 1;
+        }
 
     ITK_ASSERT(testMgr,
                cpix_Failed(&result),
                "Opening IdxDb(%s) should have failed now.",
                SMS_QBASEAPPCLASS);
+    testResultXml(xml_file);
 }
 
 const wchar_t * QryStrings[] = {
@@ -183,7 +203,8 @@
 void TestUnifiedSearchParse(Itk::TestMgr * )
 {
     using namespace std;
-
+    char *xml_file = (char*)__FUNCTION__;
+    assert_failed = 0;
     printf("Whitebox testing parsing of unified search syntax\n\n");
 
     const wchar_t
@@ -216,12 +237,15 @@
                        qc.innerQryStr_.c_str());
                 
             } catch (CpixExc & cpixExc) {
+                assert_failed = 1;
                 printf("Failed to parse: %S\n",
                        cpixExc.wWhat());
             } catch (...) {
+                assert_failed = 1;
                 printf("Failed t parse: for unknown reasons\n");
             }
         }
+    testResultXml(xml_file);
 }
 
 
@@ -310,6 +334,8 @@
 
     void testAddSome(Itk::TestMgr  * mgr)
     {
+        char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
         std::wstring
             firstBody,
             secondBody;
@@ -336,6 +362,7 @@
                     }
             }
         util_->flush();
+        testResultXml(xml_file);
     }
 
 
@@ -344,13 +371,15 @@
         cpix_Hits
             * hits = cpix_IdxDb_search(util_->idxDb(),
                                        query_);
-
+        char *xml_file = (char*)__FUNCTION__;
+        assert_failed = 0;
         if (cpix_Failed(util_->idxDb()))
             {
                 ITK_EXPECT(mgr,
                            false,
                            "Failed to search index");
                 cpix_ClearError(util_->idxDb());
+                assert_failed = 1;
             }
         else
             {
@@ -362,7 +391,10 @@
                            "Did not get expected hitcounts (%d), but %d",
                            expectedHitCount_,
                            hitsLength);
-                           
+                if(expectedHitCount_ != hitsLength)
+                    {
+                    assert_failed = 1;
+                    }
                 
                 printf("Got %d hits\n",
                        hitsLength);
@@ -390,6 +422,7 @@
             }
         
         cpix_Hits_destroy( hits );  
+        testResultXml(xml_file);
     }
 
 
@@ -989,7 +1022,8 @@
     {
         using namespace lucene::index;
         using namespace std;
-
+        char *xml_file = (char*)__FUNCTION__;
+          assert_failed = 0;
         printf("Start state of index:\n");
 
         {
@@ -1014,6 +1048,7 @@
             {
                 if (!reader_.isOpen())
                     {
+                assert_failed = 1;
                         ITK_PANIC("Reader should be open");
                     }
 
@@ -1031,11 +1066,13 @@
                         ITK_EXPECT(mgr,
                                    result == 1,
                                    "Should have deleted exactly one doc");
-                        
+                        if(result != 0)
+                            assert_failed = 1;
                         printf("... deleted doc %S\n",
                                DeltaSmsesToDelete[i]);
                     }
             }
+        testResultXml(xml_file);
     }
 
 
@@ -1085,7 +1122,8 @@
     {
         using namespace lucene::search;
         using namespace Cpix::Impl;
-
+        char *xml_file = (char*)__FUNCTION__;
+          assert_failed = 0;
         // The TestCommitStageAction instance we give is to emulate
         // interrupting the committing-to-disk process at different
         // stages, and see if we can recover whatever information can
@@ -1127,10 +1165,15 @@
                                            "Complete, committed, updated idx dir should exist (%s): %s",
                                            test_.c_str(),
                                            deltaIdxDbPath.c_str());
+                                if(!Cpt::directoryexists(deltaIdxDbPath.c_str()))
+                                    {
+                                    assert_failed = 1;
+                                    }
                             }
                     }
                 else
                     {
+                assert_failed = 1;
                         ITK_EXPECT(mgr,
                                    false,
                                    "Should have been interrupted at stage %d",
@@ -1139,6 +1182,7 @@
             }
         catch (TestCommitStageExc & exc)
             {
+        assert_failed = 1;
                 if (exc.commitStage_ == targetCommitStage_)
                     {
                         properlyInterrupted = true;
@@ -1158,12 +1202,19 @@
                     || insertBuf_->isEmpty()
                     || targetCommitStage_ < CS_IBUF_COMMITTING),
                    "Expected the (test) insert buffer to be closed");
-
+        if(!properlyInterrupted || (haveReader_ || reader_.isOpen() ) ||  !((insertBuf_ == NULL 
+                || insertBuf_->isEmpty() || targetCommitStage_ < CS_IBUF_COMMITTING)))
+            {
+            assert_failed = 1;
+            }
+        testResultXml(xml_file);
     }
 
 
     void testRecoveredStage(Itk::TestMgr * )
     {
+        char *xml_file = (char*)__FUNCTION__;
+          assert_failed = 0;
         if (reader_.isOpen())
             {
                 printf("Reader (either the original or the re-created):\n");
@@ -1180,6 +1231,7 @@
         printf("The recovered state of index:\n");
 
         searchAndPrint(reader_.getReader());
+        testResultXml(xml_file);
     }
 
 
@@ -1375,11 +1427,14 @@
         * whiteBox = new SuiteTester("whitebox");
 
     whiteBox->add("baccoll",
-                  &TestBaseAppClassCollision);
+                  &TestBaseAppClassCollision,
+                  "baccoll");
     whiteBox->add("idpcoll",
-                  &TestIdxDbPathCollision);
+                  &TestIdxDbPathCollision,
+                  "idpcoll");
     whiteBox->add("scrapall",
-                  &TestScrapAll);
+                  &TestScrapAll,
+                  "scrapall");
     
     whiteBox->add("unifiedSearchParse",
                   &TestUnifiedSearchParse,