static const xmlChar * const cStringNodeName;
//! String constant for naming XML elements for integer values.
static const xmlChar * const cIntegerNodeName;
+ //! String constant for naming XML elements for int64 values.
+ static const xmlChar * const cInt64NodeName;
+ //! String constant for naming XML elements for unsigned int64 values.
+ static const xmlChar * const cUInt64NodeName;
//! String constant for naming XML elements for floating-point values.
static const xmlChar * const cRealNodeName;
//! String constant for naming XML attribute for value identifiers.
(const xmlChar *)"String";
const xmlChar * const TestReferenceChecker::Impl::cIntegerNodeName =
(const xmlChar *)"Int";
+const xmlChar * const TestReferenceChecker::Impl::cInt64NodeName =
+ (const xmlChar *)"Int64";
+const xmlChar * const TestReferenceChecker::Impl::cUInt64NodeName =
+ (const xmlChar *)"UInt64";
const xmlChar * const TestReferenceChecker::Impl::cRealNodeName =
(const xmlChar *)"Real";
const xmlChar * const TestReferenceChecker::Impl::cIdAttrName =
}
}
+void TestReferenceChecker::checkInt64(gmx_int64_t value, const char *id)
+{
+ if (impl_->shouldIgnore())
+ {
+ return;
+ }
+ SCOPED_TRACE(impl_->traceString(id));
+ bool bFound = false;
+ std::string strValue = formatString("%" GMX_PRId64, value);
+ std::string refStrValue =
+ impl_->processItem(Impl::cInt64NodeName, id, strValue, &bFound);
+ if (bFound)
+ {
+ EXPECT_EQ(refStrValue, strValue);
+ }
+}
+
+void TestReferenceChecker::checkUInt64(gmx_uint64_t value, const char *id)
+{
+ if (impl_->shouldIgnore())
+ {
+ return;
+ }
+ SCOPED_TRACE(impl_->traceString(id));
+ bool bFound = false;
+ std::string strValue = formatString("%" GMX_PRIu64, value);
+ std::string refStrValue =
+ impl_->processItem(Impl::cUInt64NodeName, id, strValue, &bFound);
+ if (bFound)
+ {
+ EXPECT_EQ(refStrValue, strValue);
+ }
+}
void TestReferenceChecker::checkDouble(double value, const char *id)
{
#include <iterator>
#include <string>
+#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/common.h"
namespace gmx
void checkStringBlock(const std::string &value, const char *id);
//! Check a single integer value.
void checkInteger(int value, const char *id);
+ //! Check a single int64 value.
+ void checkInt64(gmx_int64_t value, const char *id);
+ //! Check a single uint64 value.
+ void checkUInt64(gmx_uint64_t value, const char *id);
//! Check a single single-precision floating point value.
void checkFloat(float value, const char *id);
//! Check a single double-precision floating point value.
{
checkInteger(value, id);
}
+ //! Check a single integer value.
+ void checkValue(gmx_int64_t value, const char *id)
+ {
+ checkInt64(value, id);
+ }
+ //! Check a single integer value.
+ void checkValue(gmx_uint64_t value, const char *id)
+ {
+ checkUInt64(value, id);
+ }
//! Check a single single-precision floating point value.
void checkValue(float value, const char *id)
{
TestReferenceChecker checker(data.rootChecker());
checker.checkBoolean(true, "int");
checker.checkInteger(1, "int");
+ checker.checkInt64(1ULL<<42, "int64");
+ checker.checkUInt64(1ULL<<42, "uint64");
checker.checkDouble(0.5, "real");
checker.checkString("Test", "string");
}
TestReferenceChecker checker(data.rootChecker());
checker.checkBoolean(true, "int");
checker.checkInteger(1, "int");
+ checker.checkInt64(1ULL<<42, "int64");
+ checker.checkUInt64(1ULL<<42, "uint64");
checker.checkDouble(0.5, "real");
checker.checkString("Test", "string");
}