Googler | 0c72bf2 | 2023-10-18 06:04:54 -0700 | [diff] [blame] | 1 | // Part of the Crubit project, under the Apache License v2.0 with LLVM |
| 2 | // Exceptions. See /LICENSE for license information. |
| 3 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 4 | |
| 5 | #include "nullability/inference/slot_fingerprint.h" |
| 6 | |
| 7 | #include "third_party/llvm/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h" |
| 8 | |
| 9 | namespace clang::tidy::nullability { |
| 10 | namespace { |
| 11 | |
| 12 | TEST(SlotFingerprintTest, ProducesConsistentValue) { |
| 13 | EXPECT_EQ(fingerprint("usr1", 1), fingerprint("usr1", 1)); |
| 14 | } |
| 15 | |
| 16 | TEST(SlotFingerprintTest, ProducesDistinctValue) { |
| 17 | EXPECT_NE(fingerprint("usr1", 1), fingerprint("usr1", 0)); |
| 18 | EXPECT_NE(fingerprint("usr1", 1), fingerprint("usr2", 1)); |
| 19 | EXPECT_NE(fingerprint("usr1", 1), fingerprint("usr2", 0)); |
| 20 | } |
| 21 | |
| 22 | } // namespace |
| 23 | } // namespace clang::tidy::nullability |