If an HDD doesn't work in every conceivable way out of the box it must be an RMA. These devices are too delicate to settle for anything less than flawless on arrival.
Badblocks will write known data to disk then read it to verify its good. If the disk is malicious, this can be faked. badblocks is also a little slow.
Using dm-crypt in the wiki will write zeros through dm-crypt which will result in random noise being written to disk, then compare with zeros to verify reads are good. This can not be faked easily since the zero stream is encrypted as it is written to disk.