summaryrefslogtreecommitdiff
path: root/test/test_byte_reverse.cxx
AgeCommit message (Collapse)Author
2021-01-01copyright year 2021Max Kellermann
2020-01-18copyright year 2020Max Kellermann
2019-08-03util/Macros: replace with std::size() (C++17)Max Kellermann
2019-06-17Copyright year 2019Max Kellermann
2018-10-31*: copyright year 2018Max Kellermann
2018-10-16test: use GTest instead of cppunitMax Kellermann
2018-08-20Compiler.h: move to util/Max Kellermann
2017-05-19test/test_byte_reverse: move "alignas" attribute to the frontMax Kellermann
Apparently, this makes old clang versions happy ("'alignas' attribute cannot be applied to types).
2017-01-03update copyright yearMax Kellermann
2016-11-18Compiler.h: drop gcc_alignas(), use plain C++11 alignas()Max Kellermann
2016-04-30Merge tag 'v0.19.15'Max Kellermann
release v0.19.15
2016-04-30test/test_byte_reverse: use gcc_alignas() for gcc<4.8 compatibilityMax Kellermann
2016-04-28Bug#822848: mpd FTBFS on Alpha; misaligned arrays in the test suiteMichael Cree
Source: mpd Version: 0.19.14-2 Severity: important Justification: fails to build form source (but built in the past) Tags: patch User: debian-alpha@lists.debian.org Usertags: alpha mpd FTBFS on Alpha with a failure in the test suite [1]: FAIL: test/test_byte_reverse ============================ .F... !!!FAILURES!!! Test Results: Run: 4 Failures: 1 Errors: 0 1) test: ByteReverseTest::TestByteReverse2 (F) line: 58 test/test_byte_reverse.cxx assertion failed - Expression: strcmp(result, (const char *)dest) == 0 This occurs because the test suite (in test/test_byte_reversal.cxx) allocates static char arrays and passes the char arrays to functions whose respective arguments were declared to be uint16_t *, etc., in the main code. This is in the realm of undefined behaviour on architectures with strict memory alignment requirements. Although the test only fails on Alpha (because Alpha has a particular CPU load instruction that gcc likes to use to add bugs ..., ahem, optimise the code on the assumption of alignment) it is potentially a latent bug for other architectures with strict alignment requirements. Since the code is compiled with the c++11 standard I attach a patch that modifies the test suite to align the non-compliant strings with the alignas() attribute. The test suite now passes on Alpha with that patch. Cheers Michael [1] https://buildd.debian.org/status/fetch.php?pkg=mpd&arch=alpha&ver=0.19.14-2&stamp=1461542099
2016-02-26update copyright year to 2016Max Kellermann
2015-01-01Copyright year 2015Max Kellermann
2014-01-13copyright year 2014Max Kellermann
2013-11-05test/*: add more missing stdlib.h includesMax Kellermann
2013-10-16test: use the CPPUNIT framework for unit testsMax Kellermann
2013-10-16util/byte_reverse: convert to C++Max Kellermann