| 1 | #ifndef BOOST_SAFE_NUMERICS_TEST_CHECKED_RIGHT_SHIFT_HPP |
| 2 | #define BOOST_SAFE_NUMERICS_TEST_CHECKED_RIGHT_SHIFT_HPP |
| 3 | |
| 4 | // Copyright (c) 2018 Robert Ramey |
| 5 | // |
| 6 | // Distributed under the Boost Software License, Version 1.0. (See |
| 7 | // accompanying file LICENSE_1_0.txt or copy at |
| 8 | // http://www.boost.org/LICENSE_1_0.txt) |
| 9 | |
| 10 | #include "test_checked_values.hpp" |
| 11 | |
| 12 | // test result matrices |
| 13 | |
| 14 | // key |
| 15 | // . success |
| 16 | // - negative_overflow_error |
| 17 | // + positive_overflow_error |
| 18 | // ? range_error |
| 19 | // n negative_shift, // negative value in shift operator |
| 20 | // s negative_value_shift, // shift a negative value |
| 21 | // l shift_too_large, // l/r shift exceeds variable size |
| 22 | |
| 23 | constexpr char const * const signed_right_shift_results[] = { |
| 24 | // 012345678 |
| 25 | /* 0*/ "!!!!!!!!!" , |
| 26 | /* 1*/ "!!!!!!!!!" , |
| 27 | /* 2*/ "!!!++++++" , |
| 28 | /* 3*/ "!!....+++" , |
| 29 | /* 4*/ "!!.....++" , |
| 30 | /* 5*/ "........." , |
| 31 | /* 6*/ "!!.....--" , |
| 32 | /* 7*/ "!!....---" , |
| 33 | /* 8*/ "!!!------" , |
| 34 | }; |
| 35 | |
| 36 | constexpr char const * const unsigned_right_shift_results[] = { |
| 37 | // 0123456 |
| 38 | /* 0*/ "!!!!!!!" , |
| 39 | /* 1*/ "!!!!!!!" , |
| 40 | /* 2*/ "!!!++++" , |
| 41 | /* 3*/ "!!....+" , |
| 42 | /* 4*/ "!!....+" , |
| 43 | /* 5*/ "......." , |
| 44 | /* 6*/ "!!!----" , |
| 45 | }; |
| 46 | |
| 47 | #endif // BOOST_SAFE_NUMERICS_TEST_CHECKED_RIGHT_SHIFT_HPP |
| 48 | |