call ref function and verify result