mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-29 04:17:55 +01:00
fixed GH #363: DateTimeParser tryParse/parse
This commit is contained in:
@@ -505,6 +505,37 @@ void DateTimeParserTest::testCustom()
|
||||
assert (dt.hour() == 12);
|
||||
assert (dt.minute() == 30);
|
||||
assert (dt.second() == 0);
|
||||
|
||||
assert (!DateTimeParser::tryParse("%h:%M %a", "", dt, tzd));
|
||||
assert (!DateTimeParser::tryParse("", "12:30 PM", dt, tzd));
|
||||
assert (!DateTimeParser::tryParse("", "", dt, tzd));
|
||||
|
||||
try
|
||||
{
|
||||
DateTimeParser::parse("%h:%M %a", "", tzd);
|
||||
fail ("must fail");
|
||||
}
|
||||
catch (SyntaxException&)
|
||||
{
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
DateTimeParser::parse("", "12:30 PM", tzd);
|
||||
fail ("must fail");
|
||||
}
|
||||
catch (SyntaxException&)
|
||||
{
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
DateTimeParser::parse("", "", tzd);
|
||||
fail ("must fail");
|
||||
}
|
||||
catch (SyntaxException&)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ void DirectoryIteratorsTest::testDirectoryIterator()
|
||||
result.push_back(file);
|
||||
}
|
||||
|
||||
assertEquals(7, result.size());
|
||||
assertEquals(7, (long) result.size());
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ void DirectoryIteratorsTest::testSortedDirectoryIterator()
|
||||
result.push_back(file);
|
||||
}
|
||||
|
||||
assertEquals(7, result.size());
|
||||
assertEquals(7, (long) result.size());
|
||||
assertEquals("first", result[0]);
|
||||
assertEquals("1", result[1]);
|
||||
assertEquals("2", result[2]);
|
||||
@@ -94,7 +94,7 @@ void DirectoryIteratorsTest::testSimpleRecursiveDirectoryIterator()
|
||||
result.push_back(file);
|
||||
}
|
||||
|
||||
assertEquals(20, result.size());
|
||||
assertEquals(20, (long) result.size());
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ void DirectoryIteratorsTest::testSiblingsFirstRecursiveDirectoryIterator()
|
||||
result.push_back(file);
|
||||
}
|
||||
|
||||
assertEquals(20, result.size());
|
||||
assertEquals(20, (long) result.size());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -969,7 +969,7 @@ void StringTest::testIntToString()
|
||||
{
|
||||
char pResult[POCO_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = POCO_MAX_INT_STRING_LEN;
|
||||
intToStr(0, 10, pResult, sz, false, sz + 1, ' ');
|
||||
intToStr(0, 10, pResult, sz, false, (int) sz + 1, ' ');
|
||||
fail ("must throw RangeException");
|
||||
} catch (RangeException&) { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user