[coll] Pass context to various functions. (#9772)
* [coll] Pass context to various functions. In the future, the `Context` object would be required for collective operations, this PR passes the context object to some required functions to prepare for swapping out the implementation.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
* Copyright (c) 2017-2023, XGBoost contributors
|
||||
*/
|
||||
#include <gtest/gtest.h>
|
||||
#include <gmock/gmock.h>
|
||||
#include <xgboost/learner.h> // for Learner
|
||||
#include <xgboost/logging.h> // for LogCheck_NE, CHECK_NE, LogCheck_EQ
|
||||
#include <xgboost/objective.h> // for ObjFunction
|
||||
@@ -81,7 +82,9 @@ TEST(Learner, ParameterValidation) {
|
||||
|
||||
// whitespace
|
||||
learner->SetParam("tree method", "exact");
|
||||
EXPECT_THROW(learner->Configure(), dmlc::Error);
|
||||
EXPECT_THAT([&] { learner->Configure(); },
|
||||
::testing::ThrowsMessage<dmlc::Error>(
|
||||
::testing::HasSubstr(R"("tree method" contains whitespace)")));
|
||||
}
|
||||
|
||||
TEST(Learner, CheckGroup) {
|
||||
|
||||
Reference in New Issue
Block a user