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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
|
Bug: https://github.com/ETLCPP/etl/pull/1006
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1091157
diff --git a/test/test_bit_stream.cpp b/test/test_bit_stream.cpp
index c0cbd251..9aee68a9 100644
--- a/test/test_bit_stream.cpp
+++ b/test/test_bit_stream.cpp
@@ -930,8 +930,8 @@ namespace
//*************************************************************************
TEST(put_get_multiple_variable_size)
{
- char c1 = 26; // 6 bits
- char c2 = -10; // 7 bits
+ signed char c1 = 26; // 6 bits
+ signed char c2 = -10; // 7 bits
unsigned short s1 = 6742; // 13 bits
unsigned short s2 = 1878; // 11 bits
int32_t i1 = 2448037L; // 23 bits
@@ -983,8 +983,8 @@ namespace
bit_stream.restart();
- char rc1 = 0;
- char rc2 = 0;
+ signed char rc1 = 0;
+ signed char rc2 = 0;
unsigned short rs1 = 0;
unsigned short rs2 = 0;
int32_t ri1 = 0;
diff --git a/test/test_bit_stream_reader_big_endian.cpp b/test/test_bit_stream_reader_big_endian.cpp
index 4cdf3d29..c4ae014c 100644
--- a/test/test_bit_stream_reader_big_endian.cpp
+++ b/test/test_bit_stream_reader_big_endian.cpp
@@ -210,7 +210,7 @@ namespace
TEST(test_read_int8_t)
{
std::array<char, 4U> storage = { char(0x01), char(0x5A), char(0xA5), char(0xFF) };
- std::array<char, 4U> expected = { int8_t(0x01), int8_t(0x5A), int8_t(0xA5), int8_t(0xFF) };
+ std::array<signed char, 4U> expected = { int8_t(0x01), int8_t(0x5A), int8_t(0xA5), int8_t(0xFF) };
etl::bit_stream_reader bit_stream(storage.data(), storage.size(), etl::endian::big);
@@ -246,7 +246,7 @@ namespace
TEST(test_read_checked_int8_t_using_non_member_function)
{
std::array<char, 4U> storage = { char(0x01), char(0x5A), char(0xA5), char(0xFF) };
- std::array<char, 4U> expected = { int8_t(0x01), int8_t(0x5A), int8_t(0xA5), int8_t(0xFF) };
+ std::array<signed char, 4U> expected = { int8_t(0x01), int8_t(0x5A), int8_t(0xA5), int8_t(0xFF) };
etl::bit_stream_reader bit_stream(storage.data(), storage.size(), etl::endian::big);
@@ -282,7 +282,7 @@ namespace
TEST(test_read_unchecked_int8_t_using_non_member_function)
{
std::array<char, 4U> storage = { char(0x01), char(0x5A), char(0xA5), char(0xFF) };
- std::array<char, 4U> expected = { int8_t(0x01), int8_t(0x5A), int8_t(0xA5), int8_t(0xFF) };
+ std::array<signed char, 4U> expected = { int8_t(0x01), int8_t(0x5A), int8_t(0xA5), int8_t(0xFF) };
etl::bit_stream_reader bit_stream(storage.data(), storage.size(), etl::endian::big);
@@ -307,7 +307,7 @@ namespace
TEST(test_read_int8_t_5bits)
{
std::array<char, 3U> storage = { char(0x0E), char(0x8B), char(0xF0) };
- std::array<char, 4U> expected = { int8_t(0x01), int8_t(0xFA), int8_t(0x05), int8_t(0xFF) };
+ std::array<signed char, 4U> expected = { int8_t(0x01), int8_t(0xFA), int8_t(0x05), int8_t(0xFF) };
etl::bit_stream_reader bit_stream(storage.data(), storage.size(), etl::endian::big);
diff --git a/test/test_bit_stream_reader_little_endian.cpp b/test/test_bit_stream_reader_little_endian.cpp
index 22c724ff..8684508c 100644
--- a/test/test_bit_stream_reader_little_endian.cpp
+++ b/test/test_bit_stream_reader_little_endian.cpp
@@ -215,7 +215,7 @@ namespace
TEST(test_read_int8_t)
{
std::array<char, 4U> storage = { char(0x80), char(0x5A), char(0xA5), char(0xFF) };
- std::array<char, 4U> expected = { int8_t(0x01), int8_t(0x5A), int8_t(0xA5), int8_t(0xFF) };
+ std::array<signed char, 4U> expected = { int8_t(0x01), int8_t(0x5A), int8_t(0xA5), int8_t(0xFF) };
etl::bit_stream_reader bit_stream(storage.data(), storage.size(), etl::endian::little);
diff --git a/test/test_bresenham_line.cpp b/test/test_bresenham_line.cpp
index 96f5e231..eeb85239 100644
--- a/test/test_bresenham_line.cpp
+++ b/test/test_bresenham_line.cpp
@@ -44,7 +44,7 @@ namespace etl
namespace
{
- using Value = char;
+ using Value = signed char;
using Point = etl::coordinate_2d<Value>;
diff --git a/test/test_correlation.cpp b/test/test_correlation.cpp
index 82f2d032..72381c77 100644
--- a/test/test_correlation.cpp
+++ b/test/test_correlation.cpp
@@ -34,17 +34,17 @@ SOFTWARE.
namespace
{
- std::array<char, 10> input_c
+ std::array<signed char, 10> input_c
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
};
- std::array<char, 10> input_c_flat
+ std::array<signed char, 10> input_c_flat
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
- std::array<char, 10> input_c_inv
+ std::array<signed char, 10> input_c_inv
{
0, -1, -2, -3, -4, -5, -6, -7, -8, -9
};
@@ -86,7 +86,7 @@ namespace
//*************************************************************************
TEST(test_char_correlation_default_constructor)
{
- etl::correlation<etl::correlation_type::Population, char, int32_t> correlation;
+ etl::correlation<etl::correlation_type::Population, signed char, int32_t> correlation;
double correlation_result = correlation;
@@ -120,21 +120,21 @@ namespace
double covariance_result;
// Negative correlation.
- etl::correlation<etl::correlation_type::Population, char, int32_t> correlation1(input_c.begin(), input_c.end(), input_c_inv.begin());
+ etl::correlation<etl::correlation_type::Population, signed char, int32_t> correlation1(input_c.begin(), input_c.end(), input_c_inv.begin());
correlation_result = correlation1;
CHECK_CLOSE(-1.0, correlation_result, 0.1);
covariance_result = correlation1.get_covariance();
CHECK_CLOSE(-8.25, covariance_result, 0.1);
// Zero correlation
- etl::correlation<etl::correlation_type::Population, char, int32_t> correlation2(input_c.begin(), input_c.end(), input_c_flat.begin());
+ etl::correlation<etl::correlation_type::Population, signed char, int32_t> correlation2(input_c.begin(), input_c.end(), input_c_flat.begin());
correlation_result = correlation2;
CHECK_CLOSE(0.0, correlation_result, 0.1);
covariance_result = correlation2.get_covariance();
CHECK_CLOSE(0.0, covariance_result, 0.1);
// Positive correlation.
- etl::correlation<etl::correlation_type::Population, char, int32_t> correlation3(input_c.begin(), input_c.end(), input_c.begin());
+ etl::correlation<etl::correlation_type::Population, signed char, int32_t> correlation3(input_c.begin(), input_c.end(), input_c.begin());
correlation_result = correlation3;
CHECK_CLOSE(1.0, correlation_result, 0.1);
covariance_result = correlation3.get_covariance();
@@ -148,21 +148,21 @@ namespace
double covariance_result;
// Negative correlation.
- etl::correlation<etl::correlation_type::Sample, char, int32_t> correlation1(input_c.begin(), input_c.end(), input_c_inv.begin());
+ etl::correlation<etl::correlation_type::Sample, signed char, int32_t> correlation1(input_c.begin(), input_c.end(), input_c_inv.begin());
correlation_result = correlation1;
CHECK_CLOSE(-1.0, correlation_result, 0.1);
covariance_result = correlation1.get_covariance();
CHECK_CLOSE(-9.17, covariance_result, 0.1);
// Zero correlation
- etl::correlation<etl::correlation_type::Sample, char, int32_t> correlation2(input_c.begin(), input_c.end(), input_c_flat.begin());
+ etl::correlation<etl::correlation_type::Sample, signed char, int32_t> correlation2(input_c.begin(), input_c.end(), input_c_flat.begin());
correlation_result = correlation2;
CHECK_CLOSE(0.0, correlation_result, 0.1);
covariance_result = correlation2.get_covariance();
CHECK_CLOSE(0.0, covariance_result, 0.1);
// Positive correlation.
- etl::correlation<etl::correlation_type::Sample, char, int32_t> correlation3(input_c.begin(), input_c.end(), input_c.begin());
+ etl::correlation<etl::correlation_type::Sample, signed char, int32_t> correlation3(input_c.begin(), input_c.end(), input_c.begin());
correlation_result = correlation3;
CHECK_CLOSE(1.0, correlation_result, 0.1);
covariance_result = correlation3.get_covariance();
diff --git a/test/test_covariance.cpp b/test/test_covariance.cpp
index a127616c..a3b67a9d 100644
--- a/test/test_covariance.cpp
+++ b/test/test_covariance.cpp
@@ -34,17 +34,17 @@ SOFTWARE.
namespace
{
- std::array<char, 10> input_c
+ std::array<signed char, 10> input_c
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
};
- std::array<char, 10> input_c_flat
+ std::array<signed char, 10> input_c_flat
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
- std::array<char, 10> input_c_inv
+ std::array<signed char, 10> input_c_inv
{
0, -1, -2, -3, -4, -5, -6, -7, -8, -9
};
@@ -86,7 +86,7 @@ namespace
//*************************************************************************
TEST(test_char_covariance_default_constructor)
{
- etl::covariance<etl::covariance_type::Population, char, int32_t> covariance;
+ etl::covariance<etl::covariance_type::Population, signed char, int32_t> covariance;
double covariance_result = covariance;
@@ -119,17 +119,17 @@ namespace
double covariance_result;
// Negative covariance.
- etl::covariance<etl::covariance_type::Population, char, int32_t> covariance1(input_c.begin(), input_c.end(), input_c_inv.begin());
+ etl::covariance<etl::covariance_type::Population, signed char, int32_t> covariance1(input_c.begin(), input_c.end(), input_c_inv.begin());
covariance_result = covariance1.get_covariance();
CHECK_CLOSE(-8.25, covariance_result, 0.1);
// Zero covariance
- etl::covariance<etl::covariance_type::Population, char, int32_t> covariance2(input_c.begin(), input_c.end(), input_c_flat.begin());
+ etl::covariance<etl::covariance_type::Population, signed char, int32_t> covariance2(input_c.begin(), input_c.end(), input_c_flat.begin());
covariance_result = covariance2.get_covariance();
CHECK_CLOSE(0.0, covariance_result, 0.1);
// Positive covariance.
- etl::covariance<etl::covariance_type::Population, char, int32_t> covariance3(input_c.begin(), input_c.end(), input_c.begin());
+ etl::covariance<etl::covariance_type::Population, signed char, int32_t> covariance3(input_c.begin(), input_c.end(), input_c.begin());
covariance_result = covariance3.get_covariance();
CHECK_CLOSE(8.25, covariance_result, 0.1);
}
@@ -140,17 +140,17 @@ namespace
double covariance_result;
// Negative covariance.
- etl::covariance<etl::covariance_type::Sample, char, int32_t> covariance1(input_c.begin(), input_c.end(), input_c_inv.begin());
+ etl::covariance<etl::covariance_type::Sample, signed char, int32_t> covariance1(input_c.begin(), input_c.end(), input_c_inv.begin());
covariance_result = covariance1.get_covariance();
CHECK_CLOSE(-9.17, covariance_result, 0.1);
// Zero covariance
- etl::covariance<etl::covariance_type::Sample, char, int32_t> covariance2(input_c.begin(), input_c.end(), input_c_flat.begin());
+ etl::covariance<etl::covariance_type::Sample, signed char, int32_t> covariance2(input_c.begin(), input_c.end(), input_c_flat.begin());
covariance_result = covariance2.get_covariance();
CHECK_CLOSE(0.0, covariance_result, 0.1);
// Positive covariance.
- etl::covariance<etl::covariance_type::Sample, char, int32_t> covariance3(input_c.begin(), input_c.end(), input_c.begin());
+ etl::covariance<etl::covariance_type::Sample, signed char, int32_t> covariance3(input_c.begin(), input_c.end(), input_c.begin());
covariance_result = covariance3.get_covariance();
CHECK_CLOSE(9.17, covariance_result, 0.1);
}
diff --git a/test/test_rms.cpp b/test/test_rms.cpp
index cbc19884..0079819f 100644
--- a/test/test_rms.cpp
+++ b/test/test_rms.cpp
@@ -34,7 +34,7 @@ SOFTWARE.
namespace
{
- std::array<char, 18> input_c
+ std::array<signed char, 18> input_c
{
// Sawtooth wave
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -8, -7, -6, -5, -4, -3, -2, -1
@@ -52,7 +52,7 @@ namespace
//*************************************************************************
TEST(test_char_rms)
{
- etl::rms<char, int> rms(input_c.begin(), input_c.end());
+ etl::rms<signed char, int> rms(input_c.begin(), input_c.end());
double result = rms.get_rms();
CHECK_CLOSE(5.21, result, 0.05);
|