Add data split mode to DMatrix MetaInfo (#8568)

This commit is contained in:
Rong Ou
2022-12-25 04:37:37 -08:00
committed by GitHub
parent 77b069c25d
commit 3ceeb8c61c
20 changed files with 113 additions and 103 deletions

View File

@@ -185,6 +185,17 @@ TEST(CAPI, CatchDMLCError) {
EXPECT_THROW({ dmlc::Stream::Create("foo", "r"); }, dmlc::Error);
}
TEST(CAPI, CatchDMLCErrorURI) {
Json config{Object()};
config["uri"] = String{"foo"};
config["silent"] = Integer{0};
std::string config_str;
Json::Dump(config, &config_str);
DMatrixHandle out;
ASSERT_EQ(XGDMatrixCreateFromURI(config_str.c_str(), &out), -1);
EXPECT_THROW({ dmlc::Stream::Create("foo", "r"); }, dmlc::Error);
}
TEST(CAPI, DMatrixSetFeatureName) {
size_t constexpr kRows = 10;
bst_feature_t constexpr kCols = 2;