Mercurial > fife-parpg
comparison ext/UnitTest++/src/tests/TestTestList.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 "../UnitTest++.h" | |
2 #include "../TestList.h" | |
3 | |
4 using namespace UnitTest; | |
5 | |
6 namespace { | |
7 | |
8 | |
9 TEST (TestListIsEmptyByDefault) | |
10 { | |
11 TestList list; | |
12 CHECK (list.GetHead() == 0); | |
13 } | |
14 | |
15 TEST (AddingTestSetsHeadToTest) | |
16 { | |
17 Test test("test"); | |
18 TestList list; | |
19 list.Add(&test); | |
20 | |
21 CHECK (list.GetHead() == &test); | |
22 CHECK (test.next == 0); | |
23 } | |
24 | |
25 TEST (AddingSecondTestAddsItToEndOfList) | |
26 { | |
27 Test test1("test1"); | |
28 Test test2("test2"); | |
29 | |
30 TestList list; | |
31 list.Add(&test1); | |
32 list.Add(&test2); | |
33 | |
34 CHECK (list.GetHead() == &test1); | |
35 CHECK (test1.next == &test2); | |
36 CHECK (test2.next == 0); | |
37 } | |
38 | |
39 TEST (ListAdderAddsTestToList) | |
40 { | |
41 TestList list; | |
42 | |
43 Test test(""); | |
44 ListAdder adder(list, &test); | |
45 | |
46 CHECK (list.GetHead() == &test); | |
47 CHECK (test.next == 0); | |
48 } | |
49 | |
50 } |