Testing of armature or field windings