* Deprecate `reg:linear' in favor of `reg:squarederror'. * Replace the use of `reg:linear'. * Replace the use of `silent`.
15 lines
367 B
C++
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;
|
|
}
|
|
}
|