summaryrefslogtreecommitdiffstats
path: root/tests/list_test.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-01-07 21:27:39 +0000
committerDavid Robillard <d@drobilla.net>2010-01-07 21:27:39 +0000
commit0d009a4e980e40dc8a9c9b5e3d25c3fafb363e95 (patch)
tree4d41dea009f1647519af8df10f114cd7a6165792 /tests/list_test.cpp
parent61ac4a41f0aea63f45d7b27be3ef2e0554e93ece (diff)
downloadraul-0d009a4e980e40dc8a9c9b5e3d25c3fafb363e95.tar.gz
raul-0d009a4e980e40dc8a9c9b5e3d25c3fafb363e95.tar.bz2
raul-0d009a4e980e40dc8a9c9b5e3d25c3fafb363e95.zip
Move unit testing and coverage framework into autowaf.
Make raul tests return 0 on success, 1 on failure. Test coverage for Raul. git-svn-id: http://svn.drobilla.net/lad/trunk/raul@2368 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'tests/list_test.cpp')
-rw-r--r--tests/list_test.cpp168
1 files changed, 0 insertions, 168 deletions
diff --git a/tests/list_test.cpp b/tests/list_test.cpp
deleted file mode 100644
index ae139ce..0000000
--- a/tests/list_test.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-#include <iostream>
-#include <cstddef>
-#include "raul/List.hpp"
-
-using namespace std;
-using namespace Raul;
-
-
-int main()
-{
- List<int> l;
-
- l.push_back(new List<int>::Node(1));
- l.push_back(new List<int>::Node(2));
- l.push_back(new List<int>::Node(3));
- l.push_back(new List<int>::Node(4));
- l.push_back(new List<int>::Node(5));
- l.push_back(new List<int>::Node(6));
- l.push_back(new List<int>::Node(7));
- l.push_back(new List<int>::Node(8));
-
- cout << "List:" << endl;
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- cout << *i << endl;
- }
- cout << endl;
-
-
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- if ((*i) == 4) {
- l.erase(i);
- break;
- }
- }
-
- cout << "Removed 4 (by iterator)...\n";
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- cout << *i << endl;
- }
- cout << endl;
-
- /*l.remove(1);
-
- cout << "Removed 1 (head) (by value)...\n";
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- cout << *i << endl;
- }
- cout << endl;
- */
-
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- if ((*i) == 2) {
- l.erase(i);
- break;
- }
- }
-
- cout << "Removed 2 (head) (by iterator)...\n";
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- cout << *i << endl;
- }
- cout << endl;
-
- /*l.remove(5);
-
- cout << "Removed 5 (by value)...\n";
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- cout << *i << endl;
- }
- cout << endl;
-
- l.remove(8);
-
- cout << "Removed 8 (tail) (by value)...\n";
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- cout << *i << endl;
- }
- cout << endl;
- */
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- if ((*i) == 7) {
- l.erase(i);
- break;
- }
- }
-
- cout << "Removed 7 (tail) (by iterator)...\n";
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- cout << *i << endl;
- }
- cout << endl;
-
- List<int> r;
- r.push_back(new List<int>::Node(9));
- r.erase(r.begin());
- cout << "Should not see ANY numbers:\n";
- for (List<int>::iterator i = r.begin(); i != r.end(); ++i) {
- cout << *i << endl;
- }
-
- cout << "\n\nTesting appending to an empty list:\n";
- l.clear();
-
- List<int> l2;
- l2.push_back(new List<int>::Node(1));
- l2.push_back(new List<int>::Node(2));
- l2.push_back(new List<int>::Node(3));
- l2.push_back(new List<int>::Node(4));
-
- cout << "l1:\n";
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- cout << *i << endl;
- }
-
- cout << "l2:\n";
- for (List<int>::iterator i = l2.begin(); i != l2.end(); ++i) {
- cout << *i << endl;
- }
-
- l.append(l2);
- cout << "l1.append(l2):\n";
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- cout << *i << endl;
- }
-
- cout << "\n\nAppending non-empty lists:\n";
- l2.push_back(new List<int>::Node(5));
- l2.push_back(new List<int>::Node(6));
- l2.push_back(new List<int>::Node(7));
- l2.push_back(new List<int>::Node(8));
-
- cout << "l1:\n";
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- cout << *i << endl;
- }
-
- cout << "l2:\n";
- for (List<int>::iterator i = l2.begin(); i != l2.end(); ++i) {
- cout << *i << endl;
- }
-
- l.append(l2);
- cout << "l1.append(l2):\n";
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- cout << *i << endl;
- }
-
-
- cout << "\n\nAppending an empty list:\n";
-
- cout << "l1:\n";
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- cout << *i << endl;
- }
-
- cout << "l2:\n";
- for (List<int>::iterator i = l2.begin(); i != l2.end(); ++i) {
- cout << *i << endl;
- }
-
- l.append(l2);
- cout << "l1.append(l2):\n";
- for (List<int>::iterator i = l.begin(); i != l.end(); ++i) {
- cout << *i << endl;
- }
-
- return 0;
-}