Improve use of the test framework in the SM2 internal tests