Skip to content

Commit

Permalink
Merge #29907: test: Fix test/streams_tests.cpp compilation on SunOS…
Browse files Browse the repository at this point in the history
… / illumos

976e5d8 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 #29884.

  An alternative approach is mentioned in #29884 (comment) as well.

ACKs for top commit:
  maflcko:
    lgtm ACK 976e5d8
  theuni:
    ACK 976e5d8. Nice to have the serialization concept actually tested :)

Tree-SHA512: 1033863e584fa8e99a281b236fa01fc919f610a024bcec792116762e28c1c16ee481bd01325c3a0ca9dd9d753176aa63bd9ac7e08a9bbce772db2949d06f6e61
  • Loading branch information
fanquake committed May 4, 2024
2 parents bd597c3 + 976e5d8 commit 61d3280
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/test/streams_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 61d3280

Please sign in to comment.