继续按 align-linuxcnc 约束:补未使用字地址源码覆盖,测试通过
This commit is contained in:
@@ -805,6 +805,33 @@ if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
|
||||
fi
|
||||
grep -Fq "Multiple spindle choice (\$) words on one line" \
|
||||
"$output_dir/cnc_sim_linuxcnc_source_multiple_spindle_choice_words_error.err"
|
||||
# Source basis: LinuxCNC src/emc/rs274ngc/interp_check.cc
|
||||
# check_other_codes() rejects otherwise well-formed words that have no active
|
||||
# G/M/O code in the block to consume them.
|
||||
unused_word_error_cases=(
|
||||
"linuxcnc_d_word_no_use_error|D word with no G41, G41.1, G42, G42.1, G71, G71.1, G71.2 G73, G83 or G96 to use it"
|
||||
"linuxcnc_spindle_dollar_no_use_error|\$ (spindle selection) word with no M3, M4, M5, M19, M51, G33, G33.1, G76, G95, G96 or G97 to use it"
|
||||
"linuxcnc_e_word_no_use_error|E word with no G70, G76, M66, M67 or M68 to use it"
|
||||
"linuxcnc_h_word_no_use_error|H word with no G43 or G76 to use it"
|
||||
"linuxcnc_i_word_no_use_error|I word with no G2, G3, G5, G5.1, G6, G6.1, G10, G33.1, G76, or G87 to use it"
|
||||
"linuxcnc_j_word_no_use_error|J word with no G2, G3, G5, G5.1, G6, G6.1, G10, G76 or G87 to use it"
|
||||
"linuxcnc_k_word_no_use_error|K word with no G2, G3, G6.2, G33, G33.1, G76, or G87 to use it"
|
||||
"linuxcnc_l_word_no_use_error|L word with no G10, cutter compensation, canned cycle, digital/analog input, M98 or NURBS code"
|
||||
"linuxcnc_p_word_no_use_error|P word with no G2 G3 G4 G10 G64 G5 G5.2 G6, G6.2, G76 G82 G86 G88 G89 or M50 M51 M52 M53 M62 M63 M64 M65 M66 M98 or user M code to use it"
|
||||
"linuxcnc_q_word_no_use_error|Q word with no G5, G6, G10, G64, G73, G76, G83, M19, M66, M67, M68 or user M code that uses it"
|
||||
"linuxcnc_r_word_no_use_error|R word with no g code that uses it"
|
||||
)
|
||||
for case in "${unused_word_error_cases[@]}"; do
|
||||
fixture=${case%%|*}
|
||||
expected=${case#*|}
|
||||
if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
|
||||
"$build_dir/linuxcnc_rs274_source_dump" "tests/gcode/$fixture.ngc" \
|
||||
>"$output_dir/cnc_sim_linuxcnc_source_$fixture.json" 2>"$output_dir/cnc_sim_linuxcnc_source_$fixture.err"; then
|
||||
echo "expected $fixture.ngc to fail" >&2
|
||||
exit 1
|
||||
fi
|
||||
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
|
||||
done
|
||||
# Source basis: LinuxCNC src/emc/rs274ngc/interp_read.cc
|
||||
# read_items() only consumes a leading N word before item dispatch;
|
||||
# read_one_item() then uses the default reader table from interp_array.cc
|
||||
|
||||
Reference in New Issue
Block a user