Goodness-of-fit tests for location–scale families based on random distance