From 6b596d94f2e563e8e56c2adeba153e175a2e4792 Mon Sep 17 00:00:00 2001 From: cxl Date: Fri, 24 Dec 2010 12:53:02 +0000 Subject: [PATCH] .upptst: StrToTime git-svn-id: svn://ultimatepp.org/upp/trunk@2925 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- upptst/StrToTime/StrToTime.cpp | 25 +++++++++++++++++++++++++ upptst/StrToTime/StrToTime.upp | 11 +++++++++++ 2 files changed, 36 insertions(+) create mode 100644 upptst/StrToTime/StrToTime.cpp create mode 100644 upptst/StrToTime/StrToTime.upp diff --git a/upptst/StrToTime/StrToTime.cpp b/upptst/StrToTime/StrToTime.cpp new file mode 100644 index 000000000..3620a60b6 --- /dev/null +++ b/upptst/StrToTime/StrToTime.cpp @@ -0,0 +1,25 @@ +#include + +using namespace Upp; + +void Test(const char *text) +{ + Time tm; + const char *q = StrToTime(tm, text); + if(q) + LOG(text << " -> " << tm << ", follows: " << q); + else + LOG("FAILED: " << text); +} + +CONSOLE_APP_MAIN +{ + SetLanguage(LNG_CZECH); + Test("15.12.2005 23:10:20 hello!"); + Test("15.12.2005 hello!"); + Test("15.12.2005 12:10 foo!"); + Test("15.12.2005 12 foo!"); + Test("15.12.2005 foo!"); + Test("uck!"); +} + diff --git a/upptst/StrToTime/StrToTime.upp b/upptst/StrToTime/StrToTime.upp new file mode 100644 index 000000000..9acb74561 --- /dev/null +++ b/upptst/StrToTime/StrToTime.upp @@ -0,0 +1,11 @@ +description "String to time conversion test\377"; + +uses + Core; + +file + StrToTime.cpp; + +mainconfig + "" = ""; +