tests: Mark lots of unused vars and fix const mismatches.