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:
@@ -4,11 +4,16 @@
|
||||
#include "../helpers.h"
|
||||
|
||||
TEST(Metric, UnknownMetric) {
|
||||
xgboost::Metric * metric;
|
||||
xgboost::Metric * metric = nullptr;
|
||||
EXPECT_ANY_THROW(metric = xgboost::Metric::Create("unknown_name"));
|
||||
EXPECT_NO_THROW(metric = xgboost::Metric::Create("rmse"));
|
||||
delete metric;
|
||||
if (metric) {
|
||||
delete metric;
|
||||
}
|
||||
metric = nullptr;
|
||||
EXPECT_ANY_THROW(metric = xgboost::Metric::Create("unknown_name@1"));
|
||||
EXPECT_NO_THROW(metric = xgboost::Metric::Create("error@0.5f"));
|
||||
delete metric;
|
||||
if (metric) {
|
||||
delete metric;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user