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

Revision 706, 449 bytes (checked in by smidl, 15 years ago)

eol-native

  • Property svn:eol-style set to native
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
13void TestList::Add ( Test* test ) {
14        if ( m_tail == 0 ) {
15                assert ( m_head == 0 );
16                m_head = test;
17                m_tail = test;
18        } else {
19                m_tail->next = test;
20                m_tail = test;
21        }
22}
23
24Test* TestList::GetHead() const {
25        return m_head;
26}
27
28ListAdder::ListAdder ( TestList& list, Test* test ) {
29        list.Add ( test );
30}
31
32}
Note: See TracBrowser for help on using the browser.