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/GoodDiffFilter.h>
34
#include <OpenMS/KERNEL/StandardTypes.h>
35
#include <OpenMS/FORMAT/DTAFile.h>
37
using namespace OpenMS;
40
///////////////////////////
42
START_TEST(GoodDiffFilter, "$Id: GoodDiffFilter_test.C 8215 2011-03-29 14:18:26Z aiche $")
44
/////////////////////////////////////////////////////////////
46
GoodDiffFilter* e_ptr = 0;
47
GoodDiffFilter* e_nullPointer = 0;
49
START_SECTION((GoodDiffFilter()))
50
e_ptr = new GoodDiffFilter;
51
TEST_NOT_EQUAL(e_ptr, e_nullPointer)
54
START_SECTION((~GoodDiffFilter()))
58
e_ptr = new GoodDiffFilter();
60
START_SECTION((GoodDiffFilter(const GoodDiffFilter& source)))
61
GoodDiffFilter copy(*e_ptr);
62
TEST_EQUAL(copy.getParameters(), e_ptr->getParameters())
63
TEST_EQUAL(copy.getName(), e_ptr->getName())
66
START_SECTION((GoodDiffFilter& operator=(const GoodDiffFilter& source)))
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);
77
TOLERANCE_ABSOLUTE(0.01)
79
double filter = e_ptr->apply(spec);
81
TEST_REAL_SIMILAR(filter, 0.104879)
83
Param p(e_ptr->getParameters());
84
p.setValue("tolerance", 10.0);
85
e_ptr->setParameters(p);
86
filter = e_ptr->apply(spec);
88
TEST_REAL_SIMILAR(filter, 0.811684)
91
START_SECTION((static FilterFunctor* create()))
92
FilterFunctor* ff = GoodDiffFilter::create();
94
TEST_EQUAL(ff->getParameters(), good.getParameters())
95
TEST_EQUAL(ff->getName(), good.getName())
98
START_SECTION((static const String getProductName()))
99
TEST_EQUAL(e_ptr->getProductName(), "GoodDiffFilter")
104
/////////////////////////////////////////////////////////////
105
/////////////////////////////////////////////////////////////