tests/cpp/test_metainfo: Add tests to save and load

This commit is contained in:
AbdealiJK
2016-12-02 12:35:11 +05:30
committed by Tianqi Chen
parent 8eb69e0677
commit ef7fe06cf8
3 changed files with 58 additions and 1 deletions

11
tests/cpp/helpers.cc Normal file
View File

@@ -0,0 +1,11 @@
#include "./helpers.h"
std::string TempFileName() {
return std::tmpnam(nullptr);
}
long GetFileSize(const std::string filename) {
struct stat st;
stat(filename.c_str(), &st);
return st.st_size;
}