Use gtest functions for comparing hash strings

This prints the mismatched strings if the test failed,
simplifying managing and updating the test suite.