pngme_book
pngme_book copied to clipboard
Fix PNG header in test_invalid_chunk
This is to fix issue #14.
AND it also includes a utility to sync the src/tests/*_tests.rs
test code to the bottom of the code/src/*.rs
skeleton code. This will make it easier to maintain.
Thanks for the review. I think my intention was not aligned with yours, so it may be that the whole first commit is bad.
I intended simply to sync the code you already have in tests/stubs
into the code/src
samples. I thought that was the intention, and that code/src
had just suffered some bitrot from neglect. I did not write any new code in the first commit (aside from the util script), and did not make any choices on what to include or exclude. I just was trying to do a little cleanup. But it seems that's not what the intention is, so probably the first commit should just be trashed.
The second commit has the actual change that I want. Your concern is that it's giving away some iterator methods, but in each file it's just copying the exact same code that was used elsewhere in the file. I could write an alternate version that obfuscates the task, probably, if you'd like me to take a stab at that. But something needs to generate a legitimate header + chunk structure to test the bad chunk handling.
Hmm ok that kinda bugs me. I'll have to take another look at this. I might want to pull out the code
directory entirely since one of my big intentions here was to not give away any kind of implementation.