mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.autotest
git-svn-id: svn://ultimatepp.org/upp/trunk@15915 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
fa2ed4c909
commit
2bc1bcd2d4
2 changed files with 52 additions and 0 deletions
43
autotest/FileTime/FileTime.cpp
Normal file
43
autotest/FileTime/FileTime.cpp
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
StdLogSetup(LOG_COUT|LOG_FILE);
|
||||
|
||||
String path = GetHomeDirFile("test-filetime-get-set.test");
|
||||
|
||||
SaveFile(path, "xxx");
|
||||
|
||||
FileTime tm1;
|
||||
tm1 = GetFileTime(path);
|
||||
DDUMP(Time(tm1));
|
||||
SetFileTime(path, tm1);
|
||||
FileTime tm2 = GetFileTime(path);
|
||||
DDUMP(Time(tm2));
|
||||
ASSERT(tm1 == tm2);
|
||||
|
||||
Time m1 = FileGetTime(path);
|
||||
DDUMP(m1);
|
||||
DDUMP(FileGetTime(path));
|
||||
FileSetTime(path, FileGetTime(path));
|
||||
Time m2 = FileGetTime(path);
|
||||
DDUMP(m2);
|
||||
ASSERT(m1 == m2);
|
||||
|
||||
String path2 = GetHomeDirFile("test-filetime-get-set-tgt.test");
|
||||
|
||||
FileCopy(path, path2);
|
||||
|
||||
FileTime tm3 = GetFileTime(path2);
|
||||
|
||||
DDUMP(Time(tm3));
|
||||
|
||||
ASSERT(tm3 == tm1);
|
||||
|
||||
FileDelete(path);
|
||||
FileDelete(path2);
|
||||
|
||||
DLOG("============= OK");
|
||||
}
|
||||
9
autotest/FileTime/FileTime.upp
Normal file
9
autotest/FileTime/FileTime.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
FileTime.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue