mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-16 00:46:03 +08:00
Fixed incorrect returned span length for byte stream read
This commit is contained in:
parent
2d743082ec
commit
7b3bb5fa6d
@ -559,7 +559,7 @@ namespace etl
|
||||
{
|
||||
T* destination = start;
|
||||
|
||||
while (length-- != 0U)
|
||||
for (size_t i = 0; i < length; ++i)
|
||||
{
|
||||
*destination++ = from_bytes<T>();
|
||||
}
|
||||
|
||||
@ -920,6 +920,7 @@ namespace
|
||||
|
||||
etl::optional<etl::span<const int32_t> > result = reader.read<int32_t>(output);
|
||||
CHECK(result.has_value());
|
||||
CHECK_EQUAL(sizeof(const int32_t), result.value().size());
|
||||
CHECK_EQUAL(put_data[0], get_data[0]);
|
||||
CHECK_EQUAL(put_data[1], get_data[1]);
|
||||
CHECK_EQUAL(put_data[2], get_data[2]);
|
||||
@ -944,6 +945,7 @@ namespace
|
||||
|
||||
etl::optional<etl::span<const int32_t> > result = reader.read<int32_t>(get_data.data(), get_data.size());
|
||||
CHECK(result.has_value());
|
||||
CHECK_EQUAL(sizeof(const int32_t), result.value().size());
|
||||
CHECK_EQUAL(put_data[0], get_data[0]);
|
||||
CHECK_EQUAL(put_data[1], get_data[1]);
|
||||
CHECK_EQUAL(put_data[2], get_data[2]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user