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

« back to all changes in this revision

Viewing changes to source/TEST/GaussFitter1D_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: Clemens Groepl $
 
25
// $Authors: $
 
26
// --------------------------------------------------------------------------
 
27
 
 
28
#include <OpenMS/CONCEPT/ClassTest.h>
 
29
 
 
30
///////////////////////////
 
31
 
 
32
#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/GaussFitter1D.h>
 
33
 
 
34
///////////////////////////
 
35
 
 
36
using namespace OpenMS;
 
37
using namespace std;
 
38
 
 
39
START_TEST(GaussFitter1D, "$Id: GaussFitter1D_test.C 8210 2011-03-28 13:19:52Z aiche $")
 
40
 
 
41
/////////////////////////////////////////////////////////////
 
42
/////////////////////////////////////////////////////////////
 
43
 
 
44
GaussFitter1D* ptr = 0;
 
45
GaussFitter1D* nullPointer = 0;
 
46
START_SECTION(GaussFitter1D())
 
47
{
 
48
        ptr = new GaussFitter1D();
 
49
  TEST_EQUAL(ptr->getName(), "GaussFitter1D")
 
50
        TEST_NOT_EQUAL(ptr, nullPointer)
 
51
}
 
52
END_SECTION
 
53
 
 
54
START_SECTION((GaussFitter1D(const  GaussFitter1D &source)))
 
55
        GaussFitter1D gf1;
 
56
        
 
57
        Param param;
 
58
        param.setValue( "tolerance_stdev_bounding_box", 1.0);
 
59
  param.setValue( "statistics:mean", 680.1 );
 
60
  param.setValue( "statistics:variance", 2.0 );
 
61
  param.setValue( "interpolation_step", 1.0 );
 
62
        gf1.setParameters(param);
 
63
 
 
64
        GaussFitter1D gf2(gf1);
 
65
  GaussFitter1D gf3;
 
66
        gf3.setParameters(param);
 
67
  gf1 = GaussFitter1D();
 
68
        TEST_EQUAL(gf3.getParameters(), gf2.getParameters())
 
69
END_SECTION
 
70
 
 
71
START_SECTION((virtual ~GaussFitter1D()))
 
72
        delete ptr;
 
73
END_SECTION
 
74
 
 
75
START_SECTION((virtual GaussFitter1D& operator=(const  GaussFitter1D &source)))
 
76
        GaussFitter1D gf1;
 
77
        
 
78
        Param param;
 
79
        param.setValue( "tolerance_stdev_bounding_box", 1.0);
 
80
  param.setValue( "statistics:mean", 680.1 );
 
81
  param.setValue( "statistics:variance", 2.0 );
 
82
  param.setValue( "interpolation_step", 1.0 );
 
83
        gf1.setParameters(param);
 
84
 
 
85
  GaussFitter1D gf2;
 
86
  gf2 = gf1;
 
87
 
 
88
  GaussFitter1D gf3;
 
89
        gf3.setParameters(param);
 
90
 
 
91
  gf1 = GaussFitter1D();
 
92
        TEST_EQUAL(gf3.getParameters(), gf2.getParameters())
 
93
END_SECTION
 
94
 
 
95
START_SECTION((QualityType fit1d(const  RawDataArrayType &range, InterpolationModel *&model)))
 
96
        // dummy subtest
 
97
        TEST_EQUAL(1,1)
 
98
END_SECTION
 
99
 
 
100
START_SECTION((Fitter1D* create()))
 
101
{
 
102
  Fitter1D* ptr = GaussFitter1D::create();
 
103
  TEST_EQUAL(ptr->getName(), "GaussFitter1D")
 
104
        TEST_NOT_EQUAL(ptr, nullPointer)
 
105
}
 
106
END_SECTION
 
107
 
 
108
START_SECTION((const String getProductName()))
 
109
{
 
110
  TEST_EQUAL(GaussFitter1D::getProductName(),"GaussFitter1D")
 
111
  TEST_EQUAL(GaussFitter1D().getName(),"GaussFitter1D")
 
112
}
 
113
END_SECTION
 
114
 
 
115
 
 
116
/////////////////////////////////////////////////////////////
 
117
/////////////////////////////////////////////////////////////
 
118
END_TEST
 
119
 
 
120
 
 
121