Commit a9c111ed authored by Edward Welbourne's avatar Edward Welbourne Committed by Simon Hausmann
Browse files

Clean-up in QDateTime's parsing of ISODate{,WithMs}


Actually check that there's a T where ISO 8601 wants it (instead of
just skipping over whatever's there), with something after it; move
some declarations later; add some comments; and use the QStringRef API
more cleanly (so that it's easier to see what's going on).  Simplify a
loop condition to avoid the need for a post-loop fix-up.

This incidentally prevents an assertion failure (which brought the
mess to my attention) parsing a short string as an ISO date-time; if
there's a T with nothing after it, we won't try to read at index -1 in
the following text.  (The actual fail seen had a Z where the T should
have been, with nothing after it.)

Add tests for invalid ISOdate cases that triggered the assertion.

Change-Id: Ided9adf62a56d98f144bdf91b40f918e22bd82cd
Reviewed-by: default avatarIsrael Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: default avatarThiago Macieira <thiago.macieira@intel.com>
Showing with 19 additions and 7 deletions
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment