Extra tests for string2ll

This commit is contained in:
Pieter Noordhuis 2011-04-27 14:38:58 +02:00
parent c040cbd625
commit 3edbcab95a

View File

@ -336,6 +336,14 @@ void test_string2ll(void) {
strcpy(buf,"+1");
assert(string2ll(buf,strlen(buf),&v) == 0);
/* Leading space. */
strcpy(buf," 1");
assert(string2ll(buf,strlen(buf),&v) == 0);
/* Trailing space. */
strcpy(buf,"1 ");
assert(string2ll(buf,strlen(buf),&v) == 0);
/* May not start with 0. */
strcpy(buf,"01");
assert(string2ll(buf,strlen(buf),&v) == 0);