2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014,2019, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
37 * Tests for functionality of analysis data histogram modules.
39 * These tests check that classes in histogram.h compute histograms correctly
40 * with simple input data. Also different ways of initializing the histograms
42 * Checking is done using gmx::test::AnalysisDataTestFixture and reference
43 * data. Also the input data is written to the reference data to catch
44 * out-of-date reference.
46 * \author Teemu Murtola <teemu.murtola@gmail.com>
47 * \ingroup module_analysisdata
51 #include "gromacs/analysisdata/modules/histogram.h"
53 #include <gtest/gtest.h>
55 #include "gromacs/analysisdata/analysisdata.h"
57 #include "gromacs/analysisdata/tests/datatest.h"
58 #include "testutils/testasserts.h"
60 using gmx::test::AnalysisDataTestInput
;
65 /********************************************************************
66 * Tests for gmx::AnalysisHistogramSettings.
68 * These tests check that gmx::AnalysisHistogramSettings objects can be
69 * initialized from various types of values, and that the bin positions are
70 * computed correctly based on the input values.
73 TEST(AnalysisHistogramSettingsTest
, InitializesFromBins
)
75 gmx::AnalysisHistogramSettings
settings(gmx::histogramFromBins(1.0, 5, 0.5));
76 EXPECT_FLOAT_EQ(1.0, settings
.firstEdge());
77 EXPECT_EQ(5, settings
.binCount());
78 EXPECT_FLOAT_EQ(0.5, settings
.binWidth());
79 EXPECT_FLOAT_EQ(3.5, settings
.lastEdge());
83 TEST(AnalysisHistogramSettingsTest
, InitializesFromBinsWithIntegerBins
)
85 gmx::AnalysisHistogramSettings
settings(gmx::histogramFromBins(1.0, 5, 0.5).integerBins());
86 EXPECT_FLOAT_EQ(0.75, settings
.firstEdge());
87 EXPECT_EQ(5, settings
.binCount());
88 EXPECT_FLOAT_EQ(0.5, settings
.binWidth());
89 EXPECT_FLOAT_EQ(3.25, settings
.lastEdge());
93 TEST(AnalysisHistogramSettingsTest
, InitializesFromRangeWithBinCount
)
95 gmx::AnalysisHistogramSettings
settings(gmx::histogramFromRange(1.0, 4.0).binCount(6));
96 EXPECT_FLOAT_EQ(1.0, settings
.firstEdge());
97 EXPECT_FLOAT_EQ(4.0, settings
.lastEdge());
98 EXPECT_EQ(6, settings
.binCount());
99 EXPECT_FLOAT_EQ(0.5, settings
.binWidth());
103 TEST(AnalysisHistogramSettingsTest
, InitializesFromRangeWithBinWidth
)
105 gmx::AnalysisHistogramSettings
settings(gmx::histogramFromRange(1.0, 4.0).binWidth(0.5));
106 EXPECT_FLOAT_EQ(1.0, settings
.firstEdge());
107 EXPECT_FLOAT_EQ(4.0, settings
.lastEdge());
108 EXPECT_FLOAT_EQ(0.5, settings
.binWidth());
109 EXPECT_EQ(6, settings
.binCount());
113 TEST(AnalysisHistogramSettingsTest
, InitializesFromRangeWithBinCountAndIntegerBins
)
115 gmx::AnalysisHistogramSettings
settings(gmx::histogramFromRange(1.0, 4.0).binCount(7).integerBins());
116 EXPECT_FLOAT_EQ(0.75, settings
.firstEdge());
117 EXPECT_FLOAT_EQ(4.25, settings
.lastEdge());
118 EXPECT_EQ(7, settings
.binCount());
119 EXPECT_FLOAT_EQ(0.5, settings
.binWidth());
123 TEST(AnalysisHistogramSettingsTest
, InitializesFromRangeWithBinWidthAndIntegerBins
)
125 gmx::AnalysisHistogramSettings
settings(gmx::histogramFromRange(1.0, 4.0).binWidth(0.5).integerBins());
126 EXPECT_FLOAT_EQ(0.75, settings
.firstEdge());
127 EXPECT_FLOAT_EQ(4.25, settings
.lastEdge());
128 EXPECT_FLOAT_EQ(0.5, settings
.binWidth());
129 EXPECT_EQ(7, settings
.binCount());
133 TEST(AnalysisHistogramSettingsTest
, InitializesFromRangeWithRoundedRange
)
135 gmx::AnalysisHistogramSettings
settings(gmx::histogramFromRange(1.2, 3.8).binWidth(0.5).roundRange());
136 EXPECT_FLOAT_EQ(1.0, settings
.firstEdge());
137 EXPECT_FLOAT_EQ(4.0, settings
.lastEdge());
138 EXPECT_FLOAT_EQ(0.5, settings
.binWidth());
139 EXPECT_EQ(6, settings
.binCount());
143 /********************************************************************
144 * Tests for gmx::AnalysisDataSimpleHistogramModule.
147 //! Test fixture for gmx::AnalysisDataSimpleHistogramModule.
148 typedef gmx::test::AnalysisDataTestFixture SimpleHistogramModuleTest
;
150 // Input data for gmx::AnalysisDataSimpleHistogramModule tests.
151 class SimpleInputData
154 static const AnalysisDataTestInput
& get()
156 #ifndef STATIC_ANON_NAMESPACE_BUG
157 static SimpleInputData singleton
;
158 return singleton
.data_
;
160 static SimpleInputData singleton_histogram
;
161 return singleton_histogram
.data_
;
165 SimpleInputData() : data_(1, true)
167 using gmx::test::AnalysisDataTestInputFrame
;
168 data_
.setColumnCount(0, 1);
169 AnalysisDataTestInputFrame
& frame1
= data_
.addFrame(1.0);
170 frame1
.addPointSetWithValues(0, 0, 0.7);
171 frame1
.addPointSetWithValues(0, 0, 1.1);
172 frame1
.addPointSetWithValues(0, 0, 2.3);
173 frame1
.addPointSetWithValues(0, 0, 2.9);
174 AnalysisDataTestInputFrame
& frame2
= data_
.addFrame(2.0);
175 frame2
.addPointSetWithValues(0, 0, 1.3);
176 frame2
.addPointSetWithValues(0, 0, 2.2);
177 AnalysisDataTestInputFrame
& frame3
= data_
.addFrame(3.0);
178 frame3
.addPointSetWithValues(0, 0, 3.3);
179 frame3
.addPointSetWithValues(0, 0, 1.2);
180 frame3
.addPointSetWithValues(0, 0, 1.3);
184 AnalysisDataTestInput data_
;
187 TEST_F(SimpleHistogramModuleTest
, ComputesCorrectly
)
189 const AnalysisDataTestInput
& input
= SimpleInputData::get();
190 gmx::AnalysisData data
;
191 ASSERT_NO_THROW_GMX(setupDataObject(input
, &data
));
193 gmx::AnalysisDataSimpleHistogramModulePointer
module(
194 new gmx::AnalysisDataSimpleHistogramModule(gmx::histogramFromRange(1.0, 3.0).binCount(4)));
195 data
.addModule(module
);
197 ASSERT_NO_THROW_GMX(addStaticCheckerModule(input
, &data
));
198 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("InputData", &data
));
199 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("Histogram", module
.get()));
200 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("HistogramAverage", &module
->averager()));
201 ASSERT_NO_THROW_GMX(presentAllData(input
, &data
));
202 ASSERT_NO_THROW_GMX(module
->averager().done());
206 TEST_F(SimpleHistogramModuleTest
, ComputesCorrectlyWithAll
)
208 const AnalysisDataTestInput
& input
= SimpleInputData::get();
209 gmx::AnalysisData data
;
210 ASSERT_NO_THROW_GMX(setupDataObject(input
, &data
));
212 gmx::AnalysisDataSimpleHistogramModulePointer
module(new gmx::AnalysisDataSimpleHistogramModule(
213 gmx::histogramFromRange(1.0, 3.0).binCount(4).includeAll()));
214 data
.addModule(module
);
216 ASSERT_NO_THROW_GMX(addStaticCheckerModule(input
, &data
));
217 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("InputData", &data
));
218 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("Histogram", module
.get()));
219 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("HistogramAverage", &module
->averager()));
220 ASSERT_NO_THROW_GMX(presentAllData(input
, &data
));
221 ASSERT_NO_THROW_GMX(module
->averager().done());
225 /********************************************************************
226 * Tests for gmx::AnalysisDataWeightedHistogramModule.
229 //! Test fixture for gmx::AnalysisDataWeightedHistogramModule.
230 typedef gmx::test::AnalysisDataTestFixture WeightedHistogramModuleTest
;
232 // Input data for both weighted histogram and bin average module tests.
233 class WeightedSimpleInputData
236 static const AnalysisDataTestInput
& get()
238 #ifndef STATIC_ANON_NAMESPACE_BUG
239 static WeightedSimpleInputData singleton
;
240 return singleton
.data_
;
242 static WeightedSimpleInputData singleton_histogram
;
243 return singleton_histogram
.data_
;
247 WeightedSimpleInputData() : data_(1, true)
249 using gmx::test::AnalysisDataTestInputFrame
;
250 data_
.setColumnCount(0, 2);
251 AnalysisDataTestInputFrame
& frame1
= data_
.addFrame(1.0);
252 frame1
.addPointSetWithValues(0, 0, 0.7, 0.5);
253 frame1
.addPointSetWithValues(0, 0, 1.1, 1.0);
254 frame1
.addPointSetWithValues(0, 0, 2.3, 1.0);
255 frame1
.addPointSetWithValues(0, 0, 2.9, 2.0);
256 AnalysisDataTestInputFrame
& frame2
= data_
.addFrame(2.0);
257 frame2
.addPointSetWithValues(0, 0, 1.3, 1.0);
258 frame2
.addPointSetWithValues(0, 0, 2.2, 3.0);
259 AnalysisDataTestInputFrame
& frame3
= data_
.addFrame(3.0);
260 frame3
.addPointSetWithValues(0, 0, 3.3, 0.5);
261 frame3
.addPointSetWithValues(0, 0, 1.2, 2.0);
262 frame3
.addPointSetWithValues(0, 0, 1.3, 1.0);
266 AnalysisDataTestInput data_
;
269 // Input data for both weighted histogram and bin average module tests.
270 class WeightedDataSetInputData
273 static const AnalysisDataTestInput
& get()
275 #ifndef STATIC_ANON_NAMESPACE_BUG
276 static WeightedDataSetInputData singleton
;
277 return singleton
.data_
;
279 static WeightedDataSetInputData singleton_histogram
;
280 return singleton_histogram
.data_
;
284 WeightedDataSetInputData() : data_(2, true)
286 using gmx::test::AnalysisDataTestInputFrame
;
287 data_
.setColumnCount(0, 2);
288 data_
.setColumnCount(1, 2);
289 AnalysisDataTestInputFrame
& frame1
= data_
.addFrame(1.0);
290 frame1
.addPointSetWithValues(0, 0, 0.7, 0.5);
291 frame1
.addPointSetWithValues(0, 0, 1.1, 1.0);
292 frame1
.addPointSetWithValues(1, 0, 2.3, 1.0);
293 frame1
.addPointSetWithValues(1, 0, 2.9, 2.0);
294 AnalysisDataTestInputFrame
& frame2
= data_
.addFrame(2.0);
295 frame2
.addPointSetWithValues(0, 0, 1.3, 1.0);
296 frame2
.addPointSetWithValues(1, 0, 2.2, 3.0);
297 AnalysisDataTestInputFrame
& frame3
= data_
.addFrame(3.0);
298 frame3
.addPointSetWithValues(0, 0, 3.3, 0.5);
299 frame3
.addPointSetWithValues(0, 0, 1.2, 2.0);
300 frame3
.addPointSetWithValues(1, 0, 1.3, 1.0);
304 AnalysisDataTestInput data_
;
307 TEST_F(WeightedHistogramModuleTest
, ComputesCorrectly
)
309 const AnalysisDataTestInput
& input
= WeightedSimpleInputData::get();
310 gmx::AnalysisData data
;
311 ASSERT_NO_THROW_GMX(setupDataObject(input
, &data
));
313 gmx::AnalysisDataWeightedHistogramModulePointer
module(
314 new gmx::AnalysisDataWeightedHistogramModule(gmx::histogramFromRange(1.0, 3.0).binCount(4)));
315 data
.addModule(module
);
317 ASSERT_NO_THROW_GMX(addStaticCheckerModule(input
, &data
));
318 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("InputData", &data
));
319 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("Histogram", module
.get()));
320 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("HistogramAverage", &module
->averager()));
321 ASSERT_NO_THROW_GMX(presentAllData(input
, &data
));
322 ASSERT_NO_THROW_GMX(module
->averager().done());
326 TEST_F(WeightedHistogramModuleTest
, ComputesCorrectlyWithAll
)
328 const AnalysisDataTestInput
& input
= WeightedSimpleInputData::get();
329 gmx::AnalysisData data
;
330 ASSERT_NO_THROW_GMX(setupDataObject(input
, &data
));
332 gmx::AnalysisDataWeightedHistogramModulePointer
module(new gmx::AnalysisDataWeightedHistogramModule(
333 gmx::histogramFromRange(1.0, 3.0).binCount(4).includeAll()));
334 data
.addModule(module
);
336 ASSERT_NO_THROW_GMX(addStaticCheckerModule(input
, &data
));
337 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("InputData", &data
));
338 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("Histogram", module
.get()));
339 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("HistogramAverage", &module
->averager()));
340 ASSERT_NO_THROW_GMX(presentAllData(input
, &data
));
341 ASSERT_NO_THROW_GMX(module
->averager().done());
345 TEST_F(WeightedHistogramModuleTest
, HandlesMultipleDataSets
)
347 const AnalysisDataTestInput
& input
= WeightedDataSetInputData::get();
348 gmx::AnalysisData data
;
349 ASSERT_NO_THROW_GMX(setupDataObject(input
, &data
));
351 gmx::AnalysisDataWeightedHistogramModulePointer
module(
352 new gmx::AnalysisDataWeightedHistogramModule(gmx::histogramFromRange(1.0, 3.0).binCount(4)));
353 data
.addModule(module
);
355 ASSERT_NO_THROW_GMX(addStaticCheckerModule(input
, &data
));
356 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("InputData", &data
));
357 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("Histogram", module
.get()));
358 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("HistogramAverage", &module
->averager()));
359 ASSERT_NO_THROW_GMX(presentAllData(input
, &data
));
360 ASSERT_NO_THROW_GMX(module
->averager().done());
364 /********************************************************************
365 * Tests for gmx::AnalysisDataBinAverageModule.
368 //! Test fixture for gmx::AnalysisDataBinAverageModule.
369 typedef gmx::test::AnalysisDataTestFixture BinAverageModuleTest
;
371 TEST_F(BinAverageModuleTest
, ComputesCorrectly
)
373 const AnalysisDataTestInput
& input
= WeightedSimpleInputData::get();
374 gmx::AnalysisData data
;
375 ASSERT_NO_THROW_GMX(setupDataObject(input
, &data
));
377 gmx::AnalysisDataBinAverageModulePointer
module(
378 new gmx::AnalysisDataBinAverageModule(gmx::histogramFromRange(1.0, 3.0).binCount(4)));
379 data
.addModule(module
);
381 ASSERT_NO_THROW_GMX(addStaticCheckerModule(input
, &data
));
382 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("InputData", &data
));
383 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("HistogramAverage", module
.get()));
384 ASSERT_NO_THROW_GMX(presentAllData(input
, &data
));
388 TEST_F(BinAverageModuleTest
, ComputesCorrectlyWithAll
)
390 const AnalysisDataTestInput
& input
= WeightedSimpleInputData::get();
391 gmx::AnalysisData data
;
392 ASSERT_NO_THROW_GMX(setupDataObject(input
, &data
));
394 gmx::AnalysisDataBinAverageModulePointer
module(new gmx::AnalysisDataBinAverageModule(
395 gmx::histogramFromRange(1.0, 3.0).binCount(4).includeAll()));
396 data
.addModule(module
);
398 ASSERT_NO_THROW_GMX(addStaticCheckerModule(input
, &data
));
399 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("InputData", &data
));
400 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("HistogramAverage", module
.get()));
401 ASSERT_NO_THROW_GMX(presentAllData(input
, &data
));
405 TEST_F(BinAverageModuleTest
, HandlesMultipleDataSets
)
407 const AnalysisDataTestInput
& input
= WeightedDataSetInputData::get();
408 gmx::AnalysisData data
;
409 ASSERT_NO_THROW_GMX(setupDataObject(input
, &data
));
411 gmx::AnalysisDataBinAverageModulePointer
module(
412 new gmx::AnalysisDataBinAverageModule(gmx::histogramFromRange(1.0, 3.0).binCount(4)));
413 data
.addModule(module
);
415 ASSERT_NO_THROW_GMX(addStaticCheckerModule(input
, &data
));
416 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("InputData", &data
));
417 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("HistogramAverage", module
.get()));
418 ASSERT_NO_THROW_GMX(presentAllData(input
, &data
));
422 /********************************************************************
423 * Tests for gmx::AbstractAverageHistogram.
425 * This class derives from gmx::AbstractAnalysisArrayData, and is tested using
426 * corresponding facilities in gmx::test::AnalysisDataTestFixture.
429 //! Test fixture for gmx::AbstractAverageHistogram.
430 typedef gmx::test::AnalysisDataTestFixture AbstractAverageHistogramTest
;
432 // Input data for gmx::AbstractAverageHistogram tests.
433 class AverageInputData
436 static const AnalysisDataTestInput
& get()
438 #ifndef STATIC_ANON_NAMESPACE_BUG
439 static AverageInputData singleton
;
440 return singleton
.data_
;
442 static AverageInputData singleton_histogram
;
443 return singleton_histogram
.data_
;
447 AverageInputData() : data_(1, false)
449 data_
.setColumnCount(0, 1);
450 data_
.addFrameWithValueAndError(1.0, 2.0, 1.0);
451 data_
.addFrameWithValueAndError(1.5, 1.0, 1.0);
452 data_
.addFrameWithValueAndError(2.0, 3.0, 2.0);
453 data_
.addFrameWithValueAndError(2.5, 4.0, 2.0);
454 data_
.addFrameWithValueAndError(3.0, 2.0, 1.0);
455 data_
.addFrameWithValueAndError(3.5, 0.0, 3.0);
456 data_
.addFrameWithValueAndError(4.0, 1.0, 3.0);
460 AnalysisDataTestInput data_
;
464 * Mock object for testing gmx::AbstractAverageHistogram.
466 * Exposes necessary methods from gmx::AbstractAverageHistogram to use with
467 * gmx::test::AnalysisDataTestFixture::setupArrayData().
469 * \ingroup module_analysisdata
471 class MockAverageHistogram
: public gmx::AbstractAverageHistogram
474 //! Creates a histogram module with defined bin parameters.
475 explicit MockAverageHistogram(const gmx::AnalysisHistogramSettings
& settings
) :
476 AbstractAverageHistogram(settings
)
480 using AbstractAverageHistogram::allocateValues
;
481 using AbstractAverageHistogram::init
;
482 using AbstractAverageHistogram::setColumnCount
;
483 using AbstractAverageHistogram::setRowCount
;
484 using AbstractAverageHistogram::value
;
488 TEST_F(AbstractAverageHistogramTest
, ClonesCorrectly
)
490 const AnalysisDataTestInput
& input
= AverageInputData::get();
491 MockAverageHistogram
data(gmx::histogramFromBins(1.0, input
.frameCount(), 0.5).integerBins());
492 setupArrayData(input
, &data
);
494 ASSERT_NO_THROW_GMX(addStaticCheckerModule(input
, &data
));
495 gmx::AverageHistogramPointer
copy(data
.clone());
496 ASSERT_NO_THROW_GMX(addStaticCheckerModule(input
, copy
.get()));
497 ASSERT_NO_THROW_GMX(copy
->done());
498 ASSERT_NO_THROW_GMX(data
.done());
499 gmx::AverageHistogramPointer
copy2(data
.clone());
500 ASSERT_NO_THROW_GMX(addStaticCheckerModule(input
, copy2
.get()));
501 ASSERT_NO_THROW_GMX(copy2
->done());
505 TEST_F(AbstractAverageHistogramTest
, ComputesCumulativeHistogram
)
507 const AnalysisDataTestInput
& input
= AverageInputData::get();
508 MockAverageHistogram
data(gmx::histogramFromBins(1.0, input
.frameCount(), 0.5).integerBins());
509 setupArrayData(input
, &data
);
511 ASSERT_NO_THROW_GMX(addStaticCheckerModule(input
, &data
));
512 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("InputData", &data
));
513 ASSERT_NO_THROW_GMX(data
.done());
515 gmx::AverageHistogramPointer
cumulative(data
.clone());
516 cumulative
->makeCumulative();
517 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("CumulativeHistogram", cumulative
.get()));
518 ASSERT_NO_THROW_GMX(cumulative
->done());
522 TEST_F(AbstractAverageHistogramTest
, ResamplesAtDoubleBinWidth
)
524 const AnalysisDataTestInput
& input
= AverageInputData::get();
525 MockAverageHistogram
data(gmx::histogramFromBins(1.0, input
.frameCount(), 0.5).integerBins());
526 setupArrayData(input
, &data
);
528 ASSERT_NO_THROW_GMX(addStaticCheckerModule(input
, &data
));
529 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("InputData", &data
));
530 gmx::AverageHistogramPointer
resampled(data
.resampleDoubleBinWidth(false));
531 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("ResampledHistogram", resampled
.get()));
532 ASSERT_NO_THROW_GMX(data
.done());
533 ASSERT_NO_THROW_GMX(resampled
->done());
537 TEST_F(AbstractAverageHistogramTest
, ResamplesAtDoubleBinWidthWithIntegerBins
)
539 const AnalysisDataTestInput
& input
= AverageInputData::get();
540 MockAverageHistogram
data(gmx::histogramFromBins(1.0, input
.frameCount(), 0.5).integerBins());
541 setupArrayData(input
, &data
);
543 ASSERT_NO_THROW_GMX(addStaticCheckerModule(input
, &data
));
544 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("InputData", &data
));
545 gmx::AverageHistogramPointer
resampled(data
.resampleDoubleBinWidth(true));
546 ASSERT_NO_THROW_GMX(addReferenceCheckerModule("ResampledHistogram", resampled
.get()));
547 ASSERT_NO_THROW_GMX(data
.done());
548 ASSERT_NO_THROW_GMX(resampled
->done());