Hash :
35fd3063
        
        Author :
  
        
        Date :
2018-11-20T10:02:48
        
      
Use xxHash for faster hash map lookups. This most strongly affects the Vulkan back-end which uses a hash map to cache VkPipelines. It also should speed up some parts of the D3D11 back-end. Bug: angleproject:2522 Change-Id: I10801654f043abce17339c30d7bf62bc8644e49c Reviewed-on: https://chromium-review.googlesource.com/c/1316889 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
//
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// hash_utils_unittest: Hashing helper functions tests.
#include <gtest/gtest.h>
#include "common/hash_utils.h"
using namespace angle;
namespace
{
// Basic functionality test.
TEST(HashUtilsTest, ComputeGenericHash)
{
    std::string a = "aSimpleString!!!";
    std::string b = "anotherString???";
    // Requires a string size aligned to 4 bytes.
    ASSERT_TRUE(a.size() % 4 == 0);
    ASSERT_TRUE(b.size() % 4 == 0);
    size_t aHash = ComputeGenericHash(a.c_str(), a.size());
    size_t bHash = ComputeGenericHash(b.c_str(), b.size());
    EXPECT_NE(aHash, bHash);
}
}  // anonymous namespace