Closed AMDmi3 closed 6 years ago
Interesting. Which version of clang++?
4.0.0
@AMDmi3 Can you try to find out which of the SECTION
s in those tests fail? Comment out each of the SECTION
s and test them one by one.
Maybe some u
s have to be replaced by ul
s to make sure we have long ints? I have tested this on 32bit Linux, but maybe something is different on 32bit BSD (assuming this is even a 32 bit system) or with clang4?
Hmm, moving a code into a standalone app shows that the exception is thrown correctly. Then I've narrowed it to the following: tests pass if I comment out check every possible value for single byte in buffer
. Could it be that there's an UB somewhere there?
Further down, the tests are fixed after this line is commented out:
could it be that it advances past the end of 1 char buffer?
I have added some asserts and tests that might help to zero in on the problem if your hunch is correct. Can you try the newest master?
Nothing has changed.
It might be that this is a problem of the Catch library used:
I have implemented a workaround by not using SECTION
s. If the problem goes away, we found it. If not, we can see better which case is the problematic one.
Yes, on 99ca512 tests pass fine.
Okay, so it was the "catch" problem after all. Rather annoying that our unit test framework or the C++ std lib has this problem, but I guess there isn't anything we can do about this here. But as it works now for you, I'll close this here. Thanks for bringing this to our attention and helping with the problem solving.
When built with gcc/libstdc++ the tests pass, but when build with clang/libc++ (which is the default on FreeBSD):
Haven't investigated further yet.