diff --git a/build_tools/format-diff.sh b/build_tools/format-diff.sh index 9dc85496c9..aa6b634563 100755 --- a/build_tools/format-diff.sh +++ b/build_tools/format-diff.sh @@ -118,6 +118,9 @@ fi # fi set -e +# Exclude third-party from formatting +EXCLUDE=':!third-party/' + uncommitted_code=`git diff HEAD` # If there's no uncommitted changes, we assume user are doing post-commit @@ -137,11 +140,11 @@ then # should be relevant for formatting fixes. FORMAT_UPSTREAM_MERGE_BASE="$(git merge-base "$FORMAT_UPSTREAM" HEAD)" # Get the differences - diffs=$(git diff -U0 "$FORMAT_UPSTREAM_MERGE_BASE" | $CLANG_FORMAT_DIFF -p 1) || true + diffs=$(git diff -U0 "$FORMAT_UPSTREAM_MERGE_BASE" -- $EXCLUDE | $CLANG_FORMAT_DIFF -p 1) || true echo "Checking format of changes not yet in $FORMAT_UPSTREAM..." else # Check the format of uncommitted lines, - diffs=$(git diff -U0 HEAD | $CLANG_FORMAT_DIFF -p 1) || true + diffs=$(git diff -U0 HEAD -- $EXCLUDE | $CLANG_FORMAT_DIFF -p 1) || true echo "Checking format of uncommitted changes..." fi @@ -187,9 +190,9 @@ fi # Do in-place format adjustment. if [ -z "$uncommitted_code" ] then - git diff -U0 "$FORMAT_UPSTREAM_MERGE_BASE" | $CLANG_FORMAT_DIFF -i -p 1 + git diff -U0 "$FORMAT_UPSTREAM_MERGE_BASE" -- $EXCLUDE | $CLANG_FORMAT_DIFF -i -p 1 else - git diff -U0 HEAD | $CLANG_FORMAT_DIFF -i -p 1 + git diff -U0 HEAD -- $EXCLUDE | $CLANG_FORMAT_DIFF -i -p 1 fi echo "Files reformatted!" diff --git a/db/db_io_failure_test.cc b/db/db_io_failure_test.cc index ecef6e860a..4021ea73d3 100644 --- a/db/db_io_failure_test.cc +++ b/db/db_io_failure_test.cc @@ -7,6 +7,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. +#include + #include "db/db_test_util.h" #include "port/stack_trace.h" #include "test_util/testutil.h" diff --git a/table/table_test.cc b/table/table_test.cc index 17b5bbfc36..302ff71858 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/third-party/gtest-1.8.1/fused-src/gtest/gtest-all.cc b/third-party/gtest-1.8.1/fused-src/gtest/gtest-all.cc index b19c9f2a81..f3c10c469d 100644 --- a/third-party/gtest-1.8.1/fused-src/gtest/gtest-all.cc +++ b/third-party/gtest-1.8.1/fused-src/gtest/gtest-all.cc @@ -477,6 +477,38 @@ GTEST_DECLARE_bool_(death_test_use_fork); namespace internal { +template +AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, + const char* rhs_expression, + RawType lhs_value, RawType rhs_value) { + const FloatingPoint lhs(lhs_value), rhs(rhs_value); + + if (lhs.AlmostEquals(rhs)) { + return AssertionSuccess(); + } + + ::std::stringstream lhs_ss; + lhs_ss << std::setprecision(std::numeric_limits::digits10 + 2) + << lhs_value; + + ::std::stringstream rhs_ss; + rhs_ss << std::setprecision(std::numeric_limits::digits10 + 2) + << rhs_value; + + return EqFailure(lhs_expression, rhs_expression, + StringStreamToString(&lhs_ss), StringStreamToString(&rhs_ss), + false); +} + +template +AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, + const char* rhs_expression, + float lhs_value, float rhs_value); +template +AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, + const char* rhs_expression, + double lhs_value, double rhs_value); + // The value of GetTestTypeId() as seen from within the Google Test // library. This is solely for testing GetTestTypeId(). GTEST_API_ extern const TypeId kTestTypeIdInGoogleTest; diff --git a/third-party/gtest-1.8.1/fused-src/gtest/gtest.h b/third-party/gtest-1.8.1/fused-src/gtest/gtest.h index 2d82d8e4d0..f6e3fabed0 100644 --- a/third-party/gtest-1.8.1/fused-src/gtest/gtest.h +++ b/third-party/gtest-1.8.1/fused-src/gtest/gtest.h @@ -3973,7 +3973,7 @@ const char* StringFromGTestEnv(const char* flag, const char* default_val); #include #include #include -#include +// #include // Not included in newer versions of gtest #include #include #include @@ -21451,27 +21451,7 @@ template AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, const char* rhs_expression, RawType lhs_value, - RawType rhs_value) { - const FloatingPoint lhs(lhs_value), rhs(rhs_value); - - if (lhs.AlmostEquals(rhs)) { - return AssertionSuccess(); - } - - ::std::stringstream lhs_ss; - lhs_ss << std::setprecision(std::numeric_limits::digits10 + 2) - << lhs_value; - - ::std::stringstream rhs_ss; - rhs_ss << std::setprecision(std::numeric_limits::digits10 + 2) - << rhs_value; - - return EqFailure(lhs_expression, - rhs_expression, - StringStreamToString(&lhs_ss), - StringStreamToString(&rhs_ss), - false); -} + RawType rhs_value); // Helper function for implementing ASSERT_NEAR. // diff --git a/tools/ldb_cmd_test.cc b/tools/ldb_cmd_test.cc index 711a313db6..5715f93db3 100644 --- a/tools/ldb_cmd_test.cc +++ b/tools/ldb_cmd_test.cc @@ -6,6 +6,7 @@ #include "rocksdb/utilities/ldb_cmd.h" #include +#include #include "db/db_test_util.h" #include "db/version_edit.h" diff --git a/utilities/transactions/lock/range/range_locking_test.cc b/utilities/transactions/lock/range/range_locking_test.cc index 961a5a11ae..45531910d1 100644 --- a/utilities/transactions/lock/range/range_locking_test.cc +++ b/utilities/transactions/lock/range/range_locking_test.cc @@ -7,6 +7,7 @@ #include #include +#include #include #include