#include #include "QueueT.h" using namespace std; bool ConstructorTest(); bool EnQueueDeQueueTest(size_t itemCount); bool EnqueueTest(size_t itemCount); void PrintQueue(QueueT ); int main() { size_t trials; if(not ConstructorTest()) { cout << "Constructor Test Failed " < 0) { cout << theQueue.Front() << " " ; // theQueue.Dequeue(); // } cout << endl; return; } bool EnqueueTest(size_t itemCount){ QueueT q; size_t i; for(i = 1; i <= itemCount; ++i) { q.Enqueue(static_cast(i)); PrintQueue(q); if (q.Size() != i) { cout << "Error in adding items to the queue" << endl; cout << q.Size() << " != " << i << endl; return false; } } return true; } bool EnQueueDeQueueTest(size_t itemCount){ size_t i; int tmpItem; QueueT q; // add the items to the queue in order for(i = 1; i <= itemCount; i++) { q.Enqueue(static_cast(i)); if (q.Size() != i) { cout << "Error in adding items to the queue" << endl; cout << q.Size() << " != " << i << endl; return false; } } // delete the items from the queue in order for(i = 1; i <= itemCount; i++) { tmpItem = q.Front(); q.Dequeue(); if (static_cast(i) != tmpItem) { cout << "Queue Order Error " << endl; cout << i << " != " << tmpItem << endl; return false; } } return true; } bool ConstructorTest(){ QueueT q; if (q.Size() != 0) { return false; } return true; }