Silence const redefinition warning by using a local variable for the class instead

Just a small fix for nicer test output.