Ticket #764 (closed bug: fixed)
t/codingstd/c_indent.t needs to handle indents after #ifdef better
Reported by: | jkeenan | Owned by: | jkeenan |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | coding_standards | Version: | 1.2.0 |
Severity: | medium | Keywords: | codingstd indent |
Cc: | Language: | ||
Patch status: | applied | Platform: |
Description
The following was part of a modification made to src/pmc/filehandle.pmc today:
Index: src/pmc/filehandle.pmc =================================================================== --- src/pmc/filehandle.pmc (revision 39541) +++ src/pmc/filehandle.pmc (working copy) @@ -359,7 +359,7 @@ METHOD readline_interactive(STRING *prompt :optional, INTVAL got_prompt :opt_flag) { STRING *string_result = NULL; #ifdef PARROT_HAS_READLINE - char * const r = readline(got_prompt ? prompt->strstart : NULL); + char * const r = readline(got_prompt ? prompt->strstart : NULL);
The indent was increased from 4 to 8 to be consistent with all the other indentation in the file.
Unfortunately, this sparks a failure in t/codingstd/c_indent.t.
$ perl t/codingstd/c_indent.t src/pmc/filehandle.pmc 1..2 ok 1 - Correctly indented preprocessor directives not ok 2 - Correctly indented C files # Failed test 'Correctly indented C files' # at t/codingstd/c_indent.t line 221. # incorrect indenting in C file found 1 occurrences in 1 files: # src/pmc/filehandle.pmc:362 # apparent non-4 space indenting (8 spaces) # Looks like you failed 1 test of 2.
Now, this is a case where the limitation of our test file is the cause of the problem. We need to fix t/codingstd/c_indent.t to handle cases like this.
Since we release tomorrow, we need a hack for the source code file. This works and was reviewed by Coke on #parrot.
Index: src/pmc/filehandle.pmc =================================================================== --- src/pmc/filehandle.pmc (revision 39578) +++ src/pmc/filehandle.pmc (working copy) @@ -359,6 +359,7 @@ METHOD readline_interactive(STRING *prompt :optional, INTVAL got_prompt :opt_flag) { STRING *string_result = NULL; #ifdef PARROT_HAS_READLINE + /* 4-column indent to get c_indent.t to DTRT */ char * const r = readline(got_prompt ? prompt->strstart : NULL); if (r) {
kid51
Change History
Note: See
TracTickets for help on using
tickets.