Re: [Boost-bugs] [Boost C++ Libraries] #9925: operators_test.cpp test_left_shiftable is failing due to invalid parameters

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9925: operators_test.cpp test_left_shiftable is failing due to invalid parameters
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-04-21 17:49:06


#9925: operators_test.cpp test_left_shiftable is failing due to invalid parameters
-------------------------------+--------------------------------
  Reporter: chris.cooper@… | Owner: grafik
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: Regression Testing
   Version: Boost 1.54.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------------

Comment (by chris.cooper@…):

 One solution: change the end of test_all() to look like this:


 {{{
         test_incrementable( x1, x2 );
         test_decrementable( x1, x2 );

         // Make sure the right-hand operator to the shift operator is not
 out-of-range.
         if (true_value(y1) < 0)
             y1 = Y1(-true_value(y1));
         unsigned long m1 = sizeof(true_value(x1)) * 8 - 1;
         if (true_value(y1) > m1)
             y1 = Y1(true_value(y1) & m1);

         if (y2 < 0)
             y2 = -y2;
         unsigned long m2 = sizeof(true_value(x2)) * 8 - 1;
         if (y2 > m2)
             y2 = y2 & m2;

         test_left_shiftable( x1, y1, x2, y2 );
         test_right_shiftable( x1, y1, x2, y2 );
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9925#comment:3>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC