MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / limitsDefines

Method limitsDefines

test/testplatform.cpp:427–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425 }
426
427 void limitsDefines() const {
428 Platform platform;
429 ASSERT_EQUALS(true, platform.set(Platform::Unix64));
430 const std::string defs = "CHAR_BIT=8;SCHAR_MIN=-128;SCHAR_MAX=127;UCHAR_MAX=255;CHAR_MIN=0;CHAR_MAX=127;SHRT_MIN=-32768;SHRT_MAX=32767;USHRT_MAX=65535;INT_MIN=(-2147483647 - 1);INT_MAX=2147483647;UINT_MAX=4294967295;LONG_MIN=(-9223372036854775807L - 1L);LONG_MAX=9223372036854775807L;ULONG_MAX=18446744073709551615UL";
431 const std::string defs_c99 = "CHAR_BIT=8;SCHAR_MIN=-128;SCHAR_MAX=127;UCHAR_MAX=255;CHAR_MIN=0;CHAR_MAX=127;SHRT_MIN=-32768;SHRT_MAX=32767;USHRT_MAX=65535;INT_MIN=(-2147483647 - 1);INT_MAX=2147483647;UINT_MAX=4294967295;LONG_MIN=(-9223372036854775807L - 1L);LONG_MAX=9223372036854775807L;ULONG_MAX=18446744073709551615UL;LLONG_MIN=(-9223372036854775807LL - 1LL);LLONG_MAX=9223372036854775807LL;ULLONG_MAX=18446744073709551615ULL";
432 ASSERT_EQUALS(defs, platform.getLimitsDefines(Standards::cstd_t::C89));
433 ASSERT_EQUALS(defs_c99, platform.getLimitsDefines(Standards::cstd_t::C99));
434 ASSERT_EQUALS(defs_c99, platform.getLimitsDefines(Standards::cstd_t::CLatest));
435 ASSERT_EQUALS(defs, platform.getLimitsDefines(Standards::cppstd_t::CPP03));
436 ASSERT_EQUALS(defs_c99, platform.getLimitsDefines(Standards::cppstd_t::CPP11));
437 ASSERT_EQUALS(defs_c99, platform.getLimitsDefines(Standards::cppstd_t::CPPLatest));
438 }
439
440 void charMinMax() const {
441 Platform platform;

Callers

nothing calls this directly

Calls 2

getLimitsDefinesMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected