tests: fix potential divide by zero condition