static void PrintIter( cFSDataSourceIter iter, cDebug& d ) { // //debug stuff // if( ! iter.CanDescend() ) { d.TraceError( "Iterator cannot descend; returning!\n"); return; } iter.Descend(); iter.TraceContents(); for( iter.SeekBegin(); ! iter.Done(); iter.Next() ) { iFCO* pFCO = iter.CreateFCO(); if( pFCO ) { pFCO->TraceContents(); pFCO->Release(); } else { d.TraceError( "*** Create of FCO failed!\n"); } if( iter.CanDescend() ) { d.TraceDebug( ">>Descending...\n" ); PrintIter(iter, d); } } }
void cParseSpecMask::Dump(cDebug &d) const { d.TraceDebug(" condition=(%s), propvector=:\n", msCondition.c_str(), msPV.c_str() ); // dump list of attributes if (mpAttrList) mpAttrList->Dump(d); }
static void PrintIter(const iFCOIter* pIter, cDebug& d) { TSTRING str; for(; ! pIter->Done(); pIter->Next()) { str += pIter->FCO()->GetName().AsString().c_str(); str += _T(" "); } d.TraceDebug(_T("%s\n"), str.c_str()); }
/////////////////////////////////////////////////////////////////////////////// // PrintPropVector -- function that prints the contents of a cFCOPropVector // TODO: We might want to add this functionality to the property vector some // day... /////////////////////////////////////////////////////////////////////////////// static void PrintPropVector(const cFCOPropVector& v, cDebug& d) { TOSTRINGSTREAM stream; for(int i=0; i<v.GetSize(); i++) { if(v.ContainsItem(i)) stream << i << "," << " "; } stream << std::ends; d.TraceDebug("%s\n", stream.str().c_str()); }
// we use this instead of TraceContents() so we can test the report iterators. static void TraceReport(const cFCOReport& r, cDebug& d) { d.TraceDebug("Global Error Queue:\n"); r.GetErrorQueue()->TraceContents(); cFCOReportGenreIter genreIter(r); int genreCount = 0; for (genreIter.SeekBegin(); !genreIter.Done(); genreIter.Next()) { d.TraceDebug("> Genre [%d]:\n", genreCount); cFCOReportSpecIter specIter(genreIter); int ct = 0; for(specIter.SeekBegin(); ! specIter.Done(); specIter.Next(), ct++) { d.TraceDebug(">>> Spec [%d]:\n", ct); ASSERT(specIter.GetSpec()); specIter.GetSpec()->TraceContents(); specIter.GetErrorQueue()->TraceContents(); d.TraceDebug(">>> Added Files:\n"); specIter.GetAddedSet()->TraceContents(); d.TraceDebug(">>> Removed Files:\n"); specIter.GetRemovedSet()->TraceContents (); // trace out changed files cFCOReportChangeIter changeIter(specIter); int changeCtr = 0; for(changeIter.SeekBegin(); ! changeIter.Done(); changeIter.Next(), changeCtr++) { d.TraceDebug(">>>>> Changed fco [%d]\n", changeCtr); d.TraceDebug(">>>>> Old FCO:\n"); changeIter.GetOld()->TraceContents(); d.TraceDebug(">>>>> New FCO:\n"); changeIter.GetNew()->TraceContents(); changeIter.GetChangeVector().TraceContents(); } } } }
void cParseNamedAttr::Dump(cDebug &d) const { d.TraceDebug(" name=(%s), value=(%s)\n", mstrName.c_str(), mstrValue.c_str()); }
static bool addRemove (cFCOPropVector &test1, cFCOPropVector &test2, cDebug& d) { int var1 = 0 , var2 = 64, var3 = 2; bool local=true, out=true; /* bool loopvar = true; int menu, var; cFCOPropVector testV; testV.SetSize(64); while (loopvar) { d.TraceAlways("\nChoose an operation to test:\n"); d.TraceAlways("\t1)Add an item to vector.\n"); d.TraceAlways("\t2)Remove an item from vector. \n"); d.TraceAlways("\t3)Check vector for item. \n"); d.TraceAlways("\t4)Display vector information \n"); d.TraceAlways("\t5)Stop add/remove tests. \n"); d.TraceAlways("Your choice [1-5]: "); cin>>menu; d.TraceAlways("\n"); switch (menu) { case 1: d.TraceAlways("Item to add: "); cin>> var; d.TraceAlways("%i \n", testV.AddItem(var)); break; case 2: d.TraceAlways("Item to remove: "); cin>>var; d.TraceAlways("%i \n", testV.RemoveItem(var)); break; case 3: d.TraceAlways("Item to check: "); cin>>var; if (testV.ContainsItem(var)) d.TraceAlways("\nItem present\n"); else d.TraceAlways("\nItem not present\n"); break; case 4: testV.check(d); break; case 5: loopvar = false; break; default: d.TraceAlways("Not a valid menu option\n"); break; }//end switch out &= local; //Keep track of results. }//end while */ test1.AddItem(var1); TEST(local &= test1.ContainsItem(var1)); //hopefully this is true! TEST(local &= !test1.ContainsItem(var3)); test2.SetSize(var2); TEST(local &= (test2.GetSize() == ((var2/32)+1)*32)); TEST(local &= (test1 != test2)); test1.RemoveItem(var1); test2.SetSize(test1.GetSize()); TEST(local &= (test1 == test2)); test1.AddItem(var3); test2 |= test1; d.TraceDetail("\nmMask should be 4!\n"); test2.check(d); test2.RemoveItem(var3); d.TraceDetail("\nmMask should be 0! \n"); test2.check(d); out &= local; //and-ing of results. return out; }//end addRemove