diff --git a/autotest/CheckBak/CheckBak.cpp b/autotest/CheckBak/CheckBak.cpp index c611dbf69..07811151d 100644 --- a/autotest/CheckBak/CheckBak.cpp +++ b/autotest/CheckBak/CheckBak.cpp @@ -4,12 +4,15 @@ using namespace Upp; CONSOLE_APP_MAIN { + StdLogSetup(LOG_COUT|LOG_FILE); + String s = Sys("svn info svn://www.ultimatepp.org/bak"); - DUMP(s); - int q = s.Find("Last Changed Date: "); + LOG("SVN info:"); + LOG(s); + String key = "Last Changed Date: "; + int q = s.Find(key); ASSERT(q >= 0); - s = s.Mid(q); - DUMP(s); + s = s.Mid(q + key.GetCount()); ASSERT(s.GetCount() > 18); Date d; // 2014-10-30 01:01:56 @@ -17,6 +20,18 @@ CONSOLE_APP_MAIN d.year = atoi(s); d.month = atoi(~s + 5); d.day = atoi(~s + 8); - DUMP(d); + LOG("Bak repository last date: " << d); ASSERT(d >= GetSysDate() - 1); -} \ No newline at end of file + + FindFile ff("/mnt/nas/bak/*.*"); + d = Date::Low(); + + while(ff) { + d = max(d, (Date)Time(ff.GetLastWriteTime())); + ff.Next(); + } + + LOG("mnt/nas/bak last date: " << d); + + ASSERT(d >= GetSysDate() - 1); +} diff --git a/autotest/CheckDownloads/CheckDownloads.cpp b/autotest/CheckDownloads/CheckDownloads.cpp new file mode 100644 index 000000000..45093e3f5 --- /dev/null +++ b/autotest/CheckDownloads/CheckDownloads.cpp @@ -0,0 +1,29 @@ +#include + +using namespace Upp; + +CONSOLE_APP_MAIN +{ + Date d; + String downloads = HttpRequest("http://www.ultimatepp.org/www$uppweb$nightly$en-us.html").Execute(); + int q = downloads.Find(" 0); + q = downloads.ReverseFind(">", q - 1); + ASSERT(q > 0); + + CParser p(~downloads + q + 1); + + try { + d.month = p.ReadInt(); + p.PassChar('/'); + d.day = p.ReadInt(); + p.PassChar('/'); + d.year = p.ReadInt(); + } + catch(...) { + NEVER(); + } + + LOG("downloads last date: " << d); + ASSERT(d >= GetSysDate() - 1); +} diff --git a/autotest/CheckDownloads/CheckDownloads.upp b/autotest/CheckDownloads/CheckDownloads.upp new file mode 100644 index 000000000..5699a55ad --- /dev/null +++ b/autotest/CheckDownloads/CheckDownloads.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + CheckDownloads.cpp; + +mainconfig + "" = "SSE2"; + diff --git a/autotest/CheckDownloads/init b/autotest/CheckDownloads/init new file mode 100644 index 000000000..e63106493 --- /dev/null +++ b/autotest/CheckDownloads/init @@ -0,0 +1,4 @@ +#ifndef _CheckDownloads_icpp_init_stub +#define _CheckDownloads_icpp_init_stub +#include "Core/init" +#endif