33 #include "DGtal/base/Common.h"
34 #include "DGtal/helpers/Parameters.h"
36 #include "DGtalCatch.h"
40 using namespace DGtal;
47 SCENARIO(
"Parameters decimal conversion tests",
"[parameters]" )
49 GIVEN(
"A Parameters object" ) {
51 WHEN(
"initialized with strings" ) {
52 params(
"foo",
"bar" )(
"Laurel",
"Hardy" );
53 THEN(
"it does store strings" ) {
54 REQUIRE( params[
"foo" ].as<string>() ==
"bar" );
55 REQUIRE( params[
"Laurel" ].as<string>() ==
"Hardy" );
58 WHEN(
"initialized with integers" ) {
59 params(
"prime", 7 )(
"negative-int", -2 );
60 THEN(
"it does store ints" ) {
61 REQUIRE( params[
"prime" ].as<int>() == 7 );
62 REQUIRE( params[
"negative-int" ].as<int>() == -2 );
65 WHEN(
"initialized with doubles" ) {
66 params(
"pi", 3.14159 )(
"planck", 6.62607004e-34 )(
"g", 9.80665 );
67 THEN(
"it does store ints" ) {
68 REQUIRE( params[
"pi" ].as<double>() == Approx( 3.14159 ) );
69 REQUIRE( params[
"planck" ].as<double>() == Approx( 6.62607004e-34 ) );
70 REQUIRE( params[
"g" ].as<double>() == Approx( 9.80665 ) );
DGtal is the top-level namespace which contains all DGtal functions and types.
GIVEN("A cubical complex with random 3-cells")
SCENARIO("Parameters decimal conversion tests", "[parameters]")
REQUIRE(domain.isInside(aPoint))