Add check for null values inside the test

This commit is contained in:
Anthony Louis committed 2021-04-09 19:34:24 -03:00
1 parent 9e87e1bab1
commit e22b9782c3
1 file changed
+14
+14
View File
@@ -275,6 +275,13 @@ TEST_F(TestHash, TestSha256Varlen) {
const int sha256_hash_size = 64;
EXPECT_EQ(response->null_count(), 0);
// Checks that the null value was hashed
EXPECT_NE(response->GetScalar(0).ValueOrDie()->ToString(), "");
EXPECT_NE(response->GetScalar(0).ValueOrDie()->ToString().size(),
sha256_hash_size);
// Check that all generated hashes were different
for (int i = 1; i < num_records; ++i) {
const auto& value_at_position = response->GetScalar(i).ValueOrDie()->ToString();
@@ -409,6 +416,13 @@ TEST_F(TestHash, TestSha1Varlen) {
const int sha1_hash_size = 40;
EXPECT_EQ(response->null_count(), 0);
// Checks that the null value was hashed
EXPECT_NE(response->GetScalar(0).ValueOrDie()->ToString(), "");
EXPECT_NE(response->GetScalar(0).ValueOrDie()->ToString().size(),
sha1_hash_size);
// Check that all generated hashes were different
for (int i = 1; i < num_records; ++i) {
const auto& value_at_position = response->GetScalar(i).ValueOrDie()->ToString();