Teuchos Package Browser (Single Doxygen Collection) Version of the Day
Namespaces | Defines | Typedefs | Functions | Variables
Dependencies_SerializationTests.cpp File Reference
#include "Teuchos_VerboseObject.hpp"
#include "Teuchos_XMLParameterListCoreHelpers.hpp"
#include "Teuchos_StandardDependencies.hpp"
#include "Teuchos_DependencySheet.hpp"
#include "Teuchos_StandardConditions.hpp"
#include "Teuchos_UnitTestHarness.hpp"
#include "Teuchos_DependencyXMLConverterDB.hpp"
#include "Teuchos_StandardDependencyXMLConverters.hpp"
#include "Teuchos_ParameterList.hpp"
#include "Teuchos_XMLParameterListTestHelpers.hpp"
Include dependency graph for Dependencies_SerializationTests.cpp:

Go to the source code of this file.

Namespaces

namespace  Teuchos

Defines

#define BASIC_DEPENDENCY_TEST(DEPENDENCY, DEPTYPE,NUM_DEPENDEES, NUM_DEPENDENTS)
#define VERIFY_DEPENDENT(DEPENDENCY, DEPENDENT)
#define VERIFY_DEPENDEE(DEPENDENCY, DEPENDEE)
#define CREATE_DEPENDEE(POSTFIX, VALUE)
#define CREATE_DEPENDENT(POSTFIX, VALUE)
#define EXCEPTION_TEST_BOILERPLATE(DEPENDEE_VAL, DEPENDENT_VAL)
#define CONVERT_DEP_TO_XML(DEPENDENCY)
#define TOO_MANY_DEPENDEE_TEST(DEPENDENCY)
#define COPY_DEPTAG_WITHOUT_CHILD(TAG, CHILDTAG, NEWTAG)
#define INSERT_VALIDATOR_TO_MAPS(VALIDATOR)
#define NUMBER_VIS_TEST(T)
#define ArrayModifierTest(DEPENDENCYTYPE, ARRAY_TYPE)
#define NUM_ARRAY_LENGTH_TEST(DependeeType, DependentType)
#define NUM_ARRAY_LENGTH_TEST_GROUP(DependeeType)
#define TWODROW_TEST(DependeeType, DependentType)
#define TWODROW_TEST_GROUP(DependeeType)
#define TWODCOL_TEST(DependeeType, DependentType)
#define TWODCOL_TEST_GROUP(DependeeType)
#define RANGE_VALIDATOR_TEST(T)

Typedefs

typedef std::string Teuchos::myString_t

