Extra tests for string2ll

This commit is contained in:
Pieter Noordhuis
2011-05-05 16:32:22 +02:00
parent c040cbd625
commit 3edbcab95a
+8
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);