test-parse-options: update to handle negative ints
Fix the printf specification to treat 'integer' as the signed type that it is and add a test that checks that we parse negative option arguments. Signed-off-by: Charles Bailey <cbailey32@bloomberg.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
5c040f5af5
commit
81a48cc080
@ -82,7 +82,7 @@ int main(int argc, char **argv)
|
||||
argc = parse_options(argc, (const char **)argv, prefix, options, usage, 0);
|
||||
|
||||
printf("boolean: %d\n", boolean);
|
||||
printf("integer: %u\n", integer);
|
||||
printf("integer: %d\n", integer);
|
||||
printf("timestamp: %lu\n", timestamp);
|
||||
printf("string: %s\n", string ? string : "(not set)");
|
||||
printf("abbrev: %d\n", abbrev);
|
||||
|
Reference in New Issue
Block a user