Skip to content

Commit

Permalink
Extra tests for string2ll
Browse files Browse the repository at this point in the history
  • Loading branch information
pietern committed May 5, 2011
1 parent c040cbd commit 3edbcab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/util.c
Expand Up @@ -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);
Expand Down

0 comments on commit 3edbcab

Please sign in to comment.