Removed a lot of redundant code between serialize struct tests.