Commit 59106d95 authored by Andrew J. Burns (Cont's avatar Andrew J. Burns (Cont

fixed documentation to account for new dsm folder; adjusted the test for...

fixed documentation to account for new dsm folder; adjusted the test for XdmfError; disabled the WriteHugeArray test
parent e8b85490
......@@ -65,7 +65,7 @@ XdmfError::setSuppressionLevel(Level l)
void
XdmfError::message(Level level, std::string msg)
{
if (level>=XdmfError::getSuppressionLevel())
if (level<=XdmfError::getSuppressionLevel())
{
XdmfError::WriteToStream(msg);
}
......@@ -99,5 +99,5 @@ XdmfError::WriteToStream(std::string msg)
******************************************/
XdmfError::Level XdmfError::mLevelLimit = XdmfError::FATAL;
XdmfError::Level XdmfError::mSuppressLevel = XdmfError::DEBUG;
XdmfError::Level XdmfError::mSuppressLevel = XdmfError::WARNING;
std::streambuf* XdmfError::mBuf=std::cout.rdbuf();
......@@ -168,8 +168,9 @@ public:
/**
* Alternate constructor for XdmfError exceptions.
* This one automatically prints out the message provided if the error level is within range.
* If not within range an error will not be thrown
* This one automatically prints out the message provided if the error level
* above the suppression level. If the error level is not above the
* level limit an exception will not be thrown.
*
* Example of use:
*
......
......@@ -67,6 +67,7 @@ XdmfDSMCommMPI::XdmfDSMCommMPI()
InterId = -1;
InterSize = -1;
SetDsmPortName("");
// This is the default file name for the config file.
DsmFileName = "dsmconnect.cfg";
InterCommType = XDMF_DSM_COMM_MPI;
}
......
......@@ -53,5 +53,136 @@ int main(int, char **)
//std::cout << "The error message is:\n" << e.what() << std::endl;
}
std::cout << "default error levels" << std::endl;
try
{
XdmfError::message(XdmfError::FATAL, "throwing fatal");
}
catch (XdmfError e)
{
std::cout << "fatal caught" << std::endl;
}
try
{
XdmfError::message(XdmfError::WARNING, "throwing warning");
}
catch (XdmfError e)
{
std::cout << "warning caught" << std::endl;
}
try
{
XdmfError::message(XdmfError::DEBUG, "throwing debug");
}
catch (XdmfError e)
{
std::cout << "debug caught" << std::endl;
}
std::cout << std::endl;
std::cout << "both levels set to FATAL" << std::endl;
XdmfError::setSuppressionLevel(XdmfError::FATAL);
XdmfError::setLevelLimit(XdmfError::FATAL);
try
{
XdmfError::message(XdmfError::FATAL, "throwing fatal");
}
catch (XdmfError e)
{
std::cout << "fatal caught" << std::endl;
}
try
{
XdmfError::message(XdmfError::WARNING, "throwing warning");
}
catch (XdmfError e)
{
std::cout << "warning caught" << std::endl;
}
try
{
XdmfError::message(XdmfError::DEBUG, "throwing debug");
}
catch (XdmfError e)
{
std::cout << "debug caught" << std::endl;
}
std::cout << std::endl;
std::cout << "both levels set to WARNING" << std::endl;
XdmfError::setSuppressionLevel(XdmfError::WARNING);
XdmfError::setLevelLimit(XdmfError::WARNING);
try
{
XdmfError::message(XdmfError::FATAL, "throwing fatal");
}
catch (XdmfError e)
{
std::cout << "fatal caught" << std::endl;
}
try
{
XdmfError::message(XdmfError::WARNING, "throwing warning");
}
catch (XdmfError e)
{
std::cout << "warning caught" << std::endl;
}
try
{
XdmfError::message(XdmfError::DEBUG, "throwing debug");
}
catch (XdmfError e)
{
std::cout << "debug caught" << std::endl;
}
std::cout << std::endl;
std::cout << "both levels set to DEBUG" << std::endl;
XdmfError::setSuppressionLevel(XdmfError::DEBUG);
XdmfError::setLevelLimit(XdmfError::DEBUG);
try
{
XdmfError::message(XdmfError::FATAL, "throwing fatal");
}
catch (XdmfError e)
{
std::cout << "fatal caught" << std::endl;
}
try
{
XdmfError::message(XdmfError::WARNING, "throwing warning");
}
catch (XdmfError e)
{
std::cout << "warning caught" << std::endl;
}
try
{
XdmfError::message(XdmfError::DEBUG, "throwing debug");
}
catch (XdmfError e)
{
std::cout << "debug caught" << std::endl;
}
return 0;
}
......@@ -567,6 +567,7 @@ WARN_LOGFILE =
INPUT = "@CMAKE_SOURCE_DIR@" \
"@CMAKE_SOURCE_DIR@/core" \
"@CMAKE_SOURCE_DIR@/core/loki" \
"@CMAKE_SOURCE_DIR@/core/dsm" \
"@CMAKE_BINARY_DIR@"
# This tag can be used to specify the character encoding of the source files
......
......@@ -33,7 +33,7 @@ ADD_TEST_CXX(TestXdmfWriter)
ADD_TEST_CXX(TestXdmfWriterHDF5ThenXML)
ADD_TEST_CXX(TestXdmfXPath)
#removed due to long execution time
ADD_TEST_CXX(HugeWriteArray)
#ADD_TEST_CXX(HugeWriteArray)
# Add any cxx cleanup here:
# Note: We don't want to use a foreach loop to test the files incase we
......@@ -96,9 +96,9 @@ CLEAN_TEST_CXX(TestXdmfXPath
XdmfXPath1.xmf
XdmfXPath2.xmf)
#removed due to long execution time
CLEAN_TEST_CXX(HugeWriteArray
arraydata1.h5
arraydata2.h5
arraydata3.h5
arraydata.h5
arraydata.xmf)
#CLEAN_TEST_CXX(HugeWriteArray
# arraydata1.h5
# arraydata2.h5
# arraydata3.h5
# arraydata.h5
# arraydata.xmf)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment