32#include "DGtal/kernel/PointVector.h"
33#include "DGtal/kernel/IntegerConverter.h"
34#include "DGtalCatch.h"
45SCENARIO(
"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 );
59SCENARIO(
"IntegerConverter< 1, int32 >",
"[integer_conversions]" )
67 WHEN(
"Converting small integers" ) {
73 THEN(
"Their values are all identical" ) {
81 WHEN(
"Converting medium integers" ) {
84 THEN(
"The value is lost with a warning" ) {
90SCENARIO(
"IntegerConverter< 1, int64 >",
"[integer_conversions]" )
95 #ifdef WITH_BIGINTEGER
98 WHEN(
"Converting 64bits integers" ) {
101 #ifdef WITH_BIGINTEGER
104 THEN(
"Only bigger integers are identical" ) {
108#ifdef WITH_BIGINTEGER
112 THEN(
"It gives the same results with NumberTraits" ) {
115#ifdef WITH_BIGINTEGER
120#ifdef WITH_BIGINTEGER
128#ifdef WITH_BIGINTEGER
129SCENARIO(
"IntegerConverter< 1, BigInteger >",
"[integer_conversions]" )
135 big_int32 *= big_int32;
136 big_int64 *= big_int64;
137 big_bigint *= big_bigint;
138 WHEN(
"Converting big integers" ) {
144 THEN(
"Only bigger integers are identical" ) {
static void mpz_set_sll(mpz_t n, long long sll)
----------— GMP SPECIALIZED SERVICES -------------------------—
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.
REQUIRE(domain.isInside(aPoint))
SCENARIO("UnorderedSetByBlock< PointVector< 2, int > unit tests with 32 bits blocks", "[unorderedsetbyblock][2d]")