ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/ccscs20/UnitTest.cpp
(Generate patch)

Comparing UnitTest.cpp (file contents):
Revision 2 by Douglas Thrift, 2004-05-12T23:40:15-07:00 vs.
Revision 7 by Douglas Thrift, 2004-05-14T00:13:01-07:00

# Line 4 | Line 4
4   //
5   // $Id$
6  
7 + #include <iostream>
8 + #include <string>
9   #include "DoublyLinkedList.hpp"
10  
11 + using namespace std;
12 +
13   int main(int argc, char* argv[])
14   {
15 +        cout.setf(ios_base::boolalpha);
16 +
17          DoublyLinkedList<int> list;
18  
19 +        list.addFront(1);
20 +        list.addBack(2);
21 +        list.addFront(4);
22 +        list.addBack(5);
23 +
24 +        // 4 1 2 5
25 +
26 +        cout << "list.contains(1) = " << list.contains(1) << '\n'
27 +                << "list.contains(2) = " << list.contains(2) << '\n'
28 +                << "list.contains(3) = " << list.contains(3) << '\n'
29 +                << "list.contains(4) = " << list.contains(4) << '\n'
30 +                << "list.contains(5) = " << list.contains(5) << '\n';
31 +
32 +        list.removeFirst(2);
33 +
34 +        // 4 1 5
35 +
36 +        cout << "list.contains(2) = " << list.contains(2) << '\n'
37 +                << "list.contains(5) = " << list.contains(5) << '\n';
38 +
39 +        Iterator<int> itor(list.iterator());
40 +
41 +        do
42 +        {
43 +                cout << *itor << '\n';
44 +        }
45 +        while ((itor++).next());
46 +
47          return 0;
48   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines