[#967] Port testsuite's validate_*() functions from SFPy.
Almost verbatim, minimal rewriting to make it run. TODO: more restructuring/cleanup.
Authored by: Paul Sokolovsky 2010-11-28
Parent(s): [9a0b43]
Child(ren): [55f05d]