Functions

 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, SerializationTestMacros)
 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, StringVisualDepSerialization)
 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, BoolVisualDepSerialization)
 Teuchos::TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL (Teuchos_Dependencies, NumberVisualDepSerialization, T)
 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, ConditionVisualDepSerialization)
 Teuchos::ArrayModifierTest (NumberArrayLengthDependency, Array) ArrayModifierTest(TwoDRowDependency
 Teuchos::ArrayModifierTest (TwoDColDependency, TwoDArray) TEUCHOS_UNIT_TEST(Teuchos_Dependencies
myDepList Teuchos::set (dependee1,"val1")
myDepList Teuchos::set (dependee2,"val2")
myDepList Teuchos::set (dependent1, 2.0)
myDepList Teuchos::set (dependent2, 3.0)
dependentList Teuchos::insert (myDepList.getEntryRCP(dependent1))
dependentList Teuchos::insert (myDepList.getEntryRCP(dependent2))
myDepSheet Teuchos::addDependency (basicStringValiDep)
myDepSheet Teuchos::addDependency (complexStringValiDep)
 Teuchos::BASIC_DEPENDENCY_TEST (readinDep1, StringValidatorDependency, 1, 1)
 Teuchos::VERIFY_DEPENDEE (readinDep1, readinDependee1)
 Teuchos::VERIFY_DEPENDENT (readinDep1, readinDependent1)
 Teuchos::BASIC_DEPENDENCY_TEST (readinDep2, StringValidatorDependency, 1, 2)
 Teuchos::VERIFY_DEPENDEE (readinDep2, readinDependee2)
 Teuchos::VERIFY_DEPENDENT (readinDep2, readinDependent1)
 Teuchos::VERIFY_DEPENDENT (readinDep2, readinDependent2)
 Teuchos::TEST_ASSERT (castedDep1->getValuesAndValidators().size()==2)
 Teuchos::TEST_ASSERT (castedDep2->getValuesAndValidators().size()==2)
 Teuchos::TEST_ASSERT (castedDep1->getDefaultValidator().is_null())
 Teuchos::TEST_ASSERT (nonnull(castedDep2->getDefaultValidator()))
 Teuchos::TEST_EQUALITY (rcp_dynamic_cast< const EnhancedNumberValidator< double > >(castedDep1->getValuesAndValidators().find("val1")->second, true)->getMax(), double1Vali->getMax())
 Teuchos::TEST_EQUALITY (rcp_dynamic_cast< const EnhancedNumberValidator< double > >(castedDep2->getValuesAndValidators().find("val1")->second, true)->getMax(), double1Vali->getMax())
 Teuchos::TEST_EQUALITY (rcp_dynamic_cast< const EnhancedNumberValidator< double > >(castedDep1->getValuesAndValidators().find("val2")->second, true)->getMax(), double2Vali->getMax())
 Teuchos::TEST_EQUALITY (rcp_dynamic_cast< const EnhancedNumberValidator< double > >(castedDep2->getValuesAndValidators().find("val2")->second, true)->getMax(), double2Vali->getMax())
 Teuchos::TEST_EQUALITY (rcp_dynamic_cast< const EnhancedNumberValidator< double > >(castedDep2->getDefaultValidator(), true)->getMax(), defaultVali->getMax())
 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, BoolValidatorDepSerialization)
 Teuchos::TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL (Teuchos_Dependencies, RangeValidatorDepSerialization, T)
 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, DependencySerializationExceptions)
 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, NumberVisualDepSerializationExceptions)
 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, BoolVisualDepSerializationExceptions)
 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, StringVisualDepSerializationExceptions)
 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, ConditionVisualDepSerializationExceptions)
 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, BoolValidatorDepSerializationExceptions)
 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, StringValidatorDepSerializationExceptions)
 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, RangeValidatorDepSerializationExceptions)
 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, NumArrayLengthDepSerializationExceptions)
 Teuchos::TEUCHOS_UNIT_TEST (Teuchos_Dependencies, DepSheetTests)

Variables

StringValidatorDepSerialization
std::string 
Teuchos::dependee1 = "string param"
std::string Teuchos::dependee2 = "string param2"
std::string Teuchos::dependent1 = "dependent param1"
std::string Teuchos::dependent2 = "dependent param2"
ParameterList Teuchos::myDepList ("String Vali Dep List")
RCP< DependencySheet > Teuchos::myDepSheet = rcp(new DependencySheet)
RCP< EnhancedNumberValidator
< double > > 
Teuchos::double1Vali
RCP< EnhancedNumberValidator
< double > > 
Teuchos::double2Vali
RCP< EnhancedNumberValidator
< double > > 
Teuchos::defaultVali
StringValidatorDependency::ValueToValidatorMap Teuchos::valuesAndValidators = double1Vali
RCP< StringValidatorDependency > Teuchos::basicStringValiDep
Dependency::ParameterEntryList Teuchos::dependentList
RCP< StringValidatorDependency > Teuchos::complexStringValiDep
RCP< DependencySheet > Teuchos::readInDepSheet = rcp(new DependencySheet)
XMLParameterListWriter Teuchos::plWriter
XMLObject Teuchos::xmlOut = plWriter.toXML(myDepList, myDepSheet)
out<< xmlOut.toString();RCP
< ParameterList > 
Teuchos::readInList
RCP< ParameterEntry > Teuchos::readinDependee1 = readInList->getEntryRCP(dependee1)
RCP< ParameterEntry > Teuchos::readinDependent1 = readInList->getEntryRCP(dependent1)
RCP< ParameterEntry > Teuchos::readinDependee2 = readInList->getEntryRCP(dependee2)
RCP< ParameterEntry > Teuchos::readinDependent2 = readInList->getEntryRCP(dependent2)
RCP< Dependency > Teuchos::readinDep1
RCP< Dependency > Teuchos::readinDep2
RCP< StringValidatorDependency > Teuchos::castedDep1
RCP< StringValidatorDependency > Teuchos::castedDep2

