1 // Test driver for text collection
4 #include "HeapProfiler.h"
8 #include "TextCollection.h"
9 using SXSI::TextCollection;
11 void printDocumentResult(TextCollection::document_result dr)
13 TextCollection::document_result::iterator it;
14 printf("document result:");
15 for (it = dr.begin(); it != dr.end(); ++it)
21 void printFullResult(TextCollection::full_result fr)
23 TextCollection::full_result::iterator it;
24 printf("full result:");
25 for (it = fr.begin(); it != fr.end(); ++it)
26 printf(" (%i, %lu)", (*it).first, (*it).second);
34 uchar * str = (uchar*) "";
36 TextCollection *csa = TextCollection::InitTextCollection(64);
37 for(int i = 0; i<1000000; i++){
40 std::cerr << "Before MakeStatic() [press enter]\n";
42 std::cerr << "heap usage: " << HeapProfiler::GetHeapConsumption()/(1024*1024) << " Mbytes" << std::endl;
44 std::cerr << "After MakeStatic() [press enter]\n";
46 std::cerr << "heap usage: " << HeapProfiler::GetHeapConsumption()/(1024*1024) << " Mbytes" << std::endl;
48 std::cerr << "After Delete [press enter]\n";
49 std::cerr << "heap usage: " << HeapProfiler::GetHeapConsumption()/(1024*1024) << " Mbytes" << std::endl;