32#include "DGtal/base/Common.h"
33#include "DGtal/base/BasicBoolFunctors.h"
40#define INBLOCK_TEST(x) \
41 nbok += ( x ) ? 1 : 0; \
43 trace.info() << "(" << nbok << "/" << nb << ") " \
46#define INBLOCK_TEST2(x,y) \
47 nbok += ( x ) ? 1 : 0; \
49 trace.info() << "(" << nbok << "/" << nb << ") " \
61 unsigned int nbok = 0;
66 nbok +=
trueBF0() ==
true ? 1 : 0;
68 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
69 <<
"true() == true" << std::endl;
74 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
75 <<
"false() == false" << std::endl;
80 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
81 <<
"id(true) == true" << std::endl;
84 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
85 <<
"id(false) == false" << std::endl;
88 nbok +=
notBF1(
true ) ==
false ? 1 : 0;
90 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
91 <<
"not(true) == false" << std::endl;
92 nbok +=
notBF1(
false ) ==
true ? 1 : 0;
94 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
95 <<
"not(false) == true" << std::endl;
98 nbok +=
andBF2(
true,
true ) ==
true ? 1 : 0;
100 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
101 <<
"and( true, true ) == true" << std::endl;
102 nbok +=
andBF2(
false,
true ) ==
false ? 1 : 0;
104 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
105 <<
"and( false, true ) == false" << std::endl;
106 nbok +=
andBF2(
true,
false ) ==
false ? 1 : 0;
108 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
109 <<
"and( true, false ) == false" << std::endl;
110 nbok +=
andBF2(
false,
false ) ==
false ? 1 : 0;
112 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
113 <<
"and( false, false ) == false" << std::endl;
116 nbok +=
orBF2(
true,
true ) ==
true ? 1 : 0;
118 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
119 <<
"or( true, true ) == true" << std::endl;
120 nbok +=
orBF2(
false,
true ) ==
true ? 1 : 0;
122 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
123 <<
"or( false, true ) == true" << std::endl;
124 nbok +=
orBF2(
true,
false ) ==
true ? 1 : 0;
126 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
127 <<
"or( true, false ) == true" << std::endl;
128 nbok +=
orBF2(
false,
false ) ==
false ? 1 : 0;
130 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
131 <<
"or( false, false ) == true" << std::endl;
141 "implies( true, true ) == true" );
143 "implies( false, true ) == true" );
145 "implies( true, false ) == false" );
147 "implies( false, false ) == true" );
157int main(
int argc,
char** argv )
161 for (
int i = 0; i < argc; ++i )
166 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
void beginBlock(const std::string &keyword="")
functors namespace gathers all DGtal functors.
static const BoolFunctor1 notBF1
static const BoolFunctor2 andBF2
static const BoolFunctor1 identityBF1
static const BoolFunctor0 falseBF0
static const BoolFunctor2 impliesBF2
static const BoolFunctor0 trueBF0
static const BoolFunctor2 xorBF2
static const BoolFunctor2 orBF2
DGtal is the top-level namespace which contains all DGtal functions and types.
bool testBasicBoolFunctors()
#define INBLOCK_TEST2(x, y)