Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

StackTest Class Reference

#include <StackTest.hh>

Inheritance diagram for StackTest:

ccunit::UnitTest ccunit::TestComponent List of all members.

Public Methods

 StackTest ()
void run_tests ()
 override this to actually run tests; call TestComponent::run() to execute tests. More...

void testBadSize ()
void testUnderflow ()
void testPopulate ()
void testOverflow ()
void testPop ()

Private Types

enum  { SIZE = 5 }

Private Attributes

Stack< int > stk

Member Enumeration Documentation

anonymous enum [private]
 

Enumeration values:
SIZE 

Definition at line 8 of file StackTest.hh.


Constructor & Destructor Documentation

StackTest::StackTest  
 

Definition at line 5 of file StackTest.cc.


Member Function Documentation

void StackTest::run_tests   [virtual]
 

override this to actually run tests; call TestComponent::run() to execute tests.

Implements ccunit::UnitTest.

Definition at line 12 of file StackTest.cc.

References testBadSize, testOverflow, testPop, testPopulate, and testUnderflow.

void StackTest::testBadSize  
 

Test:
Test for bad size (must be greater than zero).

Definition at line 25 of file StackTest.cc.

References _fail, and ccunit::UnitTest::_succeed.

Referenced by run_tests.

void StackTest::testOverflow  
 

Test:
Verify stack overflows are caught.

Definition at line 84 of file StackTest.cc.

References _fail, ccunit::UnitTest::_succeed, Stack< int >::push, SIZE, and stk.

Referenced by run_tests.

void StackTest::testPop  
 

Test:
Verify stack pop works correctly.

Definition at line 101 of file StackTest.cc.

References _test, Stack< int >::pop, Stack< int >::size, SIZE, and stk.

Referenced by run_tests.

void StackTest::testPopulate  
 

Test:
Verify stack grows correctly.

Definition at line 63 of file StackTest.cc.

References _fail, ccunit::UnitTest::_succeed, _test, Stack< int >::push, Stack< int >::size, SIZE, stk, and Stack< int >::top.

Referenced by run_tests.

void StackTest::testUnderflow  
 

Test:
Verify underflows are correctly caught

Definition at line 39 of file StackTest.cc.

References _fail, ccunit::UnitTest::_succeed, _test, Stack< int >::pop, Stack< int >::size, stk, and Stack< int >::top.

Referenced by run_tests.


Member Data Documentation

Stack<int> StackTest::stk [private]
 

Definition at line 9 of file StackTest.hh.

Referenced by testOverflow, testPop, testPopulate, and testUnderflow.


The documentation for this class was generated from the following files:
Generated on Tue Apr 2 15:33:25 2002 for libccunit by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002

Project hosted on sourceforge SourceForge Logo