Enhance the unit test codes
Merge remote-tracking branch 'origin/master' into threadsafe