In Dune, the gom jabbar is a device that tests self-control; it "only kills animals". It's a box into which a person places his hand. Once the hand is in the box, the person feels a gradually growing pain which, though not tissue-damaging, eventually expands to become the most intense he's ever experienced. If at any point the person attempts to withdraw his hand, he is stung by a poisoned needle and dies.
This is related to the forbidden marshmallow impulse-control test of Mischel et al, though perhaps more dramatic. While delayed gratification is related to planning, future success and even intelligence, it's interesting and a bit dark to note that a positive behavioral attribute is measured by how much someone can make himself suffer.