Rename and extract Context. (#8528)
* Rename `GenericParameter` to `Context`. * Rename header file to reflect the change. * Rename all references.
This commit is contained in:
@@ -4,16 +4,16 @@
|
||||
#include "../helpers.h"
|
||||
|
||||
TEST(Metric, UnknownMetric) {
|
||||
auto tparam = xgboost::CreateEmptyGenericParam(GPUIDX);
|
||||
auto ctx = xgboost::CreateEmptyGenericParam(GPUIDX);
|
||||
xgboost::Metric * metric = nullptr;
|
||||
EXPECT_ANY_THROW(metric = xgboost::Metric::Create("unknown_name", &tparam));
|
||||
EXPECT_NO_THROW(metric = xgboost::Metric::Create("rmse", &tparam));
|
||||
EXPECT_ANY_THROW(metric = xgboost::Metric::Create("unknown_name", &ctx));
|
||||
EXPECT_NO_THROW(metric = xgboost::Metric::Create("rmse", &ctx));
|
||||
if (metric) {
|
||||
delete metric;
|
||||
}
|
||||
metric = nullptr;
|
||||
EXPECT_ANY_THROW(metric = xgboost::Metric::Create("unknown_name@1", &tparam));
|
||||
EXPECT_NO_THROW(metric = xgboost::Metric::Create("error@0.5f", &tparam));
|
||||
EXPECT_ANY_THROW(metric = xgboost::Metric::Create("unknown_name@1", &ctx));
|
||||
EXPECT_NO_THROW(metric = xgboost::Metric::Create("error@0.5f", &ctx));
|
||||
if (metric) {
|
||||
delete metric;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user