/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2019, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
//! Stores the -stdout flag value to print out values instead of checking them.
bool g_bWriteToStdOut = false;
-}
+} // namespace
// TODO: Only add this option to those test binaries that actually need it
// (depending on the linker, it may or may not appear right now),
GMX_TEST_OPTIONS(StringTestOptions, options)
{
options->addOption(
- BooleanOption("stdout")
- .store(&g_bWriteToStdOut)
- .description("Print the test string to stdout instead of checking against reference data"));
+ BooleanOption("stdout").store(&g_bWriteToStdOut).description("Print the test string to stdout instead of checking against reference data"));
}
//! \endcond
class StringTestBase::Impl
{
- public:
- TestReferenceData data_;
- TestReferenceChecker checker_;
+public:
+ TestReferenceData data_;
+ TestReferenceChecker checker_;
};
/********************************************************************
*/
// static
-void StringTestBase::checkText(TestReferenceChecker *checker,
- const std::string &text, const char *id)
+void StringTestBase::checkText(TestReferenceChecker* checker, const std::string& text, const char* id)
{
if (g_bWriteToStdOut)
{
}
}
-StringTestBase::StringTestBase()
- : impl_(new Impl)
-{
-}
+StringTestBase::StringTestBase() : impl_(new Impl) {}
-StringTestBase::~StringTestBase()
-{
-}
+StringTestBase::~StringTestBase() {}
-TestReferenceChecker &
-StringTestBase::checker()
+TestReferenceChecker& StringTestBase::checker()
{
if (!impl_->checker_)
{
return impl_->checker_;
}
-void
-StringTestBase::checkText(const std::string &text, const char *id)
+void StringTestBase::checkText(const std::string& text, const char* id)
{
checkText(&checker(), text, id);
}
-void
-StringTestBase::checkFileContents(const std::string &filename, const char *id)
+void StringTestBase::checkFileContents(const std::string& filename, const char* id)
{
const std::string text = TextReader::readFileToString(filename);
checkText(text, id);
}
-void
-StringTestBase::testFilesEqual(const std::string &refFilename,
- const std::string &testFilename)
+void StringTestBase::testFilesEqual(const std::string& refFilename, const std::string& testFilename)
{
const std::string expectedContents = TextReader::readFileToString(refFilename);
const std::string contents = TextReader::readFileToString(testFilename);