aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-08-15 15:22:17 +0200
committerSebastian Geerken <devnull@localhost>2013-08-15 15:22:17 +0200
commit183e15f49625b3a15a9b2e511970c988d7164c23 (patch)
treedcbcb1cd382b78453f403ee1870be60316e7fa68
parentb8d6e3ec9f5d0b2676eaea34fae2b8253ec44104 (diff)
Some more debugging.
-rw-r--r--dw/iterator.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/dw/iterator.cc b/dw/iterator.cc
index 602dfec4..b5b9b292 100644
--- a/dw/iterator.cc
+++ b/dw/iterator.cc
@@ -607,6 +607,23 @@ int DeepIterator::compareTo (object::Comparable *other)
// Search the highest level, where the widgets are the same.
int level = 0;
+ // The Comparable interface does not define "uncomparable". Deep
+ // iterators are only comparable if they belong to the same widget
+ // tree, so have the same widget at the bottom at the
+ // stack. If this is not the case, we abort.
+
+ assert (stack.size() > 0);
+ assert (otherDeepIterator->stack.size() > 0);
+
+ //printf ("Equal? The %s %p and the %s %p?\n",
+ // stack.get(0)->getWidget()->getClassName(),
+ // stack.get(0)->getWidget(),
+ // otherDeepIterator->stack.get(0)->getWidget()->getClassName(),
+ // otherDeepIterator->stack.get(0)->getWidget());
+
+ assert (stack.get(0)->getWidget()
+ == otherDeepIterator->stack.get(level)->getWidget());
+
while (stack.get(level)->getWidget ()
== otherDeepIterator->stack.get(level)->getWidget ()) {
if (level == stack.size() - 1 ||