Revision 418, 491 bytes
(checked in by vbarta, 15 years ago)
|
#27: added UnitTest?++ to bdm sources, changed test_user_data to use it
|
Rev | Line | |
---|
[418] | 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 | |
---|
| 14 | void TestList::Add(Test* test) |
---|
| 15 | { |
---|
| 16 | if (m_tail == 0) |
---|
| 17 | { |
---|
| 18 | assert(m_head == 0); |
---|
| 19 | m_head = test; |
---|
| 20 | m_tail = test; |
---|
| 21 | } |
---|
| 22 | else |
---|
| 23 | { |
---|
| 24 | m_tail->next = test; |
---|
| 25 | m_tail = test; |
---|
| 26 | } |
---|
| 27 | } |
---|
| 28 | |
---|
| 29 | Test* TestList::GetHead() const |
---|
| 30 | { |
---|
| 31 | return m_head; |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | ListAdder::ListAdder(TestList& list, Test* test) |
---|
| 35 | { |
---|
| 36 | list.Add(test); |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | } |
---|