diff options
author | merge-script <fanquake@gmail.com> | 2024-05-04 09:07:44 +0800 |
---|---|---|
committer | merge-script <fanquake@gmail.com> | 2024-05-04 09:07:44 +0800 |
commit | 61d3280c3a36084a6fef17fcedb3de3555294424 (patch) | |
tree | d2a6c62e284fac2bbd74725b687156873e8932c0 /src/test | |
parent | bd597c33e3e58cd3c6b22ed42f8f1fd7ff886bb2 (diff) | |
parent | 976e5d8f7b2bc77cb1443b8bf0f38cb07db70e9b (diff) |
Merge bitcoin/bitcoin#29907: test: Fix `test/streams_tests.cpp` compilation on SunOS / illumos
976e5d8f7b2bc77cb1443b8bf0f38cb07db70e9b test: Fix `test/streams_tests.cpp` compilation on SunOS / illumos (Hennadii Stepanov)
Pull request description:
On systems where `int8_t` is defined as `char`, the `{S,Uns}erialize(Stream&, signed char)` functions become undefined.
This PR resolves the issue by testing `{S,Uns}erialize(Stream&, int8_t)` instead.
No behavior change on systems where `int8_t` is defined as `signed char`, which is the case for most other systems.
Fixes https://github.com/bitcoin/bitcoin/issues/29884.
An alternative approach is mentioned in https://github.com/bitcoin/bitcoin/issues/29884#issuecomment-2058434577 as well.
ACKs for top commit:
maflcko:
lgtm ACK 976e5d8f7b2bc77cb1443b8bf0f38cb07db70e9b
theuni:
ACK 976e5d8f7b2bc77cb1443b8bf0f38cb07db70e9b. Nice to have the serialization concept actually tested :)
Tree-SHA512: 1033863e584fa8e99a281b236fa01fc919f610a024bcec792116762e28c1c16ee481bd01325c3a0ca9dd9d753176aa63bd9ac7e08a9bbce772db2949d06f6e61
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/streams_tests.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/streams_tests.cpp b/src/test/streams_tests.cpp index 0903f987f6..e666e11758 100644 --- a/src/test/streams_tests.cpp +++ b/src/test/streams_tests.cpp @@ -143,8 +143,8 @@ BOOST_AUTO_TEST_CASE(streams_vector_reader) BOOST_CHECK_EQUAL(reader.size(), 5U); BOOST_CHECK(!reader.empty()); - // Read a single byte as a signed char. - signed char b; + // Read a single byte as a int8_t. + int8_t b; reader >> b; BOOST_CHECK_EQUAL(b, -1); BOOST_CHECK_EQUAL(reader.size(), 4U); |