testConstructedQueueIsEmpty() {
15assert(curQueue.
toVector() == std::vector<int>({10}));
17assert(curQueue.
toVector() == std::vector<int>({10, 20}));
20assert(curQueue.
toVector() == std::vector<int>({10, 20, 30, 40}));
30assert(curQueue.
toVector() == std::vector<int>({20, 30}));
33assert(curQueue.
toVector() == std::vector<int>({30}));
42assert(curQueue.
front() == 10);
44assert(curQueue.
front() == 10);
47voidtestQueueAfterClearIsEmpty() {
56voidtestFrontThrowsAnInvalidArgumentWhenQueueEmpty() {
58 boolwasException =
false;
61}
catch(
conststd::invalid_argument&) {
67voidtestDeQueueThrowsAnInvalidArgumentWhenQueueEmpty() {
69 boolwasException =
false;
72}
catch(
conststd::invalid_argument&) {
79testConstructedQueueIsEmpty<int>();
80testConstructedQueueIsEmpty<double>();
81testConstructedQueueIsEmpty<std::vector<long double>>();
86testQueueAfterClearIsEmpty();
88testFrontThrowsAnInvalidArgumentWhenQueueEmpty();
89testDeQueueThrowsAnInvalidArgumentWhenQueueEmpty();
91std::cout <<
"All tests pass!\n";
std::vector< value_type > toVector() const
converts the queue into the std::vector
bool isEmptyQueue() const
checks if the queue has no elements
void clear()
removes all elements from the queue
void enQueue(const value_type &item)
inserts a new item into the queue
void deQueue()
removes the first element from the queue
int main()
Main function.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4