blob: fe61d4cfd7661d9b77c510240a86fa25465d6609 [file] [log] [blame]
Googler0c72bf22023-10-18 06:04:54 -07001// 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
9namespace clang::tidy::nullability {
10namespace {
11
12TEST(SlotFingerprintTest, ProducesConsistentValue) {
13 EXPECT_EQ(fingerprint("usr1", 1), fingerprint("usr1", 1));
14}
15
16TEST(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