?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  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.    void TestList::Add(Test* test)
  14.    {
  15.       if (m_tail == 0)
  16.       {
  17.          assert(m_head == 0);
  18.          m_head = test;
  19.          m_tail = test;
  20.       }
  21.       else
  22.       {
  23.          m_tail->m_nextTest = test;
  24.          m_tail = test;
  25.       }
  26.    }
  27.  
  28.    Test* TestList::GetHead() const
  29.    {
  30.       return m_head;
  31.    }
  32.  
  33.    ListAdder::ListAdder(TestList& list, Test* test)
  34.    {
  35.       list.Add(test);
  36.    }
  37.  
  38. }
  39.