xgboost/tests/cpp/objective/test_objective.cc
Jiaming Yuan 29a1356669
Deprecate reg:linear' in favor of reg:squarederror'. (#4267)
* Deprecate `reg:linear' in favor of `reg:squarederror'.
* Replace the use of `reg:linear'.
* Replace the use of `silent`.
2019-03-17 17:55:04 +08:00

15 lines
367 B
C++

// Copyright by Contributors
#include <gtest/gtest.h>
#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:squarederror"));
if (obj) {
delete obj;
}
}