summaryrefslogtreecommitdiff
path: root/tests/test_dynamic_list.cc
AgeCommit message (Collapse)AuthorFilesLines
2010-05-08Check the contents of the test list after each move operation, to help track ↵Daniel Burrows1-12/+57
down problems with move().
2010-05-08Fix some swapped type names.Daniel Burrows1-3/+3
They worked because "T" was always being used as an integer-compatible type.
2010-05-08Add a missing copyright notice.Daniel Burrows1-0/+21
2010-05-06Add test code for the dynamic list collection's behavior when elements move.Daniel Burrows1-0/+38
I'm beginning to suspect that I'll want to replace dynamic lists with something that exposes a more tab-specific behavior after all. Most importantly, I think the model maybe should not *have* information about the order of the tabs -- including that complicates the interface and adds more information to keep in sync (with the associated usual problems, e.g., when the user moves a tab, does the view call back into the model, and how does it avoid an infinite loop?).
2010-05-06Fix the dynamic list collection insertion test to not crash by inserting ↵Daniel Burrows1-1/+1
into a bad index. I swapped the arguments to insert(); whoops!
2010-05-06Add a test of removing from sub-lists.Daniel Burrows1-0/+31
2010-05-06Test that the right thing happens when inserting into an initially empty list.Daniel Burrows1-2/+5
2010-05-06Add a test of what happens when we insert into a sublist of a dynamic list ↵Daniel Burrows1-0/+33
collection.
2010-05-05Rewrite the dynamic list collection for the new framework and re-enable its ↵Daniel Burrows1-90/+97
tests. I'm not sure the multi-index container is the most parsimonious implementation -- it might be better to use a simple vector or deque, since we have to pay for a linear traversal anyway -- but at this point I want to just *stop* and move on to the next step. This implementation is good enough, and more importantly, I think the interface is finally right.
2010-05-04Write tests verifying the behavior of move().Daniel Burrows1-0/+191
It's buggy, so they fail right now.
2010-05-04Redesign the dynamic-list interface to be more general, and update its tests ↵Daniel Burrows1-130/+297
to match. Specifically, I changed append() to a general insert() routine and added a move() routine, updating signals to correspond. I decided that although this imposes a bit more on clients of the interface (they need to support more signals and more general signals), it's probably better in the long run. It makes the list interface less surprising; it also makes it possible to more cleanly assemble several lists into a larger list (something that was ugly with the previous interface). Enumerators were eliminated because I forsee a need for direct indexing, and having both mechanisms was just clutter in the interface (IMO). The list collection object is now broken, and its tests are temporarily commented out. I also need to write a test for the new move() method.
2010-05-01Write a test of removing a list from a list collection.Daniel Burrows1-0/+33
2010-05-01Add a new meta-dynamic-list that somewhat arbitrarily mingles severalDaniel Burrows1-0/+65
other dynamic lists together. The ultimate goal is to write a class that places tabs into a notebook, and that can be used to replace the current top-level view, but will also work when the view is split by area. Having containers that emit notifications when they're changed and that can be accumulated (not coincidentally, the same way tabs are now) is a step towards having a reasonably clean implementation of that.
2010-05-01Fix the test of remove().Daniel Burrows1-0/+1
The expected list is initialized to (1, 2, 3) -- is that right? Anyway, fix it for now by emptying the expected list.
2010-05-01Write a test of remove().Daniel Burrows1-0/+22
2010-05-01Add support to the dynamic list interface for tracking the location of a ↵Daniel Burrows1-10/+13
removed item. This will be useful for implementing a "joint view"; it will allow the view to be reasonably consistent. With this addition, the remove() operation is now O(n). Oh well. This also means that there's not much point in using a multi_index_container in the impl class; it should be simplified and a vector used instead.
2010-04-30Add tests of the new dynamic_list class.Daniel Burrows1-0/+310