Skip to content

Commit

Permalink
fix roundtrip tests for structs larger than 252 bytes
Browse files Browse the repository at this point in the history
The C side of the roundtrip tests appears to have a typo resulting
in failures after comparison of byte 252.  Fixing the value
here resolves failures I encountered in tests on structures
larger than 252 bytes.

Signed-off-by: Paul Osborne <osbpau@gmail.com>
  • Loading branch information
posborne authored and gnzlbg committed Sep 14, 2019
1 parent e9b8697 commit 2d3be56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,7 @@ impl<'a> Generator<'a> {
for (i = 0; i < size; ++i) {{
if (pad[i]) {{ continue; }}
// fprintf(stdout, "C testing byte %d of %d of \"{ty}\"\n", i, size);
unsigned char c = (unsigned char)(i % 252);
unsigned char c = (unsigned char)(i % 256);
c = c == 0? 42 : c;
if (p[i] != c) {{
*error = 1;
Expand Down

0 comments on commit 2d3be56

Please sign in to comment.