root/library/tests/unittest-cpp/TestList.cpp @ 434

Revision 418, 491 bytes (checked in by vbarta, 15 years ago)

#27: added UnitTest?++ to bdm sources, changed test_user_data to use it

Line 
1#include "TestList.h"
2#include "Test.h"
3
4#include <cassert>
5
6namespace UnitTest {
7
8TestList::TestList() 
9    : m_head(0)
10    , m_tail(0)
11{
12}
13
14void 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
29Test* TestList::GetHead() const
30{
31    return m_head;
32}
33
34ListAdder::ListAdder(TestList& list, Test* test)
35{
36    list.Add(test);
37}
38
39}
Note: See TracBrowser for help on using the browser.