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 | #include "flutter/testing/testing.h" |
7 | |
8 | namespace fml { |
9 | namespace testing { |
10 | |
11 | TEST(HashCombineTest, CanHash) { |
12 | ASSERT_EQ(HashCombine(), HashCombine()); |
13 | ASSERT_EQ(HashCombine("Hello" ), HashCombine("Hello" )); |
14 | ASSERT_NE(HashCombine("Hello" ), HashCombine("World" )); |
15 | ASSERT_EQ(HashCombine("Hello" , "World" ), HashCombine("Hello" , "World" )); |
16 | ASSERT_NE(HashCombine("World" , "Hello" ), HashCombine("Hello" , "World" )); |
17 | ASSERT_EQ(HashCombine(12u), HashCombine(12u)); |
18 | ASSERT_NE(HashCombine(12u), HashCombine(12.0f)); |
19 | ASSERT_EQ(HashCombine('a'), HashCombine('a')); |
20 | } |
21 | |
22 | } // namespace testing |
23 | } // namespace fml |
24 | |