CSCE 221-(507-509)
Programing Assignment 2
Overview MySTL Testing Todos
 All Classes Namespaces Files Functions Variables Typedefs Friends Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions
map_test Class Reference

Testing of map. More...

Public Member Functions

bool run ()
 Run Unit test's setup, test, and teardown functions. More...
 

Protected Member Functions

void test ()
 Test data. More...
 
virtual void setup ()
 Setup data to be tested. More...
 
virtual void tear_down ()
 Teardown data which was tested. More...
 
bool all_tests_passed () const
 
void assert_msg (bool b, std::string msg)
 Assert a unit test passes. More...
 

Private Member Functions

void setup_dummy_map (map< int, string > &m)
 Setup map of integers to strings. More...
 
void test_default_constructor ()
 Test default constructor generates map of size 0. More...
 
void test_element_access_operator_exists ()
 Test element access operator when element exists. More...
 
void test_element_access_operator_not_exists ()
 Test element access operator when element does not exist. More...
 
void test_element_access_at_exists ()
 Test element access at when element exists. More...
 
void test_element_access_at_not_exists ()
 Test element access at when element does not exist, ensure this function will throw an error. More...
 
void test_find_exists ()
 Test find when element exists. More...
 
void test_find_not_exists ()
 Test find when element does not exist. More...
 
void test_count_exists ()
 Test count when element exists. More...
 
void test_count_not_exists ()
 Test count when element does not exist. More...
 
void test_insert_exists ()
 Test insertion when element is already in map. More...
 
void test_insert_not_exists ()
 Test insertion when element is not already in map. More...
 
void test_erase_iterator ()
 Test erase with an iterator. More...
 
void test_erase_key ()
 Test erase with a key. More...
 
void test_copy_constructor ()
 Test copy constuction. More...
 
void test_copy_assign ()
 Test copy assignment. More...
 

Detailed Description

Testing of map.

Member Function Documentation

void map_test::test ( )
protectedvirtual

Test data.

Implements test_class.

void map_test::setup_dummy_map ( map< int, string > &  m)
private

Setup map of integers to strings.

void map_test::test_default_constructor ( )
private

Test default constructor generates map of size 0.

void map_test::test_element_access_operator_exists ( )
private

Test element access operator when element exists.

void map_test::test_element_access_operator_not_exists ( )
private

Test element access operator when element does not exist.

void map_test::test_element_access_at_exists ( )
private

Test element access at when element exists.

void map_test::test_element_access_at_not_exists ( )
private

Test element access at when element does not exist, ensure this function will throw an error.

void map_test::test_find_exists ( )
private

Test find when element exists.

void map_test::test_find_not_exists ( )
private

Test find when element does not exist.

void map_test::test_count_exists ( )
private

Test count when element exists.

void map_test::test_count_not_exists ( )
private

Test count when element does not exist.

void map_test::test_insert_exists ( )
private

Test insertion when element is already in map.

void map_test::test_insert_not_exists ( )
private

Test insertion when element is not already in map.

void map_test::test_erase_iterator ( )
private

Test erase with an iterator.

void map_test::test_erase_key ( )
private

Test erase with a key.

void map_test::test_copy_constructor ( )
private

Test copy constuction.

void map_test::test_copy_assign ( )
private

Test copy assignment.

bool test_class::run ( )
inherited

Run Unit test's setup, test, and teardown functions.

Returns
Passed test or not
virtual void test_class::setup ( )
protectedvirtualinherited

Setup data to be tested.

virtual void test_class::tear_down ( )
protectedvirtualinherited

Teardown data which was tested.

bool test_class::all_tests_passed ( ) const
protectedinherited
Returns
All asserts have passed
void test_class::assert_msg ( bool  b,
std::string  msg 
)
protectedinherited

Assert a unit test passes.

Parameters
bConditional for assert
msgMessage on fail

The documentation for this class was generated from the following file: