Use custom equality assertion function

This fixes a build problem on our private Jenkins instance and will probably
prevent similar problems in the future.