Fix clang-tidy warnings. (#4149)

* Upgrade gtest for clang-tidy.
* Use CMake to install GTest instead of mv.
* Don't enforce clang-tidy to return 0 due to errors in thrust.
* Add a small test for tidy itself.

* Reformat.
This commit is contained in:
Jiaming Yuan
2019-03-13 02:25:51 +08:00
committed by GitHub
parent 259fb809e9
commit 7b9043cf71
41 changed files with 775 additions and 628 deletions

View File

@@ -27,7 +27,7 @@ TEST(SimpleDMatrix, RowAccess) {
xgboost::DMatrix * dmat = xgboost::DMatrix::Load(tmp_file, false, false);
// Loop over the batches and count the records
long row_count = 0;
int64_t row_count = 0;
for (auto &batch : dmat->GetRowBatches()) {
row_count += batch.Size();
}
@@ -54,7 +54,7 @@ TEST(SimpleDMatrix, ColAccessWithoutBatches) {
ASSERT_TRUE(dmat->SingleColBlock());
// Loop over the batches and assert the data is as expected
long num_col_batch = 0;
int64_t num_col_batch = 0;
for (const auto &batch : dmat->GetSortedColumnBatches()) {
num_col_batch += 1;
EXPECT_EQ(batch.Size(), dmat->Info().num_col_)