diff options
Diffstat (limited to 'src/libs/engine/tests')
-rw-r--r-- | src/libs/engine/tests/Makefile.am | 10 | ||||
-rw-r--r-- | src/libs/engine/tests/list_test.cpp | 93 |
2 files changed, 3 insertions, 100 deletions
diff --git a/src/libs/engine/tests/Makefile.am b/src/libs/engine/tests/Makefile.am index 993c9831..c9d1e0c9 100644 --- a/src/libs/engine/tests/Makefile.am +++ b/src/libs/engine/tests/Makefile.am @@ -1,14 +1,10 @@ if BUILD_UNIT_TESTS -AM_CXXFLAGS = @JACK_CFLAGS@ @LOSC_CFLAGS@ @ALSA_CFLAGS@ -I../../common -common_ldadd = @JACK_LIBS@ @LOSC_LIBS@ @ALSA_LIBS@ -lrt +AM_CXXFLAGS = @JACK_CFLAGS@ @RAUL_CFLAGS@ @LOSC_CFLAGS@ @ALSA_CFLAGS@ -I../../common +common_ldadd = @JACK_LIBS@ @RAUL_LIBS@ @LOSC_LIBS@ @ALSA_LIBS@ -lrt node_tree_test_LDADD = $(common_ldadd) -bin_PROGRAMS = node_tree_test list_test - -list_test_SOURCES = \ - ../List.h \ - list_test.cpp +bin_PROGRAMS = node_tree_test node_tree_test_SOURCES = \ node_tree_test.cpp diff --git a/src/libs/engine/tests/list_test.cpp b/src/libs/engine/tests/list_test.cpp deleted file mode 100644 index d2f91c9d..00000000 --- a/src/libs/engine/tests/list_test.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include "../List.h" -#include <iostream> -#include <cstddef> - -using std::cout; using std::endl; - - -int main() -{ - List<int> l; - - l.push_back(new ListNode<int>(1)); - l.push_back(new ListNode<int>(2)); - l.push_back(new ListNode<int>(3)); - l.push_back(new ListNode<int>(4)); - l.push_back(new ListNode<int>(5)); - l.push_back(new ListNode<int>(6)); - l.push_back(new ListNode<int>(7)); - l.push_back(new ListNode<int>(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.remove(i); - } - - std::cerr << "Removed 4 (by iterator)...\n"; - for (List<int>::iterator i = l.begin(); i != l.end(); ++i) { - cout << *i << endl; - } - cout << endl; - - l.remove(1); - - std::cerr << "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.remove(i); - } - - std::cerr << "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); - - std::cerr << "Removed 5 (by value)...\n"; - for (List<int>::iterator i = l.begin(); i != l.end(); ++i) { - cout << *i << endl; - } - cout << endl; - - l.remove(8); - - std::cerr << "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.remove(i); - } - - std::cerr << "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 ListNode<int>(9)); - r.remove(9); - std::cerr << "Should not see ANY numbers:\n"; - for (List<int>::iterator i = r.begin(); i != r.end(); ++i) { - cout << *i << endl; - } - return 0; -} |