Define Documentation

#define BASIC_DEPENDENCY_TEST (   DEPENDENCY,
  DEPTYPE,
  NUM_DEPENDEES,
  NUM_DEPENDENTS 
)
Value:
std::string depXMLTag##DEPENDENCY = \
    DummyObjectGetter< DEPTYPE >::getDummyObject()->getTypeAttributeValue(); \
\
  TEST_ASSERT(DEPENDENCY->getTypeAttributeValue() == depXMLTag##DEPENDENCY ); \
  TEST_ASSERT(DEPENDENCY->getDependents().size() == NUM_DEPENDENTS); \
  TEST_ASSERT(DEPENDENCY->getDependees().size() == NUM_DEPENDEES); \

Definition at line 68 of file Dependencies_SerializationTests.cpp.

#define VERIFY_DEPENDENT (   DEPENDENCY,
  DEPENDENT 
)
Value:
TEST_ASSERT( \
    DEPENDENCY->getDependents().find(DEPENDENT)  \
    != \
    DEPENDENCY->getDependents().end() \
  ); \

Definition at line 77 of file Dependencies_SerializationTests.cpp.

#define VERIFY_DEPENDEE (   DEPENDENCY,
  DEPENDEE 
)
Value:
TEST_ASSERT( \
    DEPENDENCY->getDependees().find(DEPENDEE)  \
    != \
    DEPENDENCY->getDependees().end()); \

Definition at line 84 of file Dependencies_SerializationTests.cpp.

#define CREATE_DEPENDEE (   POSTFIX,
  VALUE 
)
Value:
RCP<ParameterEntry> dependeeParam##POSTFIX = rcp(  \
    new ParameterEntry( VALUE ));

Definition at line 90 of file Dependencies_SerializationTests.cpp.

#define CREATE_DEPENDENT (   POSTFIX,
  VALUE 
)
Value:
RCP<ParameterEntry> dependentParam##POSTFIX =   \
    rcp(new ParameterEntry( VALUE )); \

Definition at line 94 of file Dependencies_SerializationTests.cpp.

#define EXCEPTION_TEST_BOILERPLATE (   DEPENDEE_VAL,
  DEPENDENT_VAL 
)
Value:
CREATE_DEPENDEE(1, DEPENDEE_VAL); \
  CREATE_DEPENDEE(Extra, DEPENDEE_VAL); \
  CREATE_DEPENDENT(1, DEPENDENT_VAL); \
\
  XMLParameterListWriter::EntryIDsMap writerEntryMap; \
  writerEntryMap[dependeeParam1] = 1; \
  writerEntryMap[dependentParam1] = 2; \
  writerEntryMap[dependeeParamExtra] = 3; \
  ValidatortoIDMap writerValiMap; \
\
  XMLParameterListReader::EntryIDsMap readerEntryMap; \
  readerEntryMap[1] = dependeeParam1; \
  readerEntryMap[2] = dependentParam1; \
  readerEntryMap[3] = dependeeParamExtra; \
  IDtoValidatorMap readerValiMap; \

Definition at line 98 of file Dependencies_SerializationTests.cpp.

#define CONVERT_DEP_TO_XML (   DEPENDENCY)
Value:
XMLObject DEPENDENCY##XML = DependencyXMLConverterDB::convertDependency( \
    DEPENDENCY , writerEntryMap, writerValiMap);  \

Definition at line 115 of file Dependencies_SerializationTests.cpp.

