X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tests%2Ftest-getopt_long.h;h=345a796ad4d7521a9c69d95f2c87218bdf7f764f;hb=931b01b091932a1f796c23379ea32abb68bd5895;hp=7a748674aeda35dacf5fdd0a71b8d86560f437ca;hpb=7be93f2d05131d061bd4790ae33c8d50f50010d7;p=platform%2Fupstream%2Fm4.git diff --git a/tests/test-getopt_long.h b/tests/test-getopt_long.h index 7a74867..345a796 100644 --- a/tests/test-getopt_long.h +++ b/tests/test-getopt_long.h @@ -1,5 +1,5 @@ /* Test of command line argument processing. - Copyright (C) 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2009-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -314,6 +314,25 @@ test_getopt_long (void) } } + /* Test that 'W' does not dump core: + http://sourceware.org/bugzilla/show_bug.cgi?id=12922 */ + { + int argc = 0; + const char *argv[10]; + int option_index; + int c; + + argv[argc++] = "program"; + argv[argc++] = "-W"; + argv[argc++] = "dummy"; + argv[argc] = NULL; + optind = 1; + opterr = 0; + c = do_getopt_long (argc, argv, "W;", NULL, &option_index); + ASSERT (c == 'W'); + ASSERT (optind == 2); + } + /* Test processing of boolean short options. */ for (start = 0; start <= 1; start++) {