/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
- * David van der Spoel, Berk Hess, Erik Lindahl, and including many
- * others, as listed in the AUTHORS file in the top-level source
- * directory and at http://www.gromacs.org.
+ * Copyright (c) 2012,2013,2014, 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.
*
* GROMACS is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* \author Teemu Murtola <teemu.murtola@gmail.com>
* \ingroup module_analysisdata
*/
+#include "gmxpre.h"
+
+#include "gromacs/analysisdata/modules/histogram.h"
+
#include <gtest/gtest.h>
#include "gromacs/analysisdata/analysisdata.h"
-#include "gromacs/analysisdata/modules/histogram.h"
-#include "testutils/datatest.h"
+#include "gromacs/analysisdata/tests/datatest.h"
#include "testutils/testasserts.h"
using gmx::test::AnalysisDataTestInput;
public:
static const AnalysisDataTestInput &get()
{
+#ifndef STATIC_ANON_NAMESPACE_BUG
static SimpleInputData singleton;
return singleton.data_;
+#else
+ static SimpleInputData singleton_histogram;
+ return singleton_histogram.data_;
+#endif
}
SimpleInputData() : data_(1, true)
public:
static const AnalysisDataTestInput &get()
{
+#ifndef STATIC_ANON_NAMESPACE_BUG
static WeightedSimpleInputData singleton;
return singleton.data_;
+#else
+ static WeightedSimpleInputData singleton_histogram;
+ return singleton_histogram.data_;
+#endif
}
WeightedSimpleInputData() : data_(1, true)
public:
static const AnalysisDataTestInput &get()
{
+#ifndef STATIC_ANON_NAMESPACE_BUG
static WeightedDataSetInputData singleton;
return singleton.data_;
+#else
+ static WeightedDataSetInputData singleton_histogram;
+ return singleton_histogram.data_;
+#endif
}
WeightedDataSetInputData() : data_(2, true)
public:
static const AnalysisDataTestInput &get()
{
+#ifndef STATIC_ANON_NAMESPACE_BUG
static AverageInputData singleton;
return singleton.data_;
+#else
+ static AverageInputData singleton_histogram;
+ return singleton_histogram.data_;
+#endif
}
AverageInputData() : data_(1, false)
AnalysisDataTestInput data_;
};
-/*! \internal \brief
+/*! \brief
* Mock object for testing gmx::AbstractAverageHistogram.
*
* Exposes necessary methods from gmx::AbstractAverageHistogram to use with
* gmx::test::AnalysisDataTestFixture::setupArrayData().
+ *
+ * \ingroup module_analysisdata
*/
class MockAverageHistogram : public gmx::AbstractAverageHistogram
{
public:
- MockAverageHistogram() {}
//! Creates a histogram module with defined bin parameters.
explicit MockAverageHistogram(const gmx::AnalysisHistogramSettings &settings)
: AbstractAverageHistogram(settings)