From dfcc6b65f887e3afcb3aa35eb7b15b7d7ffb972e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 26 Jul 2007 16:19:58 +0000 Subject: 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 --- tests/table_test.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tests') 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::const_iterator range_begin = t.begin(); ++range_begin; ++range_begin; - Table::const_iterator range_end = t.find_range_end(t.begin(), range_comparator); + Table::iterator range_end = t.find_range_end(t.begin(), range_comparator); for (Table::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::iterator quux = pt.find(yank_path); + assert(quux != pt.end()); + PathTable::iterator quux_end = pt.find_descendants_end(quux ); + assert(quux_end != quux); + + std::vector > yanked = pt.yank(quux, quux_end); + + cout << "Yanked " << yank_path << endl; + for (PathTable::const_iterator i = pt.begin(); i != pt.end(); ++i) + cout << i->first << " "; + cout << endl; + + pt.cram(yanked); + + cout << "Crammed " << yank_path << endl; + for (PathTable::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 " -- cgit v1.2.1