OK, I think I found what my problem was - in my inititaion routines I had redefined the error handling routine and that seems to have caused the problem that I initially experienced. When I removed that, the test worked OK.
Thanks for the advice.
Best regards.