DGtal  1.4.beta
testProfile.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "ConfigTest.h"
#include "DGtalCatch.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/math/Profile.h"
Include dependency graph for testProfile.cpp:

Go to the source code of this file.

## Functions

TEST_CASE ("Testing Profile")

## Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Date
2015/11/08

Functions for testing class Profile.

This file is part of the DGtal library.

Definition in file testProfile.cpp.

## ◆ TEST_CASE()

 TEST_CASE ( "Testing Profile" )

Definition at line 52 of file testProfile.cpp.

53 {
54
56  sp.init(5);
57
58  SECTION("Testing basic add of Profile")
59  {
65  std::vector<double> x;
66  std::vector<double> y;
67  sp.getProfile(x, y);
68  REQUIRE( x[3] == Approx(log(4)) );
69  REQUIRE( y[3] == Approx(log(10.0)) );
70  }
71
73  sp2.init(3, true);
74
75  SECTION("Testing Profile (with max/median)")
76  {
84  std::vector<double> x;
85  std::vector<double> y;
86  sp2.getProfile(x, y);
87  REQUIRE( x[0] == 1 );
88  REQUIRE( y[0] == 3);
89  sp2.setType(Profile<>::MIN);
90  x.clear();
91  y.clear();
92  sp2.getProfile(x, y);
93  REQUIRE( x[1] == 2 );
94  REQUIRE( y[1] == 1);
95  sp2.setType(Profile<>::MEDIAN);
96  x.clear();
97  y.clear();
98  sp2.getProfile(x, y);
99  REQUIRE( x[0] == 1 );
100  REQUIRE( y[0] == 2);
101  }
102
103 }
Aim: This class can be used to represent a profile (PX, PY) defined from an input set of samples (Xi,...
Definition: Profile.h:137
SECTION("Testing constant forward iterators")
REQUIRE(domain.isInside(aPoint))