Mercurial > fife-parpg
annotate ext/UnitTest++/src/TestList.cpp @ 328:d8bcff5f7222
PyChan: adaptLayout performance fix.
author | phoku@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Mon, 24 Aug 2009 09:20:28 +0000 |
parents | 0d325e9d5953 |
children |
rev | line source |
---|---|
37
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
1 #include "TestList.h" |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
2 #include "Test.h" |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
3 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
4 #include <cassert> |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
5 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
6 namespace UnitTest { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
7 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
8 TestList::TestList() |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
9 : m_head(0) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
10 , m_tail(0) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
11 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
12 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
13 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
14 void TestList::Add(Test* test) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
15 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
16 if (m_tail == 0) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
17 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
18 assert(m_head == 0); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
19 m_head = test; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
20 m_tail = test; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
21 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
22 else |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
23 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
24 m_tail->next = test; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
25 m_tail = test; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
26 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
27 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
28 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
29 const Test* TestList::GetHead() const |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
30 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
31 return m_head; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
32 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
33 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
34 ListAdder::ListAdder(TestList& list, Test* test) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
35 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
36 list.Add(test); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
37 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
38 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
39 } |