Added missing error reporting to test cases.

The error was simply output as a test message.