Flutter Engine
The Flutter Engine
hash_combine_unittests.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "flutter/fml/hash_combine.h"
6
7#include "flutter/testing/testing.h"
8
9namespace fml {
10namespace testing {
11
12TEST(HashCombineTest, CanHash) {
13 ASSERT_EQ(HashCombine(), HashCombine());
14 ASSERT_EQ(HashCombine("Hello"), HashCombine("Hello"));
15 ASSERT_NE(HashCombine("Hello"), HashCombine("World"));
16 ASSERT_EQ(HashCombine("Hello", "World"), HashCombine("Hello", "World"));
17 ASSERT_NE(HashCombine("World", "Hello"), HashCombine("Hello", "World"));
18 ASSERT_EQ(HashCombine(12u), HashCombine(12u));
19 ASSERT_NE(HashCombine(12u), HashCombine(12.0f));
20 ASSERT_EQ(HashCombine('a'), HashCombine('a'));
21}
22
23} // namespace testing
24} // namespace fml
TEST(BacktraceTest, CanGatherBacktrace)
Definition: ascii_trie.cc:9
constexpr std::size_t HashCombine()
Definition: hash_combine.h:25