Disabled random operators tests under UBSAN.

The tests use random input to various arithmetic and bitwise operators,
which cause undefined behavior, such as shifting by more than the left
operand capacity or signed integer overflows.
This commit is contained in:
Andrey Semashev
2021-09-16 02:12:41 +03:00
parent a04a0d9531
commit 3f51807f24

View File

@ -28,7 +28,6 @@
#include <iostream> // for std::cout (std::endl indirectly)
namespace
{
// avoiding a template version of true_value so as to not confuse VC++
@ -615,6 +614,8 @@ main()
cout << "Created point, and operated on it." << endl;
#if !defined(UBSAN)
// Using random values produce UB in various tests, such as shifting by more than the left operand capacity or signed integer overflows
for (int n = 0; n < 1000; ++n) // was 10,000 but took too long (Beman)
{
boost::detail::minstd_rand r;
@ -640,6 +641,7 @@ main()
}
cout << "Did random tester loop." << endl;
#endif // !defined(UBSAN)
MyInt i1(1);
MyInt i2(2);