C++ mpi module for stochmagnet_main Package
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
CORE_Test Class Reference

This class is a test class for core package. More...

#include <CORE_Test.h>

Inheritance diagram for CORE_Test:
Inheritance graph
[legend]
Collaboration diagram for CORE_Test:
Collaboration graph
[legend]

Public Member Functions

 CORE_Test (void)
 create
 
virtual ~CORE_Test (void)
 destroy
 
virtual tMemSize getMemorySize () const override
 return the memory size of the class More...
 
virtual tBoolean execute (const CORE_Run &runner, const CORE_OptionsList &options) const
 execute the tests More...
 
void setName (const tString &name)
 set the test name More...
 
const tString & getName () const
 get the test name More...
 
virtual tBoolean primaryTests (const CORE_Run &runner, const CORE_OptionsList &options) const
 execute the primary tests More...
 
virtual tBoolean elementaryTests (const CORE_Run &runner, const CORE_OptionsList &options) const
 execute the elementary tests More...
 
virtual tBoolean caseTests (const CORE_Run &runner, const CORE_OptionsList &options) const
 execute the case tests More...
 
- Public Member Functions inherited from CORE_Object
template<class T >
std::shared_ptr< T > getSharedPointer ()
 return the shared pointer for this More...
 
template<class T >
std::shared_ptr< const T > getConstSharedPointer () const
 return a const shared pointer for this More...
 
virtual tMemSize getContentsMemorySize () const
 return nthe memory size of the included associations More...
 
template<class T >
tBoolean isInstanceOf () const
 test if the clas T is an instance of this class More...
 
tString getClassName () const
 return the name of the class More...
 
tString getPointerString () const
 retrun the pointer of the class as a string More...
 
tString getIdentityString () const
 retrun the string identification of the class More...
 
virtual tString toString () const
 return the string representation of the object node More...
 

Static Public Member Functions

static CORE_UniquePointer< CORE_TestNew ()
 create a test class More...
 
- Static Public Member Functions inherited from CORE_Object
static tBoolean EnableMemoryStack (const tBoolean &isMemoryChecked)
 enable the memory stack More...
 
static void EnableMemoryStack ()
 enable the memory stack
 
static void DisableMemoryStack ()
 disable the memory stack
 
static tBoolean IsMemoryStackEnabled ()
 return trur if the memory stack is enabled
 
static tString MemoryStackToString ()
 get the memory stack in string More...
 
static tIndex GetRegisteredClassesNumber ()
 get the memory stack in string More...
 

Protected Member Functions

virtual void getSearchingPaths (std::vector< tString > &vpaths) const
 get the test path locations More...
 
tString getSearchingPathsToString () const
 get the test path locations into string More...
 
void getSearchingPaths (const tString &packageName, const tUSInt &nLevels, const std::vector< tString > &localPaths, std::vector< tString > &vpaths) const
 get the test path locations More...
 
tString searchPath (const tString &f) const
 retun the path where the file f is withing the searching paths list More...
 
tBoolean testCase (const CORE_Run &runner, const tString &name) const
 execute the test case More...
 
virtual tBoolean compareResults (const CORE_OptionsList &options, const tString &resultFile, const tString &referenceFile, const tReal &eps) const
 make the difference between the two files More...
 
tBoolean testArray (const CORE_Run &runner, const CORE_OptionsList &options) const
 test the numeric array More...
 
template<typename T , class I >
tBoolean uniformRandomTest (CORE_Array< T, I > &A, CORE_Array< T, I > &B) const
 randomizer test More...
 
tBoolean testField (const CORE_Run &runner, const CORE_OptionsList &options) const
 test the numeric field More...
 
template<typename T , class I >
requires functions_type::isArithmeticType< T > tBoolean testArray (CORE_Array< T, I > &A) const
 test array class More...
 
template<typename T , typename K , K D, class S , class I >
tBoolean testField (CORE_Field< T, K, D, S, I > &A) const
 test field class More...
 
- Protected Member Functions inherited from CORE_Object
 CORE_Object ()
 build an instance of the object
 
virtual ~CORE_Object ()
 destroy the instance of object std

 

Static Protected Member Functions

template<typename T , typename Q >
requires functions_type::isRealType< T > static functions_type::isRealType< Q > tBoolean Equals (const T &a, const Q &b)
 retrun true if the two values are equals More...
 
template<typename T , typename Q >
requires functions_type::isIntegerType< T > &&static functions_type::isIntegerType< Q > tBoolean Equals (const T &a, const Q &b)
 retrun true if the two values are equals More...
 

Detailed Description

This class is a test class for core package.

The main method is the CORE_test::test() method.

Author
Stephane Despreaux
Version
1.0

Member Function Documentation

◆ caseTests()

tBoolean CORE_Test::caseTests ( const CORE_Run runner,
const CORE_OptionsList options 
) const
virtual

execute the case tests

Parameters
[in]runnerthe runner of the tests
[in]optionsthe options of the program
Returns
true if the tests have succeeded

Reimplemented in MPI_Test.

◆ compareResults()

tBoolean CORE_Test::compareResults ( const CORE_OptionsList options,
const tString &  resultFile,
const tString &  referenceFile,
const tReal &  eps 
) const
protectedvirtual

make the difference between the two files

Parameters
[in]optionsoptons of the program
[in]resultFileresult file generated by the program
[in]referenceFilereference file
[in]epstolerated error
Returns
true if the difference between two file are les than eps

◆ elementaryTests()

tBoolean CORE_Test::elementaryTests ( const CORE_Run runner,
const CORE_OptionsList options 
) const
virtual

