Base class for testing actions. More...
Public Types | |
using | This_t = BaseAction< T > |
typedef TestManagerClass< T > | TestClass_t |
typedef TestClass_t::Data_t | Data_t |
type stored More... | |
typedef TestClass_t::Vector_t | Vector_t |
type of STL vector More... | |
typedef TestClass_t::SparseVector_t | SparseVector_t |
type of sparse vector More... | |
Public Member Functions | |
BaseAction () | |
BaseAction (int exp_err) | |
virtual | ~BaseAction () |
This_t & | set_expected_errors (int exp_err) |
void | describe (TestClass_t &tc, std::ostream &out) const |
Print a description of this action into the specified steam. More... | |
void | describe (TestClass_t &tc) const |
Print a description of this action in the test class stream. More... | |
std::string | description (TestClass_t &tc) const |
Returns a string with a description of this action. More... | |
void | operator() (Vector_t &v) const |
Action performed on a STL vector. More... | |
void | operator() (SparseVector_t &v) const |
Action performed on a sparse vector. More... | |
Public Attributes | |
int | expected_errors {0} |
number of errors expected for this action More... | |
Protected Types | |
using | v_citer_t = typename Vector_t::const_iterator |
Protected Member Functions | |
virtual void | doDescribe (TestClass_t &, std::ostream &out) const |
virtual void | actionOnVector (Vector_t &) const |
virtual void | actionOnSparseVector (SparseVector_t &) const |
Static Protected Member Functions | |
template<typename ITER > | |
static ITER | skipRange (ITER start, ITER const end) |
template<typename ITER > | |
static ITER | skipVoid (ITER start, ITER const end) |
template<typename ITER > | |
static ITER | rangeStart (ITER const begin, ITER last) |
template<typename ITER > | |
static ITER | voidStart (ITER const begin, ITER last) |
template<typename Vector > | |
static auto | findRangeBorders (Vector &v, std::size_t pos) |
template<typename ITER > | |
static ITER | findRangeStart (Vector_t const &v, std::size_t i, ITER start) |
Returns iterator to the first element of the i-th range after start. More... | |
template<typename ITER > | |
static ITER | findRangeStart (Vector_t const &v, std::size_t i) |
template<typename ITER > | |
static ITER | findVoidStart (Vector_t const &v, std::size_t i, ITER start) |
static bool | isVoid (Data_t value) |
Base class for testing actions.
T | the type stored in the containers |
An action class performs a definite action on both a STL vector (Vector_t) and on a sparse_vector (SparseVector_t). The interface includes:
Definition at line 75 of file sparse_vector_test.cc.
typedef TestClass_t::Data_t actions::BaseAction< T >::Data_t |
type stored
Definition at line 278 of file sparse_vector_test.cc.
typedef TestClass_t::SparseVector_t actions::BaseAction< T >::SparseVector_t |
type of sparse vector
Definition at line 280 of file sparse_vector_test.cc.
typedef TestManagerClass<T> actions::BaseAction< T >::TestClass_t |
Definition at line 277 of file sparse_vector_test.cc.
using actions::BaseAction< T >::This_t = BaseAction<T> |
Definition at line 276 of file sparse_vector_test.cc.
|
protected |
Definition at line 311 of file sparse_vector_test.cc.
typedef TestClass_t::Vector_t actions::BaseAction< T >::Vector_t |
type of STL vector
Definition at line 279 of file sparse_vector_test.cc.
|
inline |
Definition at line 285 of file sparse_vector_test.cc.
|
inline |
Definition at line 286 of file sparse_vector_test.cc.
|
inlinevirtual |
Definition at line 288 of file sparse_vector_test.cc.
|
inlineprotectedvirtual |
Reimplemented in actions::Optimize< T >, actions::FlipSign< T >, actions::SetValue< T >, actions::PushBack< T >, actions::UnsetElement< T >, actions::SetElement< T >, actions::ScaleAll< T >, actions::Scale< T >, actions::EraseRangeAt< T >, actions::Erase< T >, actions::Add< T >, actions::Insert< T >, actions::AssignMove< T >, actions::Assign< T >, actions::ResizeWith< T >, actions::Resize< T >, actions::Clear< T >, actions::PrintNonVoid< T >, actions::PrintRange< T >, actions::PrintSparseVector< T >, and actions::Print< T >.
Definition at line 317 of file sparse_vector_test.cc.
|
inlineprotectedvirtual |
Reimplemented in actions::FailTest< T >, actions::FlipSign< T >, actions::SetValue< T >, actions::PushBack< T >, actions::UnsetElement< T >, actions::SetElement< T >, actions::ScaleAll< T >, actions::Scale< T >, actions::EraseRangeAt< T >, actions::Erase< T >, actions::Add< T >, actions::Insert< T >, actions::AssignMove< T >, actions::Assign< T >, actions::ResizeWith< T >, actions::Resize< T >, actions::Clear< T >, actions::PrintNonVoid< T >, and actions::Print< T >.
Definition at line 316 of file sparse_vector_test.cc.
|
inline |
Print a description of this action into the specified steam.
Definition at line 294 of file sparse_vector_test.cc.
|
inline |
Print a description of this action in the test class stream.
Definition at line 298 of file sparse_vector_test.cc.
|
inline |
Returns a string with a description of this action.
Definition at line 301 of file sparse_vector_test.cc.
|
inlineprotectedvirtual |
Reimplemented in actions::FailTest< T >, actions::Optimize< T >, actions::FlipSign< T >, actions::SetValue< T >, actions::PushBack< T >, actions::UnsetElement< T >, actions::SetElement< T >, actions::ScaleAll< T >, actions::Scale< T >, actions::EraseRangeAt< T >, actions::Erase< T >, actions::Add< T >, actions::Insert< T >, actions::AssignMove< T >, actions::Assign< T >, actions::ResizeWith< T >, actions::Truncate< T >, actions::Resize< T >, actions::Clear< T >, actions::PrintNonVoid< T >, actions::PrintRange< T >, actions::PrintSparseVector< T >, and actions::Print< T >.
Definition at line 313 of file sparse_vector_test.cc.
|
inlinestaticprotected |
Definition at line 328 of file sparse_vector_test.cc.
|
staticprotected |
Returns iterator to the first element of the i-th range after start.
Definition at line 1070 of file sparse_vector_test.cc.
|
inlinestaticprotected |
Definition at line 343 of file sparse_vector_test.cc.
|
staticprotected |
Returns iterator to the first void element of the i-th void area after start.
Definition at line 1086 of file sparse_vector_test.cc.
|
inlinestaticprotected |
Definition at line 351 of file sparse_vector_test.cc.
|
inline |
Action performed on a STL vector.
Definition at line 305 of file sparse_vector_test.cc.
|
inline |
Action performed on a sparse vector.
Definition at line 308 of file sparse_vector_test.cc.
|
staticprotected |
Definition at line 1051 of file sparse_vector_test.cc.
|
inline |
Definition at line 290 of file sparse_vector_test.cc.
|
staticprotected |
Definition at line 1036 of file sparse_vector_test.cc.
|
staticprotected |
Definition at line 1043 of file sparse_vector_test.cc.
|
staticprotected |
Definition at line 1060 of file sparse_vector_test.cc.
int actions::BaseAction< T >::expected_errors {0} |
number of errors expected for this action
Definition at line 283 of file sparse_vector_test.cc.