|
Revision 706, 449 bytes
(checked in by smidl, 16 years ago)
|
|
eol-native
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | #include "TestList.h" |
|---|
| 2 | #include "Test.h" |
|---|
| 3 | |
|---|
| 4 | #include <cassert> |
|---|
| 5 | |
|---|
| 6 | namespace UnitTest { |
|---|
| 7 | |
|---|
| 8 | TestList::TestList() |
|---|
| 9 | : m_head ( 0 ) |
|---|
| 10 | , m_tail ( 0 ) { |
|---|
| 11 | } |
|---|
| 12 | |
|---|
| 13 | void TestList::Add ( Test* test ) { |
|---|
| 14 | if ( m_tail == 0 ) { |
|---|
| 15 | assert ( m_head == 0 ); |
|---|
| 16 | m_head = test; |
|---|
| 17 | m_tail = test; |
|---|
| 18 | } else { |
|---|
| 19 | m_tail->next = test; |
|---|
| 20 | m_tail = test; |
|---|
| 21 | } |
|---|
| 22 | } |
|---|
| 23 | |
|---|
| 24 | Test* TestList::GetHead() const { |
|---|
| 25 | return m_head; |
|---|
| 26 | } |
|---|
| 27 | |
|---|
| 28 | ListAdder::ListAdder ( TestList& list, Test* test ) { |
|---|
| 29 | list.Add ( test ); |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | } |
|---|