Fixed wrong code checking logic.
Merge pull request #1536 from obino/fix-unit-tests-check

Fixed wrong code checking logic.