Avoid test setup that generates warnings

This change does not affect the behaviour of the test, other than to
stop it generating a warning. Testing that the warning is triggered is
not itself a problem, but if it means spending time regenerating test
cases and coordinating verifications every time someone wants to
improve the warning text, then the test should go and be a unit test.

Change-Id: I4d5b8bb14b11a1c1a37c2d3a818dcd2455d30d2c