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: Andreas Bertsch $
25
// $Authors: Andreas Bertsch $
26
// --------------------------------------------------------------------------
29
#include <OpenMS/CONCEPT/ClassTest.h>
31
///////////////////////////
33
#include <OpenMS/FILTERING/TRANSFORMERS/IsotopeDiffFilter.h>
34
#include <OpenMS/KERNEL/StandardTypes.h>
35
#include <OpenMS/FORMAT/DTAFile.h>
37
using namespace OpenMS;
40
///////////////////////////
42
START_TEST(IsotopeDiffFilter, "$Id: IsotopeDiffFilter_test.C 8215 2011-03-29 14:18:26Z aiche $")
44
/////////////////////////////////////////////////////////////
46
IsotopeDiffFilter* e_ptr = 0;
47
IsotopeDiffFilter* e_nullPointer = 0;
49
START_SECTION((IsotopeDiffFilter()))
50
e_ptr = new IsotopeDiffFilter;
51
TEST_NOT_EQUAL(e_ptr, e_nullPointer)
54
START_SECTION((~IsotopeDiffFilter()))
58
e_ptr = new IsotopeDiffFilter();
60
START_SECTION((IsotopeDiffFilter(const IsotopeDiffFilter& source)))
61
IsotopeDiffFilter copy(*e_ptr);
62
TEST_EQUAL(copy.getParameters(), e_ptr->getParameters())
63
TEST_EQUAL(copy.getName(), e_ptr->getName())
66
START_SECTION((IsotopeDiffFilter& operator = (const IsotopeDiffFilter& source)))
67
IsotopeDiffFilter copy;
69
TEST_EQUAL(copy.getParameters(), e_ptr->getParameters())
70
TEST_EQUAL(copy.getName(), e_ptr->getName())
73
START_SECTION((template<typename SpectrumType> double apply(SpectrumType& spectrum)))
76
dta_file.load(OPENMS_GET_TEST_DATA_PATH("Transformers_tests.dta"), spec);
78
double filter = e_ptr->apply(spec);
79
TEST_REAL_SIMILAR(filter, 0.0)
81
Param p(e_ptr->getParameters());
82
p.setValue("tolerance", 10.0);
83
e_ptr->setParameters(p);
84
filter = e_ptr->apply(spec);
85
TEST_REAL_SIMILAR(filter, 2162)
88
START_SECTION((static FilterFunctor* create()))
89
FilterFunctor* ff = IsotopeDiffFilter::create();
90
IsotopeDiffFilter filter;
91
TEST_EQUAL(ff->getParameters(), filter.getParameters())
92
TEST_EQUAL(ff->getName(), filter.getName())
95
START_SECTION((static const String getProductName()))
96
TEST_EQUAL(e_ptr->getProductName(), "IsotopeDiffFilter")
101
/////////////////////////////////////////////////////////////
102
/////////////////////////////////////////////////////////////