Create fuzzing harness to compare C/Rust Functionality
In porting over functionality to Rust, it can be useful to compare functionality between C/Rust. While ideally unit tests should catch most behavior, having a fuzzer to catch edge cases can be handy.
We should write a test harness that fuzzes C/Rust similar functions and compares their output. Ideally, a test would look something like this:
- Setup C test case
- Set up Rust test case
- Provide both functions with the same generated arbitrary input
- Compare results
It is worth noting that in most cases we will want to improve behavior when porting to Rust, but this tool can be useful for small cases where we want bitwise identical functions.
Alex Crichton recommended looking at https://github.com/alexcrichton/ctest as one option- it is worth looking at what a simple test harness should be and how to have code be reusable between tests.