tests and pre/post functions