Extra tests for string2ll

This commit is contained in:
Pieter Noordhuis 2011-04-27 14:38:58 +02:00
parent 6e258c76bf
commit 01f36192c8

View File

@ -333,6 +333,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);