Add self-assignment test, sans the compiler warning
This commit is contained in:
parent
79886b2e35
commit
04c393a53a
1 changed files with 4 additions and 0 deletions
|
|
@ -46,6 +46,10 @@ BOOST_AUTO_TEST_CASE(bigint_test_2)
|
|||
BOOST_CHECK( bi_accu >= a_1 );
|
||||
} while ( bi_accu.log2() <= 128 );
|
||||
|
||||
// Test self-assignment (a=a) has no effect, but throw in some arcanity to avoid a compiler warning
|
||||
const volatile auto* bi_accu_self = &bi_accu;
|
||||
bi_accu = const_cast<fc::bigint&>(*bi_accu_self);
|
||||
|
||||
BOOST_CHECK( bi_accu && !bi_accu.is_negative() && bi_accu != bi_1 );
|
||||
|
||||
BOOST_CHECK( bi_3.exp( bi_accu.log2() ) > bi_accu );
|
||||
|
|
|
|||
Loading…
Reference in a new issue