32 #include "DGtal/kernel/PointVector.h"
33 #include "DGtal/kernel/IntegerConverter.h"
34 #include "DGtalCatch.h"
38 using namespace DGtal;
45 SCENARIO(
"Integer types sizes",
"[integer_conversions]" )
47 WHEN(
"Checking integral types" ) {
48 THEN(
"Integral types are progressive" ) {
53 REQUIRE(
sizeof(
int ) <=
sizeof(
long ) );
54 REQUIRE(
sizeof(
long ) <=
sizeof(
long long ) );
55 REQUIRE(
sizeof(
long long ) == 8 );
59 SCENARIO(
"IntegerConverter< 1, int32 >",
"[integer_conversions]" )
65 WHEN(
"Converting small integers" ) {
69 THEN(
"Their values are all identical" ) {
75 WHEN(
"Converting medium integers" ) {
78 THEN(
"The value is lost with a warning" ) {
84 SCENARIO(
"IntegerConverter< 1, int64 >",
"[integer_conversions]" )
90 WHEN(
"Converting 64bits integers" ) {
94 THEN(
"Only bigger integers are identical" ) {
100 THEN(
"It gives the same results with NumberTraits" ) {
111 SCENARIO(
"IntegerConverter< 1, BigInteger >",
"[integer_conversions]" )
117 big_int32 *= big_int32;
118 big_int64 *= big_int64;
119 big_bigint *= big_bigint;
120 WHEN(
"Converting big integers" ) {
125 detail::mpz_set_sll( b_prime.get_mpz_t(), big_int64 );
126 THEN(
"Only bigger integers are identical" ) {
DGtal is the top-level namespace which contains all DGtal functions and types.
boost::int64_t int64_t
signed 94-bit integer.
boost::int32_t int32_t
signed 32-bit integer.
mpz_class BigInteger
Multi-precision integer with GMP implementation.
----------— INTEGER/POINT CONVERSION SERVICES -----------------—
Aim: The traits class for all models of Cinteger.
SCENARIO("Integer types sizes", "[integer_conversions]")
REQUIRE(domain.isInside(aPoint))