~ubuntu-branches/ubuntu/wily/openms/wily

« back to all changes in this revision

Viewing changes to source/TEST/SignalToNoiseEstimator_test.C

  • Committer: Package Import Robot
  • Author(s): Filippo Rusconi
  • Date: 2012-11-12 15:58:12 UTC
  • Revision ID: package-import@ubuntu.com-20121112155812-vr15wtg9b50cuesg
Tags: upstream-1.9.0
ImportĀ upstreamĀ versionĀ 1.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- mode: C++; tab-width: 2; -*-
 
2
// vi: set ts=2:
 
3
//
 
4
// --------------------------------------------------------------------------
 
5
//                   OpenMS Mass Spectrometry Framework
 
6
// --------------------------------------------------------------------------
 
7
//  Copyright (C) 2003-2011 -- Oliver Kohlbacher, Knut Reinert
 
8
//
 
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.
 
13
//
 
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.
 
18
//
 
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
 
22
//
 
23
// --------------------------------------------------------------------------
 
24
// $Maintainer: Chris Bielow $
 
25
// $Authors: $
 
26
// --------------------------------------------------------------------------
 
27
 
 
28
#include <OpenMS/CONCEPT/ClassTest.h>
 
29
 
 
30
///////////////////////////
 
31
#include <OpenMS/FILTERING/NOISEESTIMATION/SignalToNoiseEstimator.h>
 
32
///////////////////////////
 
33
 
 
34
using namespace OpenMS;
 
35
using namespace std;
 
36
 
 
37
class TestSignalToNoiseEstimator
 
38
  : public SignalToNoiseEstimator< >
 
39
{
 
40
  public:
 
41
  TestSignalToNoiseEstimator()
 
42
    : SignalToNoiseEstimator< >()
 
43
  {
 
44
  }
 
45
 
 
46
  TestSignalToNoiseEstimator(const TestSignalToNoiseEstimator& bpf)
 
47
  : SignalToNoiseEstimator< >(bpf)
 
48
  {
 
49
  }
 
50
 
 
51
  TestSignalToNoiseEstimator& operator=(const TestSignalToNoiseEstimator& bpf)
 
52
  {
 
53
    if (&bpf==this) return *this;
 
54
 
 
55
    SignalToNoiseEstimator< >::operator=(bpf);
 
56
 
 
57
    return *this;
 
58
  }
 
59
 
 
60
  protected:
 
61
 
 
62
  virtual void computeSTN_(const PeakIterator& scan_first_, const PeakIterator& scan_last_)
 
63
      throw()
 
64
  {
 
65
    if (scan_first_ == scan_last_)
 
66
    {
 
67
      std::cout << "bla";
 
68
    }
 
69
    // do nothing here...
 
70
  }
 
71
 
 
72
};
 
73
 
 
74
START_TEST(SignalToNoiseEstimator, "$Id: SignalToNoiseEstimator_test.C 8210 2011-03-28 13:19:52Z aiche $")
 
75
 
 
76
/////////////////////////////////////////////////////////////
 
77
/////////////////////////////////////////////////////////////
 
78
 
 
79
TestSignalToNoiseEstimator* ptr = 0;
 
80
TestSignalToNoiseEstimator* nullPointer = 0;
 
81
START_SECTION((SignalToNoiseEstimator()))
 
82
        ptr = new TestSignalToNoiseEstimator();
 
83
        TEST_NOT_EQUAL(ptr, nullPointer)
 
84
END_SECTION
 
85
 
 
86
 
 
87
START_SECTION((SignalToNoiseEstimator(const SignalToNoiseEstimator &source)))
 
88
  TestSignalToNoiseEstimator sne;
 
89
  MSSpectrum<> spec;
 
90
  sne.init(spec.begin(), spec.end());
 
91
  TestSignalToNoiseEstimator sne_copy(sne);
 
92
        NOT_TESTABLE
 
93
END_SECTION
 
94
 
 
95
 
 
96
START_SECTION((SignalToNoiseEstimator& operator=(const SignalToNoiseEstimator &source)))
 
97
  TestSignalToNoiseEstimator sne;
 
98
  MSSpectrum<> spec;
 
99
  sne.init(spec.begin(), spec.end());
 
100
  TestSignalToNoiseEstimator sne_copy;
 
101
  sne_copy = sne;
 
102
        NOT_TESTABLE
 
103
END_SECTION
 
104
 
 
105
 
 
106
START_SECTION((virtual ~SignalToNoiseEstimator()))
 
107
        delete ptr;
 
108
END_SECTION
 
109
 
 
110
 
 
111
START_SECTION((virtual void init(const PeakIterator& it_begin, const PeakIterator& it_end)))
 
112
  TestSignalToNoiseEstimator sne;
 
113
  MSSpectrum<> spec;
 
114
  sne.init(spec.begin(), spec.end());
 
115
        NOT_TESTABLE
 
116
END_SECTION
 
117
 
 
118
START_SECTION((virtual void init(const Container& c)))
 
119
  TestSignalToNoiseEstimator sne;
 
120
  MSSpectrum<> spec;
 
121
  sne.init(spec);
 
122
        NOT_TESTABLE
 
123
END_SECTION
 
124
 
 
125
START_SECTION((virtual double getSignalToNoise(const PeakIterator& data_point)))
 
126
  // hard to do without implementing computeSTN_ properly
 
127
        NOT_TESTABLE
 
128
END_SECTION
 
129
 
 
130
START_SECTION((virtual double getSignalToNoise(const PeakType &data_point)))
 
131
  // hard to do without implementing computeSTN_ properly
 
132
        NOT_TESTABLE
 
133
END_SECTION
 
134
 
 
135
/////////////////////////////////////////////////////////////
 
136
/////////////////////////////////////////////////////////////
 
137
END_TEST
 
138
 
 
139