execute the elementary tests

Parameters
[in]runnerthe runner of the tests
[in]optionsthe options of the program
Returns
true if the tests have succeeded

Reimplemented in MPI_Test, and EXPR_Test.

◆ Equals() [1/2]

template<typename T , typename Q >
requires functions_type::isRealType<T> static functions_type::isRealType<Q> tBoolean CORE_Test::Equals ( const T &  a,
const Q &  b 
)
inlinestaticprotected

retrun true if the two values are equals

Template Parameters
T: type of a
Q: type of b
Parameters
[in]a: argument to compare
[in]b: argument to compare
Returns
true if a==b

◆ Equals() [2/2]

template<typename T , typename Q >
requires functions_type::isIntegerType<T>&& static functions_type::isIntegerType<Q> tBoolean CORE_Test::Equals ( const T &  a,
const Q &  b 
)
inlinestaticprotected

retrun true if the two values are equals

Template Parameters
T: type of a
Q: type of b
Parameters
[in]a: argument to compare
[in]b: argument to compare
Returns
true if a==b

◆ execute()

tBoolean CORE_Test::execute ( const CORE_Run runner,
const CORE_OptionsList options 
) const
virtual

execute the tests

Parameters
[in]runnerthe runner of the tests
[in]optionsthe options of the program

Reimplemented in OMP_Test, and MPI_Test.

◆ getMemorySize()

virtual tMemSize CORE_Test::getMemorySize ( ) const
inlineoverridevirtual

return the memory size of the class

Returns
the memory size of the class in bytes 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from CORE_Object.

◆ getName()

const tString& CORE_Test::getName ( ) const
inline

get the test name

Returns
name of the test

◆ getSearchingPaths() [1/2]

void CORE_Test::getSearchingPaths ( const tString &  packageName,
const tUSInt &  nLevels,
const std::vector< tString > &  localPaths,
std::vector< tString > &  vpaths 
) const
protected

get the test path locations

Parameters
[in]packageName: package name
[in]nLevels: the levels number
[in]localPaths: the local paths for test
[out]vpaths: the return path location

◆ getSearchingPaths() [2/2]

virtual void CORE_Test::getSearchingPaths ( std::vector< tString > &  vpaths) const
inlineprotectedvirtual

get the test path locations

Parameters
[out]vpaths: the return path location

Reimplemented in EXPR_Test.

◆ getSearchingPathsToString()

tString CORE_Test::getSearchingPathsToString ( ) const
protected

get the test path locations into string

Returns
all the sarching path in string

◆ New()

static CORE_UniquePointer<CORE_Test> CORE_Test::New ( )
inlinestatic

create a test class

Returns
a new instance of the class

◆ primaryTests()

tBoolean CORE_Test::primaryTests ( const CORE_Run runner,
const CORE_OptionsList options 
) const
virtual

execute the primary tests

Parameters
[in]runnerthe runner of the tests
[in]optionsthe options of the program
Returns
true if the tests have succeeded

Reimplemented in MPI_Test, and EXPR_Test.

◆ searchPath()

tString CORE_Test::searchPath ( const tString &  f) const
protected

retun the path where the file f is withing the searching paths list

Parameters
[in]f: file to search
Returns
the path form the current exceutable file where the file f is

◆ setName()

void CORE_Test::setName ( const tString &  name)
inline

set the test name

Parameters
[in]namename of the test

◆ testArray() [1/2]

tBoolean CORE_Test::testArray ( const CORE_Run runner,
const CORE_OptionsList options 
) const
protected

test the numeric array

Parameters
[in]runnerthe runner of the tests
[in]optionsthe options of the program

◆ testArray() [2/2]

template<typename T , class I >
requires functions_type::isArithmeticType< T > tBoolean CORE_Test::testArray ( CORE_Array< T, I > &  A) const
protected

test array class

Template Parameters
T: type of values of A
I: implemented class of A
Parameters
[in,out]A: array class
Returns
true if the test succeeded

◆ testCase()

tBoolean CORE_Test::testCase ( const CORE_Run runner,
const tString &  name 
) const
protected

execute the test case

Parameters
[in]runner: runner of the test
[in]namename of the case which must correspond the same local path
Returns
true if the tests have succeeded
  • reads the options file 'options.txt' within the local test case path with name 'name'
  • the current path becomes the path where the options file is
  • executes the program. If it fails return false
  • reads the tolerance error in 'eps' key value within options
  • reads the output path from 'output-path' key value within options
  • reads the reference path from 'reference-path' key value within options
  • reads the output file 'output-file' key value within options
  • reads the prefix from 'prefix' key value within options
  • make the difference betwen the result file and the refence file

◆ testField() [1/2]

tBoolean CORE_Test::testField ( const CORE_Run runner,
const CORE_OptionsList options 
) const
protected

test the numeric field

Parameters
[in]runnerthe runner of the tests
[in]optionsthe options of the program

◆ testField() [2/2]

template<typename T , typename K , K D, class S , class I >
tBoolean CORE_Test::testField ( CORE_Field< T, K, D, S, I > &  A) const
protected

test field class

Template Parameters
Q: type of values of A
K: type of dimension of A
D: dimension of A
S: storage type of class A
I: implemented class of A
Parameters
[in,out]A:field class
Returns
true if the test succeeded

◆ uniformRandomTest()

template<typename T , class I >
tBoolean CORE_Test::uniformRandomTest ( CORE_Array< T, I > &  A,
CORE_Array< T, I > &  B 
) const
protected

randomizer test

Parameters
[out]A: first array for testing
[out]B: second array for testing

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