test for function which returns void not working