tests/cpp: Add tests for SimpleDMatrix

This commit is contained in:
AbdealiJK
2016-12-03 11:45:11 +05:30
committed by Tianqi Chen
parent ef7fe06cf8
commit be0f55d563
3 changed files with 142 additions and 0 deletions

View File

@@ -9,3 +9,13 @@ long GetFileSize(const std::string filename) {
stat(filename.c_str(), &st);
return st.st_size;
}
std::string CreateSimpleTestData() {
std::string tmp_file = TempFileName();
std::ofstream fo;
fo.open(tmp_file);
fo << "0 0:0 1:10 2:20\n";
fo << "1 0:0 3:30 4:40\n";
fo.close();
return tmp_file;
}