Path: blob/main_old/src/common/hash_utils_unittest.cpp
1693 views
//1// Copyright 2018 The ANGLE Project Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4//5// hash_utils_unittest: Hashing helper functions tests.67#include <gtest/gtest.h>89#include "common/hash_utils.h"1011using namespace angle;1213namespace14{15// Basic functionality test.16TEST(HashUtilsTest, ComputeGenericHash)17{18std::string a = "aSimpleString!!!";19std::string b = "anotherString???";2021// Requires a string size aligned to 4 bytes.22ASSERT_TRUE(a.size() % 4 == 0);23ASSERT_TRUE(b.size() % 4 == 0);2425size_t aHash = ComputeGenericHash(a.c_str(), a.size());26size_t bHash = ComputeGenericHash(b.c_str(), b.size());2728EXPECT_NE(aHash, bHash);29}30} // anonymous namespace313233