summaryrefslogtreecommitdiff
path: root/lldb/test/python_api/value/linked_list/main.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-07-27 21:14:01 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-07-27 21:14:01 +0000
commitbfdf9a36d97932f14cceb58d2d0d712f6f1e9d6d (patch)
tree57cc7972a50326acc68a9883fd2e68c6741ae2e6 /lldb/test/python_api/value/linked_list/main.cpp
parent03f56d9de6d4620bc42c0ead65d4f33beb178c80 (diff)
The SBValue.linked_list_iter() API failed for an empty list.
Fix the bug and add a test case. llvm-svn: 136265
Diffstat (limited to 'lldb/test/python_api/value/linked_list/main.cpp')
-rw-r--r--lldb/test/python_api/value/linked_list/main.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lldb/test/python_api/value/linked_list/main.cpp b/lldb/test/python_api/value/linked_list/main.cpp
index 772d5ed5d1b2..db0e249cc91b 100644
--- a/lldb/test/python_api/value/linked_list/main.cpp
+++ b/lldb/test/python_api/value/linked_list/main.cpp
@@ -33,7 +33,7 @@ int main (int argc, char const *argv[])
task2->next = task4;
task4->next = task5;
- int total = 0; // Break at this line
+ int total = 0;
Task *t = task_head;
while (t != NULL) {
if (t->id >= 0)
@@ -41,5 +41,9 @@ int main (int argc, char const *argv[])
t = t->next;
}
printf("We have a total number of %d tasks\n", total);
- return 0;
+
+ // This corresponds to an empty task list.
+ Task *empty_task_head = new Task(-1, NULL);
+
+ return 0; // Break at this line
}