C++ main module for stochmagnet Package
1.0
|
This class is a Test class for Stoch Microm package. More...
#include <CORE_Test.h>
Public Member Functions | |
CORE_Test (void) | |
create More... | |
virtual | ~CORE_Test (void) |
destroy More... | |
virtual tMemSize | getMemorySize () const override |
return the memory size of the class More... | |
virtual tBoolean | execute (const CORE_Run &runner, const std::map< tString, tString > &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 std::map< tString, tString > &options) const |
execute the primary tests More... | |
virtual tBoolean | elementaryTests (const CORE_Run &runner, const std::map< tString, tString > &options) const |
execute the elementary tests More... | |
virtual tBoolean | caseTests (const CORE_Run &runner, const std::map< tString, tString > &options) const |
execute the case tests More... | |
template<typename T , class I > | |
requires core_functions::isArithmeticType< T > tBoolean | testArray (CORE_Array< T, I > &A) const |
template<typename T , typename K , K D, class S , class I > | |
tBoolean | testField (CORE_Field< T, K, D, S, I > &A) const |
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_Test > | New () |
create a test class @retrun a new instance of the class More... | |
static tBoolean | EnableMemoryStack (const tBoolean &isMemoryChecked) |
enable the memory stack More... | |
static void | EnableMemoryStack () |
enable the memory stack More... | |
static void | DisableMemoryStack () |
disable the memory stack More... | |
static tBoolean | IsMemoryStackEnabled () |
return trur if the memory stack is enabled More... | |
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 std::map< tString, tString > &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 std::map< tString, tString > &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 std::map< tString, tString > &options) const |
test the numeric field More... | |
template<typename Q , class I > | |
requires core_functions::isArithmeticType< Q > tBoolean | testArray (CORE_Array< Q, I > &A) const |
template<typename Q , typename K , K D, class S , class I > | |
tBoolean | testField (CORE_Field< Q, K, D, S, I > &A) const |
Static Protected Member Functions | |
template<typename T , typename Q > | |
requires core_functions::isRealType< T > static core_functions::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 core_functions::isIntegerType< T > &&static core_functions::isIntegerType< Q > tBoolean | Equals (const T &a, const Q &b) |
Private Member Functions | |
tBoolean | testTypes (const CORE_Run &runner, const std::map< tString, tString > &options) const |
test type More... | |
tBoolean | testIO (const CORE_Run &runner, const std::map< tString, tString > &options) const |
test IO class More... | |
tBoolean | testChrono (const CORE_Run &runner, const std::map< tString, tString > &options) const |
test Chrono class More... | |
tBoolean | testMemorySize (const CORE_Run &runner, const std::map< tString, tString > &options) |
test memory size More... | |
tBoolean | testStringsList (const CORE_Run &runner, const std::map< tString, tString > &options) const |
test the string array More... | |
tBoolean | testLoops (const CORE_Run &runner, const std::map< tString, tString > &options) const |
test the string array More... | |
template<class T > | |
std::shared_ptr< T > | setThis (std::unique_ptr< T, CORE_Object::Delete > &up) |
set the shared pointer from an unique pointer More... | |
Private Attributes | |
tString | mName |
std::weak_ptr< CORE_Object > | mThis |
Static Private Attributes | |
static const tFlag | ALL_TESTS =0 |
static const tFlag | PRIMARY_TESTS =1 |
static const tFlag | ELEMENTARY_TESTS =2 |
static const tFlag | CASE_TESTS =3 |
This class is a Test class for Stoch Microm package.
This class is a test class for core package.
The main method is the CORE_test::test() method.
CORE_Test::CORE_Test | ( | void | ) |
|
virtual |
destroy
|
protectedvirtual |
make the difference between the two files
[in] | options | optons of the program |
[in] | resultFile | result file generated by the program |
[in] | referenceFile | reference file |
[in] | eps | tolerated error |
Referenced by testCase().
|
inlinestaticinherited |
disable the memory stack
Referenced by CORE_Object::EnableMemoryStack().
|
inlinestaticinherited |
enable the memory stack
Referenced by CORE_Object::EnableMemoryStack(), and CORE_Run::SetDebugOptions().
|
inlinestaticinherited |
enable the memory stack
[in] | isMemoryChecked | : true to verify memory allocation of CORE_Object classes |
References CORE_Object::DisableMemoryStack(), CORE_Object::EnableMemoryStack(), and CORE_Object::IsMemoryStackEnabled().
|
inlinestaticprotected |
retrun true if the two values are equals
[in] | a | : argument to compare |
[in] | b | : argument to compare |
Referenced by testArray(), and testField().
|
inlinestaticprotected |
|
virtual |
execute the tests
[in] | runner | the runner of the tests |
[in] | options | the options of the program |
References ALL_TESTS, CASE_TESTS, caseTests(), ELEMENTARY_TESTS, elementaryTests(), CORE_Run::Out(), PRIMARY_TESTS, primaryTests(), tBoolean, testCase(), tFlag, and tString.
Referenced by CORE_Run::makeTests(), and SM_Run::makeTests().
|
inlineinherited |
return the name of the class
Referenced by CORE_Object::getIdentityString(), and testTypes().
|
inlineinherited |
return a const shared pointer for this
References CORE_Object::mThis.
|
inlinevirtualinherited |
return nthe memory size of the included associations
Reimplemented in CORE_VectorList< T, I >, CORE_VectorList< tString, CORE_StringsList >, CORE_ValArray< T, I >, CORE_ValArray< T, CORE_StdValArray< T > >, CORE_Run, CORE_PtrArray< T, I >, CORE_PtrArray< T, CORE_StdPtrArray< T > >, CORE_Field< T, K, D, S, I >, CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >, CORE_Field< T, K, D, CORE_StdValArray< T >, CORE_StdValField< T, K, D > >, CORE_ClassFactory, SMS_STDUniformFunction, SMS_STDNormalFunction, SMS_BoostUniformFunction, SMS_BoostNormalFunction, SM_ZeemanOperator, SM_XDMF, SM_VTK, SM_System, SM_Output, SM_Operator, SM_Network, SM_DemagnetizedOperator, SM_Beam, CORE_StringsList, and CORE_Out.
Referenced by CORE_Out::getContentsMemorySize(), SM_Beam::getContentsMemorySize(), SM_Network::getContentsMemorySize(), SM_Operator::getContentsMemorySize(), SM_Output::getContentsMemorySize(), SM_System::getContentsMemorySize(), SM_VTK::getContentsMemorySize(), SMS_BoostNormalFunction::getContentsMemorySize(), SMS_BoostUniformFunction::getContentsMemorySize(), SMS_STDNormalFunction::getContentsMemorySize(), SMS_STDUniformFunction::getContentsMemorySize(), CORE_ClassFactory::getContentsMemorySize(), CORE_PtrArray< T, I >::getContentsMemorySize(), CORE_ValArray< T, I >::getContentsMemorySize(), CORE_VectorList< T, I >::getContentsMemorySize(), CORE_Object::getMemorySize(), SM_ConstantNoiseRateFunction::getMemorySize(), SM_InverseNoiseRateFunction::getMemorySize(), SM_LandauLifschitzFunction::getMemorySize(), SM_NoiseRateFunction::getMemorySize(), SM_Object::getMemorySize(), SM_StochasticFunction::getMemorySize(), SM_TemplatedNoiseRateFunction< DerivedClass >::getMemorySize(), SM_TimeStepper::getMemorySize(), SMS_BoostRandomFunction::getMemorySize(), CORE_Array< T, I >::getMemorySize(), CORE_Chrono::getMemorySize(), CORE_Collection< T, I >::getMemorySize(), CORE_IO::getMemorySize(), CORE_List< T, K, I >::getMemorySize(), CORE_OptionsReader::getMemorySize(), CORE_OutputFile::getMemorySize(), and getMemorySize().
|
inlineinherited |
retrun the string identification of the class
References CORE_Object::getClassName(), and core_functions::pointerToString().
Referenced by testArray(), testField(), testTypes(), CORE_Object::toString(), CORE_ClassFactory::toString(), and CORE_Field< T, K, D, S, I >::toString().
|
inlineoverridevirtual |
return the memory size of the class
Reimplemented from CORE_Object.
References CORE_Object::getContentsMemorySize().
|
inline |
|
inlineinherited |
retrun the pointer of the class as a string
References core_functions::pointerToString().
|
inlinestaticinherited |
get the memory stack in string
|
inlineprotectedvirtual |
get the test path locations
[out] | vpaths | : the return path location |
Reimplemented in SM_Test.
Referenced by SM_Test::getSearchingPaths(), getSearchingPathsToString(), and searchPath().
|
protected |
get the test path locations into string
References getSearchingPaths().
Referenced by testCase(), and testIO().
|
inlineinherited |
return the shared pointer for this
References CORE_Object::mThis.
|
inlineinherited |
test if the clas T is an instance of this class
Referenced by SM_Beam::templatedSimulate().
|
inlinestaticinherited |
return trur if the memory stack is enabled
Referenced by CORE_Object::EnableMemoryStack(), and main().
|
inlinestaticinherited |
get the memory stack in string
Referenced by main().
|
inlinestatic |
create a test class @retrun a new instance of the class
References CORE_Test().
|
virtual |
execute the primary tests
[in] | runner | the runner of the tests |
[in] | options | the options of the program |
Reimplemented in SM_Test.
References CORE_Run::InitSeed(), CORE_Run::Out(), tBoolean, testArray(), testChrono(), testField(), testIO(), testLoops(), testStringsList(), and testTypes().
Referenced by execute().
retun the path where the file f is withing the searching paths list
[in] | f | : file to search |
References getSearchingPaths().
Referenced by SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), testCase(), and testIO().
|
inline |
|
inlineprivateinherited |
set the shared pointer from an unique pointer
[in,out] | up | unique pointer of the class at input, points to null pointer at output |
Method only calledby the friend class CORE_ClassFactory::NewSharedInstance()
References CORE_Object::mThis.
|
protected |
test the numeric array
[in] | runner | the runner of the tests |
[in] | options | the options of the program |
References tBoolean.
Referenced by primaryTests().
|
protected |
requires core_functions::isArithmeticType<T> tBoolean CORE_Test::testArray | ( | CORE_Array< T, I > & | A | ) | const |
References CORE_Array< T, I >::axpy(), CORE_Collection< T, I >::cbegin(), CORE_Collection< T, I >::cend(), CORE_Chrono::ConvertDuration(), CORE_Array< T, I >::copy(), CORE_Object::CORE_Object(), Equals(), CORE_Array< T, I >::get(), CORE_ValArray< T, I >::getArray(), CORE_Object::getIdentityString(), CORE_Array< T, I >::getMemorySize(), CORE_Collection< T, I >::getSize(), CORE_ValArray< T, I >::getSize(), CORE_Array< T, I >::l2Distance(), CORE_Array< T, I >::linfDistance(), CORE_Array< T, I >::prod(), CORE_Collection< T, I >::setSize(), CORE_Chrono::start(), CORE_Chrono::stop(), CORE_Array< T, I >::sum(), CORE_Array< T, I >::swap(), tBoolean, tIndex, tInteger, tMemSize, CORE_StdValArray< T >::transform(), tReal, tULLInt, and CORE_Array< T, I >::uniformRandomize().
execute the test case
[in] | runner | : runner of the test |
[in] | name | name of the case which must correspond the same local path |
References compareResults(), getSearchingPathsToString(), CORE_Run::makeRun(), CORE_Run::Out(), CORE_OptionsReader::ReadOptions(), CORE_OptionsReader::ReadPath(), searchPath(), CORE_Run::SetDebugOptions(), CORE_Run::SetOutputOptions(), tBoolean, tReal, and tString.
Referenced by execute().
|
private |
test Chrono class
[in] | runner | the runner of the tests |
[in] | options | the options of the program |
References CORE_Chrono::ConvertDuration(), CORE_Chrono::start(), CORE_Chrono::stop(), tIndex, tReal, tUInt, tUSInt, and CORE_StdValArray< T >::UniformRandomize().
Referenced by primaryTests().
|
protected |
test the numeric field
[in] | runner | the runner of the tests |
[in] | options | the options of the program |
References tBoolean.
Referenced by primaryTests().
|
protected |
tBoolean CORE_Test::testField | ( | CORE_Field< T, K, D, S, I > & | A | ) | const |
References CORE_Field< T, K, D, S, I >::axpy(), CORE_Chrono::ConvertDuration(), CORE_Field< T, K, D, S, I >::copy(), CORE_Field< T, K, D, S, I >::elementsTransform(), Equals(), CORE_Field< T, K, D, S, I >::getElementsNumber(), CORE_Object::getIdentityString(), CORE_Field< T, K, D, S, I >::getSize(), CORE_ValArray< T, I >::getSize(), CORE_Field< T, K, D, S, I >::initialize(), CORE_Field< T, K, D, S, I >::isNANContained(), CORE_Field< T, K, D, S, I >::mod2(), CORE_Field< T, K, D, S, I >::normalize(), CORE_StdPtrArray< T >::Normalize(), CORE_Field< T, K, D, S, I >::scalarProduct(), CORE_Field< T, K, D, S, I >::setElementsNumber(), CORE_Field< T, K, D, S, I >::setSize(), CORE_Chrono::start(), CORE_Chrono::stop(), CORE_StdValArray< T >::sum(), tBoolean, tIndex, tInteger, CORE_StdValArray< T >::transform(), tReal, tULLInt, and CORE_Field< T, K, D, S, I >::uniformRandomize().
|
private |
test IO class
[in] | runner | the runner of the tests |
[in] | options | the options of the program |
References CORE_IO::CreatePath(), CORE_IO::GetBaseName(), CORE_IO::GetExtension(), CORE_IO::GetFiles(), CORE_IO::GetPath(), CORE_IO::GetPaths(), getSearchingPathsToString(), CORE_Run::Out(), CORE_IO::RemovePath(), searchPath(), tBoolean, and tString.
Referenced by primaryTests().
|
private |
test the string array
[in] | runner | the runner of the tests |
[in] | options | the options of the program |
References CORE_Chrono::ConvertDuration(), CORE_Chrono::start(), CORE_Chrono::stop(), tIndex, tReal, tULLInt, and CORE_StdValArray< T >::UniformRandomize().
Referenced by primaryTests().
|
private |
test memory size
[in] | runner | the runner of the tests |
[in] | options | the options of the program |
References CORE_Object::CORE_Object(), CORE_Run::Out(), tFlag, tString, and tUCInt.
|
private |
test the string array
[in] | runner | the runner of the tests |
[in] | options | the options of the program |
References CORE_VectorList< T, I >::getSize(), CORE_List< T, K, I >::sort(), tBoolean, and tIndex.
Referenced by primaryTests().
|
private |
test type
[in] | runner | the runner of the tests |
[in] | options | the options of the program |
References CORE_Object::getClassName(), CORE_Object::getIdentityString(), CORE_Run::Is32Architecture(), CORE_Run::Is64Architecture(), core_functions::max(), core_functions::min(), CORE_Run::Out(), tBoolean, tChar, tComplex, tDouble, tFlag, tFloat, tIndex, tInt, tInteger, tLDouble, tLInt, tLLInt, tMemSize, tReal, tRelativeIndex, tRelativeInteger, tSInt, tString, tUChar, tUInt, tULInt, tULLInt, and tUSInt.
Referenced by primaryTests().
|
inlinevirtualinherited |
return the string representation of the object node
Reimplemented in SM_TimeStepper, SM_System, SM_StochasticFunction, SM_Network, SM_LandauLifschitzFunction, SM_Beam, CORE_Field< T, K, D, S, I >, CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >, CORE_Field< T, K, D, CORE_StdValArray< T >, CORE_StdValField< T, K, D > >, CORE_Collection< T, I >, CORE_ClassFactory, and SM_NoiseRateFunction.
References CORE_Object::getIdentityString().
Referenced by SM_Run::run(), CORE_Collection< T, I >::toString(), SM_Beam::toString(), SM_Network::toString(), SM_StochasticFunction::toString(), SM_System::toString(), and SM_TimeStepper::toString().
|
protected |
randomizer test
[out] | A | : first array for testing |
[out] | B | : second array for testing |
References CORE_Chrono::ConvertDuration(), CORE_Collection< T, I >::setSize(), CORE_Chrono::start(), CORE_Chrono::stop(), CORE_Array< T, I >::sum(), tBoolean, tIndex, CORE_Array< T, I >::transform(), tReal, tULLInt, and CORE_Array< T, I >::uniformRandomize().
|
private |
Referenced by CORE_Test(), getName(), and setName().
|
privateinherited |
Referenced by CORE_Object::getConstSharedPointer(), CORE_Object::getSharedPointer(), and CORE_Object::setThis().