Improve native hashing test to test variable cost and cost exception