Mercurial > fife-parpg
comparison ext/UnitTest++/src/TestList.cpp @ 37:0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
author | jasoka@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 12 Jul 2008 12:00:57 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
36:6f1227f4932b | 37:0d325e9d5953 |
---|---|
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 const 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 } |