From 8876622b6fcebc21672bc263666b858b7e152b45 Mon Sep 17 00:00:00 2001 From: Gil Date: Thu, 12 Apr 2018 14:54:53 -0700 Subject: Add clang-tidy checks for Firestore (#1078) * Add a .clang-tidy configuration for Firestore C++ * Fix clang-tidy warnings * typedef -> using * const ref + rvalue ref -> pass by value * NULL -> nullptr * remove useless default initializations * remove useless const value-type parameter declarations (definitions can still use them) * use auto instead of repeating types in a cast * Fix typos * Address use of static method through instance warnings * Address use after move warnings --- Firestore/core/test/firebase/firestore/model/document_key_test.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Firestore/core/test/firebase/firestore/model/document_key_test.cc') diff --git a/Firestore/core/test/firebase/firestore/model/document_key_test.cc b/Firestore/core/test/firebase/firestore/model/document_key_test.cc index 0e0df2d..619ee7f 100644 --- a/Firestore/core/test/firebase/firestore/model/document_key_test.cc +++ b/Firestore/core/test/firebase/firestore/model/document_key_test.cc @@ -46,7 +46,7 @@ TEST(DocumentKey, Constructor_FromPath) { EXPECT_EQ(key_from_path_copy.path(), path); const DocumentKey key_from_moved_path{std::move(path)}; - EXPECT_TRUE(path.empty()); + EXPECT_TRUE(path.empty()); // NOLINT: use after move intended EXPECT_FALSE(key_from_moved_path.path().empty()); EXPECT_EQ(key_from_path_copy.path(), key_from_moved_path.path()); } @@ -62,7 +62,7 @@ TEST(DocumentKey, CopyAndMove) { const DocumentKey moved = std::move(key); EXPECT_EQ(path_string, moved.path().CanonicalString()); - EXPECT_NE(key, moved); + EXPECT_NE(key, moved); // NOLINT: use after move intended EXPECT_TRUE(key.path().empty()); // Reassignment. @@ -74,7 +74,7 @@ TEST(DocumentKey, CopyAndMove) { key = {}; EXPECT_TRUE(key.path().empty()); key = std::move(copied); - EXPECT_NE(copied, key); + EXPECT_NE(copied, key); // NOLINT: use after move intended EXPECT_TRUE(copied.path().empty()); EXPECT_EQ(path_string, key.path().CanonicalString()); } -- cgit v1.2.3