#define TOO_MANY_DEPENDEE_TEST (   DEPENDENCY)
Value:
XMLObject extraDependee(DependencyXMLConverter::getDependeeTagName());  \
  extraDependee.addAttribute<ParameterEntry::ParameterEntryID>(  \
    DependencyXMLConverter::getParameterIdAttributeName(), \
    writerEntryMap[dependeeParamExtra]);  \
  XMLObject tooManyTempXML = DEPENDENCY##XML.deepCopy(); \
  tooManyTempXML.addChild(extraDependee);  \
  \
  TEST_THROW(  \
    DependencyXMLConverterDB::convertXML(  \
      tooManyTempXML , readerEntryMap, readerValiMap),  \
    TooManyDependeesException);  \

Definition at line 119 of file Dependencies_SerializationTests.cpp.

#define COPY_DEPTAG_WITHOUT_CHILD (   TAG,
  CHILDTAG,
  NEWTAG 
)
Value:
XMLObject NEWTAG(TAG.getTag()); \
  NEWTAG.addAttribute( \
    DependencyXMLConverter::getTypeAttributeName(), \
    TAG.getAttribute(DependencyXMLConverter::getTypeAttributeName())); \
  for(int i =0; i< TAG.numChildren(); i++){ \
    if(TAG.getChild(i).getTag() != CHILDTAG) \
    { \
      NEWTAG.addChild(TAG.getChild(i).deepCopy()); \
    } \
  } \

Definition at line 132 of file Dependencies_SerializationTests.cpp.

#define INSERT_VALIDATOR_TO_MAPS (   VALIDATOR)
Value:
writerValiMap.insert( VALIDATOR ); \
  readerValiMap.insert( \
    IDtoValidatorMap::IDValidatorPair( \
      writerValiMap.find( VALIDATOR )->second, VALIDATOR )); \

Definition at line 145 of file Dependencies_SerializationTests.cpp.

#define NUMBER_VIS_TEST (   T)
Value:
TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( \
  Teuchos_Dependencies, NumberVisualDepSerialization, T)

Definition at line 414 of file Dependencies_SerializationTests.cpp.

#define ArrayModifierTest (   DEPENDENCYTYPE,
  ARRAY_TYPE 
)

Definition at line 527 of file Dependencies_SerializationTests.cpp.

#define NUM_ARRAY_LENGTH_TEST (   DependeeType,
  DependentType 
)
Value:
TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( \
  Teuchos_Dependencies, \
  NumberArrayLengthDependency_serialization_tests, \
  DependeeType, \
  DependentType)
#define NUM_ARRAY_LENGTH_TEST_GROUP (   DependeeType)
Value:
NUM_ARRAY_LENGTH_TEST(DependeeType, int) \
  NUM_ARRAY_LENGTH_TEST(DependeeType, double) \
  NUM_ARRAY_LENGTH_TEST(DependeeType, float)
#define TWODROW_TEST (   DependeeType,
  DependentType 
)
Value:
TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( \
  Teuchos_Dependencies, \
  TwoDRowDependency_serialization_tests, \
  DependeeType, \
  DependentType)

Definition at line 648 of file Dependencies_SerializationTests.cpp.

#define TWODROW_TEST_GROUP (   DependeeType)
Value:
TWODROW_TEST(DependeeType, int) \
  TWODROW_TEST(DependeeType, double) \
  TWODROW_TEST(DependeeType, float)

Definition at line 666 of file Dependencies_SerializationTests.cpp.

#define TWODCOL_TEST (   DependeeType,
  DependentType 
)
Value:
TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( \
  Teuchos_Dependencies, \
  TwoDColDependency_serialization_tests, \
  DependeeType, \
  DependentType)
#define TWODCOL_TEST_GROUP (   DependeeType)
Value:
TWODCOL_TEST(DependeeType, int) \
  TWODCOL_TEST(DependeeType, double) \
  TWODCOL_TEST(DependeeType, float)
#define RANGE_VALIDATOR_TEST (   T)
Value:
TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( \
  Teuchos_Dependencies, RangeValidatorDepSerialization, T)

Definition at line 1051 of file Dependencies_SerializationTests.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines