summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-07-26 16:19:58 +0000
committerDavid Robillard <d@drobilla.net>2007-07-26 16:19:58 +0000
commitdfcc6b65f887e3afcb3aa35eb7b15b7d7ffb972e (patch)
treef04e684e9bb14c2ac54687a1b0390338b4cd0d50 /tests
parent47fb95d6086c2c67086316a25b4c0858783d3c2b (diff)
downloadraul-dfcc6b65f887e3afcb3aa35eb7b15b7d7ffb972e.tar.gz
raul-dfcc6b65f887e3afcb3aa35eb7b15b7d7ffb972e.tar.bz2
raul-dfcc6b65f887e3afcb3aa35eb7b15b7d7ffb972e.zip
Fix various Table bugs (and put some way too slow code in there, but hey, it works).
Use PathTable for models on the client side. Implement renaming on client side. git-svn-id: http://svn.drobilla.net/lad/raul@636 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'tests')
-rw-r--r--tests/table_test.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/table_test.cpp b/tests/table_test.cpp
index 35bc408..4628474 100644
--- a/tests/table_test.cpp
+++ b/tests/table_test.cpp
@@ -44,7 +44,7 @@ main()
Table<int,int>::const_iterator range_begin = t.begin();
++range_begin; ++range_begin;
- Table<int,int>::const_iterator range_end = t.find_range_end(t.begin(), range_comparator);
+ Table<int,int>::iterator range_end = t.find_range_end(t.begin(), range_comparator);
for (Table<int,int>::const_iterator i = t.begin(); i != range_end; ++i)
cout << i->first << " ";
@@ -122,6 +122,26 @@ main()
cout << i->first << " ";
cout << endl;
+ const Path yank_path("/bar");
+ PathTable<char>::iterator quux = pt.find(yank_path);
+ assert(quux != pt.end());
+ PathTable<char>::iterator quux_end = pt.find_descendants_end(quux );
+ assert(quux_end != quux);
+
+ std::vector<std::pair<Path,char> > yanked = pt.yank(quux, quux_end);
+
+ cout << "Yanked " << yank_path << endl;
+ for (PathTable<char>::const_iterator i = pt.begin(); i != pt.end(); ++i)
+ cout << i->first << " ";
+ cout << endl;
+
+ pt.cram(yanked);
+
+ cout << "Crammed " << yank_path << endl;
+ for (PathTable<char>::const_iterator i = pt.begin(); i != pt.end(); ++i)
+ cout << i->first << " ";
+ cout << endl;
+
/* **** */
cout << "\nAssuming you built with debugging, if this continues to run "