1. A method, comprising: in a memory device operating in a testing mode, receiving a vector to be written to the memory device; writing the vector to the memory device only if the vector belongs to a predefined set of test vectors; and if the vector does not belong to the set of test vectors, converting the vector to one of the test vectors, and writing the converted vector to the memory device.