mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-29 04:17:55 +01:00
- VS2012: build/tests
- JSON: style and exceptions catch by ref fix - NumberParser: case-insensitive hex parsing - Dynamic::Var: const std::string& cast operator specialization (coaxing std::string ctor) - LocalDateTime: strftime fix (buffer too small for full tz string, use %Z instead of %z - makes no difference on windows but is more portable) - small buildwin.cmd vsvars32.bat call fix
This commit is contained in:
@@ -396,23 +396,22 @@ void LocalDateTimeTest::testTimezone()
|
||||
if (then.tm_isdst >= 0)
|
||||
{
|
||||
std::string tzNow, tzThen;
|
||||
char tzBuf[12];
|
||||
int iterations = 0;
|
||||
std::strftime(&tzBuf[0], sizeof(tzBuf), "%z", &then);
|
||||
char tzBuf[48] = {0};
|
||||
if (0 == std::strftime(&tzBuf[0], sizeof(tzBuf), "%Z", &then))
|
||||
fail ("Insufficient character array length.");
|
||||
|
||||
tzNow = tzThen = tzBuf;
|
||||
int iterations = 0;
|
||||
while (iterations < 14)
|
||||
{
|
||||
// Add one month until the timezone changes or we roll
|
||||
// over 13 months.
|
||||
t += tINCREMENT;
|
||||
then = *std::localtime(&t);
|
||||
std::strftime(&tzBuf[0], sizeof(tzBuf), "%z", &then);
|
||||
std::strftime(&tzBuf[0], sizeof(tzBuf), "%Z", &then);
|
||||
tzThen = tzBuf;
|
||||
foundDST = (tzNow == tzThen);
|
||||
if (foundDST)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (foundDST) break;
|
||||
++iterations;
|
||||
}
|
||||
if (foundDST)
|
||||
|
||||
@@ -73,7 +73,10 @@ void NumberParserTest::testParse()
|
||||
assert(NumberParser::parse("-123") == -123);
|
||||
assert(NumberParser::parseUnsigned("123") == 123);
|
||||
assert(NumberParser::parseHex("12AB") == 0x12ab);
|
||||
assert(NumberParser::parseHex("0X12AB") == 0x12ab);
|
||||
assert(NumberParser::parseHex("0x12AB") == 0x12ab);
|
||||
assert(NumberParser::parseHex("0x12aB") == 0x12ab);
|
||||
assert(NumberParser::parseHex("0X98Fe") == 0x98fe);
|
||||
assert(NumberParser::parseHex("0x0") == 0);
|
||||
assert(NumberParser::parseHex("00") == 0);
|
||||
assert(NumberParser::parseOct("123") == 0123);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user