60 unsigned int nbok = 0;
69 nbok += ( f(a) == 5 ) ? 1 : 0;
77 nbok += ( f(c) == v ) ? 1 : 0;
80 nbok += ( f(d) == v ) ? 1 : 0;
88 nbok += ( f(c) == 97 ) ? 1 : 0;
94 const double v1 = -3.5;
95 const double v2 = 3.5;
113 double (*pF)(double) = &floor;
114 double (*pC)(double) = &ceil;
115 std::function<double(
double)> f = pF;
116 std::function<double(
double)> c = pC;
125 nbok += ( q(d) == 5 ) ? 1 : 0;
129 nbok += ( q2(d) == 6 ) ? 1 : 0;
137 std::function<int(
int)> b = std::bind(std::minus<int>(), std::placeholders::_1, 0);
139 nbok += ( b(i) == -5 ) ? 1 : 0;
142 auto b2 = [](
int v) ->
int {
146 nbok += ( b2(i) == -3 ) ? 1 : 0;
153 nbok += ( t(i) == true ) ? 1 : 0;
156 nbok += ( t1(i) == true ) ? 1 : 0;
159 nbok += ( t2(0) == false ) ? 1 : 0;
162 nbok += ( t3(i) == false ) ? 1 : 0;
165 nbok += ( t4(i) == false ) ? 1 : 0;
173 nbok += ( t(0) == false ) ? 1 : 0;
175 for (
int i = low; i <= up; ++i)
177 nbok += ( t(i) == true ) ? 1 : 0;
180 nbok += ( t(6) == false ) ? 1 : 0;
185 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
194int main(
int argc,
char** argv )
198 for (
int i = 0; i < argc; ++i )
203 basicFunctorsConceptChecking<functors::Identity,int,int>();
204 basicFunctorsConceptChecking<DGtal::functors::ConstValue<int>,int,
int >();
205 basicFunctorsConceptChecking<functors::Cast<int>,short,
int >();
206 basicFunctorsConceptChecking<DGtal::functors::Thresholder<int>,int,
bool >();
207 basicFunctorsConceptChecking<functors::Composer<functors::ConstValue<double>,
functors::Cast<int>,
int>,char,
int >();
212 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;