ReFileUtils::readString("/./././.", buffer);
checkEqu("", buffer);
}
- void testSetFiles(){
+ void testSetFiles() {
ReByteArray name = ReFileUtils::tempFile("setfile_test.dat");
struct stat info;
- unlink(name.str());
+ _unlink(name.str());
ReFileUtils::writeString(name.str(), "");
checkEqu(0, stat(name.str(), &info));
struct tm time1;
ReFileUtils::timeToFiletime(time2, time3);
ReFileTime_t time4;
int diff = 86400 + 2 * 3600 + 3 * 60 + 2;
- ReFileUtils::timeToFiletime(time2 + diff, time4);
+ ReFileUtils::timeToFiletime(time2 + diff, time4);
ReFileUtils::setTimes(name.str(), time3, &time4, NULL);
checkEqu(0, stat(name.str(), &info));
+ #if defined __linux__
checkT(time2 == info.st_mtim.tv_sec);
checkT(time2 + diff == info.st_atim.tv_sec);
+ #elif defined __WIN32__
+ checkT(time2 == info.st_mtime);
+ checkT(time2 + diff == info.st_atime);
+ #endif
}
- void testTempFile(){
+ void testTempFile() {
const char* subdir = "refileutiltest";
const char* node = "test1.$$.txt";
ReByteArray dir = ReFileUtils::tempDir(subdir);