337 typedef std::vector<unsigned int> numVector;
345 std::string s1(
"0001");
348 stringstream ss1, ss2;
349 ss1 << x0 <<
" " << y0 <<
" " << s1 << std::endl;;
356 test = (x == x0) && (y == y0) && (s1 == s2);
357 nbOk += (
test) ? 1 : 0;
358 trace.
info() <<
"Test 1 " << ((
test) ?
"passed" :
"failed" ) << endl;
362 Point p0, p1(-1,-1), p2(0,-1), p3(1,-1), p4(2,-1), p5(2,0);
363 vector<Point> pointVecRef, pointVecTest;
364 pointVecRef.push_back(p1);
365 pointVecRef.push_back(p2);
366 pointVecRef.push_back(p3);
367 pointVecRef.push_back(p4);
368 pointVecRef.push_back(p5);
370 test = pointVecRef == pointVecTest;
371 nbOk += (
test) ? 1 : 0;
372 trace.
info() <<
"Test 2 " << ((
test) ?
"passed" :
"failed" ) << endl;
376 Point P0(10,10), P1(10,10), P2(10,10), P3(10,10);
380 (P2 ==
Point(9,10) ) && ( P3 ==
Point(10,9) ) ;
381 nbOk += (
test) ? 1 : 0;
382 trace.
info() <<
"Test 3 " << ((
test) ?
"passed" :
"failed" ) << endl;
395 nbOk += (
test) ? 1 : 0;
396 trace.
info() <<
"Test 4 " << ((
test) ?
"passed" :
"failed" ) << endl;
416 nbOk += (
test) ? 1 : 0;
417 trace.
info() <<
"Test 5 " << ((
test) ?
"passed" :
"failed" ) << endl;
433 test = (X[0] == 1) && (Y[0] == 0) && (p0 ==
Point( 1, 0)) &&
434 (X[1] == 0) && (Y[1] == 1) && (p1 ==
Point( 0, 1)) &&
435 (X[2] == -1) && (Y[2] == 0) && (p2 ==
Point(-1, 0)) &&
436 (X[3] == 0) && (Y[3] == -1) && (p3 ==
Point( 0,-1)) ;
437 nbOk += (
test) ? 1 : 0;
438 trace.
info() <<
"Test 6 " << ((
test) ?
"passed" :
"failed" ) << endl;
446 numVector pl2pix, pix2pl;
449 numVector pl2pixExpected;
450 pl2pixExpected.push_back( 0 ); pl2pixExpected.push_back( 1 ); pl2pixExpected.push_back( 2 );
451 pl2pixExpected.push_back( 2 ); pl2pixExpected.push_back( 3 ); pl2pixExpected.push_back( 3 );
452 pl2pixExpected.push_back( 3 ); pl2pixExpected.push_back( 5 ); pl2pixExpected.push_back( 7 );
453 pl2pixExpected.push_back( 7 ); pl2pixExpected.push_back( 7 ); pl2pixExpected.push_back( 8 );
454 numVector pix2plExpected;
455 pix2plExpected.push_back( 0 ); pix2plExpected.push_back( 1 ); pix2plExpected.push_back( 3 );
456 pix2plExpected.push_back( 6 ); pix2plExpected.push_back( 7 ); pix2plExpected.push_back( 7 );
457 pix2plExpected.push_back( 8 ); pix2plExpected.push_back( 10 );
459 ( pl2pix == pl2pixExpected ) &&
460 ( pix2pl == pix2plExpected );
461 nbOk += (
test) ? 1 : 0;
462 trace.
info() <<
"Test 7 " << ((
test) ?
"passed" :
"failed" ) << endl;
471 numVector outer2inner, inner2outer;
474 ( outer2inner == pl2pixExpected ) &&
475 ( inner2outer == pix2plExpected );
476 nbOk += (
test) ? 1 : 0;
477 trace.
info() <<
"Test 8 " << ((
test) ?
"passed" :
"failed" ) << endl;
486 numVector c2clean, clean2c;
490 numVector c2cleanExpected;
491 c2cleanExpected.push_back( 5 ); c2cleanExpected.push_back( 6 ); c2cleanExpected.push_back( 7 );
492 c2cleanExpected.push_back( 8 ); c2cleanExpected.push_back( 9 ); c2cleanExpected.push_back(10 );
493 c2cleanExpected.push_back(11 ); c2cleanExpected.push_back(12 ); c2cleanExpected.push_back(13 );
494 c2cleanExpected.push_back( 0 ); c2cleanExpected.push_back( 1 ); c2cleanExpected.push_back( 2 );
495 c2cleanExpected.push_back( 2 ); c2cleanExpected.push_back( 2 ); c2cleanExpected.push_back( 3 );
496 c2cleanExpected.push_back( 4 );
497 numVector clean2cExpected;
498 clean2cExpected.push_back( 9 ); clean2cExpected.push_back(10 ); clean2cExpected.push_back(13 );
499 clean2cExpected.push_back(14 ); clean2cExpected.push_back(15 ); clean2cExpected.push_back( 0 );
500 clean2cExpected.push_back( 1 ); clean2cExpected.push_back( 2 ); clean2cExpected.push_back( 3 );
501 clean2cExpected.push_back( 4 ); clean2cExpected.push_back( 5 ); clean2cExpected.push_back( 6 );
502 clean2cExpected.push_back( 7 ); clean2cExpected.push_back( 8 );
503 test = cleaned && (cleanC == cleanCExpected) && (c2clean == c2cleanExpected)
504 && (clean2c == clean2cExpected);
505 nbOk += (
test) ? 1 : 0;
506 trace.
info() <<
"Test 9 " << ((
test) ?
"passed" :
"failed" ) << endl;
507 trace.
info() <<
"All tests="<<nbOk<<std::endl;
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.