/////////////////////////////////////////////////////////////// // TestMTQwNP.cpp -test mtqueue with node pool // // ver 1.0 // // Language: Visual C++, ver 6.0 // // Platform: Micron Dual Pentium Pro 200, Win NT 4.0 // // Application: Demo for CSE691, Pr#3, Fall 98 // // Author: Jim Fawcett, CST 2-187, Syracuse Univ. // // (315) 443-3948, fawcett@ecs.syr.edu // /////////////////////////////////////////////////////////////// // Operations: // /////////////////////////////////////////////////////////////// // This program enqueues a large number of values, then // // dequeues them, which should put all the dequeued nodes // // in the node pool. Then all values are queued back up // // which should remove all the nodes from the node pool // // and put them back on the queue. // // // /////////////////////////////////////////////////////////////// // Build Process // /////////////////////////////////////////////////////////////// // Files Required: // // TestNTQwNP.cpp, nodePool.h, mtqueue.h // // // // Compiler Command: // // cl /GX /D "_X86_" TestMTQwNP.cpp // // // /////////////////////////////////////////////////////////////// #include #include "mtqueue.h" #include "timer.h" using namespace std; // void main() { cout << "\n Testing mtqueue with node pool " << "\n ================================\n"; cout << "\n Testing queued values " << "\n -----------------------\n"; mtqueue mtq; int i, numQs = 7; cout << "\n "; for(i=0; i 0) { cout << "deQing " << mtq.deQ(); if(mtq.length() > 0) cout << ", "; } cout << endl; // cout << "\n Testing node pool stores and retrieves " << "\n ----------------------------------------\n"; timer t; const int NumTimes = 500000; cout << "\n ---------------------------------------------" << "\n enQueuing a large number of items " << "\n should fill queue but leave node pool empty" << "\n ---------------------------------------------\n"; t.start(); for(i=0; i