summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/safe_numerics/test/test_checked_left_shift.hpp
blob: 61d949a73dd3b60d2caa352869def122d7f714aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef BOOST_SAFE_NUMERICS_TEST_CHECKED_LEFT_SHIFT_HPP
#define BOOST_SAFE_NUMERICS_TEST_CHECKED_LEFT_SHIFT_HPP

//  Copyright (c) 2018 Robert Ramey
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#include "test_checked_values.hpp"

// test result matrices

// key
// . success
// - negative_overflow_error
// + positive_overflow_error
// ! range_error
// n negative_shift,             // negative value in shift operator
// s negative_value_shift,       // shift a negative value
// l shift_too_large,            // l/r shift exceeds variable size

constexpr char const * const signed_left_shift_results[] = {
//      012345678
/* 0*/ "!!!!!!!!!",
/* 1*/ "!!!!!!!!!",
/* 2*/ "!!++++++!",
/* 3*/ "!!+++....",
/* 4*/ "!!++.....",
/* 5*/ ".........",
/* 6*/ "!!--.....",
/* 7*/ "!!---....",
/* 8*/ "!!------!",
};

constexpr char const * const unsigned_left_shift_results[] = {
//      0123456
/* 0*/ "!!!!!!!",
/* 1*/ "!!!!!!!",
/* 2*/ "!!++++!",
/* 3*/ "!!+++..",
/* 4*/ "!!++...",
/* 5*/ ".......",
/* 6*/ "!!----!",
};

#endif // BOOST_SAFE_NUMERICS_TEST_CHECKED_LEFT_SHIFT_HPP