1
// -*- mode: C++; tab-width: 2; -*-
4
// --------------------------------------------------------------------------
5
// OpenMS Mass Spectrometry Framework
6
// --------------------------------------------------------------------------
7
// Copyright (C) 2003-2011 -- Oliver Kohlbacher, Knut Reinert
9
// This library is free software; you can redistribute it and/or
10
// modify it under the terms of the GNU Lesser General Public
11
// License as published by the Free Software Foundation; either
12
// version 2.1 of the License, or (at your option) any later version.
14
// This library 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 this library; if not, write to the Free Software
21
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
// --------------------------------------------------------------------------
24
// $Maintainer: Chris Bielow $
26
// --------------------------------------------------------------------------
28
#include <OpenMS/CONCEPT/ClassTest.h>
30
///////////////////////////
31
#include <OpenMS/FILTERING/NOISEESTIMATION/SignalToNoiseEstimator.h>
32
///////////////////////////
34
using namespace OpenMS;
37
class TestSignalToNoiseEstimator
38
: public SignalToNoiseEstimator< >
41
TestSignalToNoiseEstimator()
42
: SignalToNoiseEstimator< >()
46
TestSignalToNoiseEstimator(const TestSignalToNoiseEstimator& bpf)
47
: SignalToNoiseEstimator< >(bpf)
51
TestSignalToNoiseEstimator& operator=(const TestSignalToNoiseEstimator& bpf)
53
if (&bpf==this) return *this;
55
SignalToNoiseEstimator< >::operator=(bpf);
62
virtual void computeSTN_(const PeakIterator& scan_first_, const PeakIterator& scan_last_)
65
if (scan_first_ == scan_last_)
74
START_TEST(SignalToNoiseEstimator, "$Id: SignalToNoiseEstimator_test.C 8210 2011-03-28 13:19:52Z aiche $")
76
/////////////////////////////////////////////////////////////
77
/////////////////////////////////////////////////////////////
79
TestSignalToNoiseEstimator* ptr = 0;
80
TestSignalToNoiseEstimator* nullPointer = 0;
81
START_SECTION((SignalToNoiseEstimator()))
82
ptr = new TestSignalToNoiseEstimator();
83
TEST_NOT_EQUAL(ptr, nullPointer)
87
START_SECTION((SignalToNoiseEstimator(const SignalToNoiseEstimator &source)))
88
TestSignalToNoiseEstimator sne;
90
sne.init(spec.begin(), spec.end());
91
TestSignalToNoiseEstimator sne_copy(sne);
96
START_SECTION((SignalToNoiseEstimator& operator=(const SignalToNoiseEstimator &source)))
97
TestSignalToNoiseEstimator sne;
99
sne.init(spec.begin(), spec.end());
100
TestSignalToNoiseEstimator sne_copy;
106
START_SECTION((virtual ~SignalToNoiseEstimator()))
111
START_SECTION((virtual void init(const PeakIterator& it_begin, const PeakIterator& it_end)))
112
TestSignalToNoiseEstimator sne;
114
sne.init(spec.begin(), spec.end());
118
START_SECTION((virtual void init(const Container& c)))
119
TestSignalToNoiseEstimator sne;
125
START_SECTION((virtual double getSignalToNoise(const PeakIterator& data_point)))
126
// hard to do without implementing computeSTN_ properly
130
START_SECTION((virtual double getSignalToNoise(const PeakType &data_point)))
131
// hard to do without implementing computeSTN_ properly
135
/////////////////////////////////////////////////////////////
136
/////////////////////////////////////////////////////////////