General testing logic.