Пример #1
0
		/**
		* @brief Clears all lists and the stack.
		*
		* Suitable for when a buffer has its role switched back to front.
		*/
		void clearAll() {
			componentSpecsList.clear();
			componentFunctionsList.clear();
			entitySpecsList.clear();
			entityFunctionsList.clear();
			systemSpecsList.clear();
			systemFunctionsList.clear();
			events.clear();
			newSystems.clear();
			newEntities.clear();
			entitiesToDestroy.clear();

			stack.clear();
		}
Пример #2
0
int main(int argc, char *argv[])
{
	cout << "[+] singly linked list test program" << endl;
	SinglyLinkedList<int> slist;

	if(slist.empty())
	{
		cout << "[+] empty test pass (1/2)" << endl;
	}
	slist.addFront(1);
	if(!slist.empty())
	{
		cout << "[+] empty test pass (2/2)" << endl;
		cout << "[+] addFront test pass (1/3)" << endl;

		if(slist.front() == 1)
		{
			cout << "[+] front test pass (1/2) : " << slist.front() << endl;
			slist.addFront(2);

			if(slist.front() == 2)
			{
				cout << "[+] addFront test pass (2/2)" << endl;
				cout << "[+] front test pass (2/3) : " << slist.front() << endl;

				slist.removeFront();
				if(slist.front() == 1)
				{
					cout << "[+] removeFront test pass (1/1)" << endl;
					cout << "[+] front test pass (3/3) : " << slist.front() << endl;

					slist.clear();
					if(slist.empty())
					{
						cout << "[+] clear test pass (1/1)" << endl;
						cout << "[+] success!" << endl;
						return EXIT_SUCCESS;
					}
				}
			}
		}
	}
	cout << "[-] something wrong" << endl;
	
	return EXIT_FAILURE;
}