* 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.
14 lines
336 B
C++
14 lines
336 B
C++
// Copyright by Contributors
|
|
#include <xgboost/objective.h>
|
|
|
|
#include "../helpers.h"
|
|
|
|
TEST(Objective, UnknownFunction) {
|
|
xgboost::ObjFunction* obj = nullptr;
|
|
EXPECT_ANY_THROW(obj = xgboost::ObjFunction::Create("unknown_name"));
|
|
EXPECT_NO_THROW(obj = xgboost::ObjFunction::Create("reg:linear"));
|
|
if (obj) {
|
|
delete obj;
|
|
}
|
|
}
|