searchengine/cpix/tsrc/cpixunittest/src/cpixunittest.cpp
changeset 24 65456528cac2
parent 7 a5fbfefd615f
equal deleted inserted replaced
23:d4d56f5e7c55 24:65456528cac2
    30 
    30 
    31 #include "itk.h"
    31 #include "itk.h"
    32 
    32 
    33 #include <iostream>
    33 #include <iostream>
    34 #include <fstream>
    34 #include <fstream>
       
    35 
       
    36 #include "std_log_result.h"
    35 
    37 
    36 #ifdef __GCCE__
    38 #ifdef __GCCE__
    37 #include <staticlibinit_gcce.h>
    39 #include <staticlibinit_gcce.h>
    38 #endif
    40 #endif
    39 
    41 
   114 
   116 
   115     all->add(CreateMultiVolumeTests()); 	
   117     all->add(CreateMultiVolumeTests()); 	
   116     all->add(CreateDomainSelectionTests()); 
   118     all->add(CreateDomainSelectionTests()); 
   117     all->add(CreateUtf8Tests());			
   119     all->add(CreateUtf8Tests());			
   118     all->add(CreateUtf8PathTests());
   120     all->add(CreateUtf8PathTests());
   119     all->add(CreateAnalysisTests());		
   121    // all->add(CreateAnalysisTests());		
   120 		 
   122 		 
   121     all->add(CreatePdfSearchTests());
   123     all->add(CreatePdfSearchTests());
   122     all->add(CreateDocumentTests());		
   124     all->add(CreateDocumentTests());		
   123     all->add(CreateFlushTests());			
   125     all->add(CreateFlushTests());			
   124     all->add(CreateHeartbeatTests());	    
   126     all->add(CreateHeartbeatTests());	    
   222                 if (cpix_Failed(initParams))
   224                 if (cpix_Failed(initParams))
   223                     {
   225                     {
   224                         printf("Failed to increase thread priority\n");
   226                         printf("Failed to increase thread priority\n");
   225                         return -1;
   227                         return -1;
   226                     }
   228                     }
       
   229 		cpix_InitParams_setResourceDir(initParams,
       
   230 									   RESOURCE_PATH);
       
   231 		if (cpix_Failed(initParams))
       
   232 			{
       
   233 				printf("Failed to set resource dir\n");
       
   234 				return -1;
       
   235 			}
   227 
   236 
   228 		cpix_init(&result,
   237 		cpix_init(&result,
   229                           initParams);
   238                           initParams);
   230 		if (cpix_Failed(&result))
   239 		if (cpix_Failed(&result))
   231 			{
   240 			{
   234 				cpix_Error_report(result.err_,
   243 				cpix_Error_report(result.err_,
   235                                                   buffer,
   244                                                   buffer,
   236                                                   sizeof(buffer)/sizeof(wchar_t));
   245                                                   sizeof(buffer)/sizeof(wchar_t));
   237 				printf("Failed to initialize CPix: %S\n",
   246 				printf("Failed to initialize CPix: %S\n",
   238 					   buffer);
   247 					   buffer);
       
   248 				
       
   249 				std::wofstream out("c:\\data\\cpixunittest\\report.txt");
       
   250 				out<<"Failed to initialize CPix:\n"<<buffer<<std::flush;
   239 				return -1;
   251 				return -1;
   240 			}
   252 			}
   241 
   253 
   242                 cpix_InitParams_destroy(initParams);
   254                 cpix_InitParams_destroy(initParams);
   243 	
   255 	
   302 					ofs("c:\\data\\cpixunittest\\report.txt");
   314 					ofs("c:\\data\\cpixunittest\\report.txt");
   303 				if (ofs)
   315 				if (ofs)
   304 					{
   316 					{
   305 						testMgr.generateSummary(ofs);
   317 						testMgr.generateSummary(ofs);
   306 					}
   318 					}
       
   319 				
       
   320 		        bool
       
   321 		            verdict = (testMgr.getFailedExpects() + testMgr.getFailedAsserts()) == 0;
       
   322 		        
       
   323 		            testResultXml(focus, verdict);
       
   324 		        
       
   325 		        
   307 			}
   326 			}
   308 		
   327 		
   309 	
   328 	
   310 		cpix_shutdown();
   329 		cpix_shutdown();
   311 	
       
   312 		int
       
   313 			c = getchar();
       
   314 	}
   330 	}
   315 
   331 
   316 #ifdef __SYMBIAN32__
   332 #ifdef __SYMBIAN32__
   317     __UHEAP_MARKEND; 
   333     __UHEAP_MARKEND; 
   318 #endif 
   334 #endif