If you don't want to remove it, then comment out the first check (in the first programm), so you get garbage into your second program and your error-case will be testet.
Or just put a "1 or" in front of your if-expression to test the output from your error-message.
But you cannot create a testsuit covering all cases, if you have redundant testcode.