Refactor tests with data generator. (#5439)

This commit is contained in:
Jiaming Yuan
2020-03-27 06:44:44 +08:00
committed by GitHub
parent 7146b91d5a
commit 4942da64ae
26 changed files with 334 additions and 259 deletions

View File

@@ -68,8 +68,7 @@ TEST(Adapter, CSCAdapterColsMoreThanRows) {
}
TEST(c_api, DMatrixSliceAdapterFromSimpleDMatrix) {
auto pp_dmat = CreateDMatrix(6, 2, 1.0);
auto p_dmat = *pp_dmat;
auto p_dmat = RandomDataGenerator(6, 2, 1.0).GenerateDMatix();
std::vector<int> ridx_set = {1, 3, 5};
data::DMatrixSliceAdapter adapter(p_dmat.get(),
@@ -91,8 +90,6 @@ TEST(c_api, DMatrixSliceAdapterFromSimpleDMatrix) {
}
}
}
delete pp_dmat;
}
// A mock for JVM data iterator.