diff --git a/src/ExprIntrp/ExprIntrp.lex b/src/ExprIntrp/ExprIntrp.lex index 26df2a2798..3654fe71d1 100755 --- a/src/ExprIntrp/ExprIntrp.lex +++ b/src/ExprIntrp/ExprIntrp.lex @@ -37,6 +37,7 @@ void ExprIntrp_start_string(char* str) void ExprIntrp_stop_string() { ExprIntrp_delete_buffer(ExprIntrp_bufstring); + ExprIntrp_bufstring = (YY_BUFFER_STATE) 0; } int yywrap() diff --git a/src/QABugs/QABugs_11.cxx b/src/QABugs/QABugs_11.cxx old mode 100644 new mode 100755 index 8f11173c1e..c17eec4ce1 --- a/src/QABugs/QABugs_11.cxx +++ b/src/QABugs/QABugs_11.cxx @@ -5330,6 +5330,29 @@ Standard_Integer bcarray (Draw_Interpretor& di, Standard_Integer argc, const cha return 0; } +#include +Standard_Integer CR23403 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) +{ + + if (argc != 2) { + di << "Usage : " << argv[0] << " string\n"; + return 1; + } + + Standard_CString aString = argv[1]; + Handle(ExprIntrp_GenExp) myExpr = ExprIntrp_GenExp::Create(); + try { + OCC_CATCH_SIGNALS + myExpr->Process( aString ); + } + catch(Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + di << "Exception : " << aFail->GetMessageString() << "\n"; + } + + return 0; +} + void QABugs::Commands_11(Draw_Interpretor& theCommands) { const char *group = "QABugs"; @@ -5439,5 +5462,6 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) { theCommands.Add("bcarray", "bcarray", __FILE__, bcarray, group); theCommands.Add("OCC22762", "OCC22762 x1 y1 z1 x2 y2 z3", __FILE__, OCC22762, group); theCommands.Add("OCC22558", "OCC22558 x_vec y_vec z_vec x_dir y_dir z_dit x_pnt y_pnt z_pnt", __FILE__, OCC22558, group); + theCommands.Add("CR23403", "CR23403 string", __FILE__, CR23403, group); return; } diff --git a/tests/bugs/demo/CR23410 b/tests/bugs/demo/CR23410 index 2949ea2bcb..2a4b9ec643 100755 --- a/tests/bugs/demo/CR23410 +++ b/tests/bugs/demo/CR23410 @@ -7,9 +7,12 @@ puts "" ####################################################################### pload QAcommands -set R_check 0.45098000764846802 -set G_check 1 -set B_check 0.066666000000000003 +set r_1 0.4 +set r_2 0.5 +set g_1 0.9 +set g_2 1 +set b_1 0 +set b_2 0.1 set x1 128 set y1 235 box result 100 100 100 @@ -22,7 +25,28 @@ regexp {RED +: +([-0-9.+eE]+)} $color full rd regexp {GREEN +: +([-0-9.+eE]+)} $color full gr regexp {BLUE +: +([-0-9.+eE]+)} $color full bl -if { $rd != $R_check || $gr != $G_check || $bl != $B_check} { +set red_status 0 +if { $rd < $r_1 || $rd > $r_2 } { + set red_status 1 +} else { + set red_status 0 +} + +set green_status 0 +if { $gr < $g_1 || $gr > $g_2 } { + set green_status 1 +} else { + set green_status 0 +} + +set blue_status 0 +if { $bl < $b_1 || $bl > $b_2 } { + set blue_status 1 +} else { + set blue_status 0 +} + +if { $red_status != 0 || $green_status != 0 || $blue_status != 0 } { puts "Error : color are not equal" puts "Error : QA command QAGetPixelColor doesn't work properly" } diff --git a/tests/bugs/fclasses/CR23403 b/tests/bugs/fclasses/CR23403 new file mode 100755 index 0000000000..b3b65a6e68 --- /dev/null +++ b/tests/bugs/fclasses/CR23403 @@ -0,0 +1,12 @@ +####################################################################### +# Crash when parsing an expression with lexical error +####################################################################### +pload QAcommands + +set result [CR23403 \t] +set length [llength ${result}] + +puts "" +if { ${length} != 0 } { + puts "Error : parsing is incorrect" +} \ No newline at end of file diff --git a/tests/bugs/grids.list b/tests/bugs/grids.list index 21bd88e754..edfa79ce12 100755 --- a/tests/bugs/grids.list +++ b/tests/bugs/grids.list @@ -1,6 +1,8 @@ 001 demo -002 iges -003 xde +002 fclasses +003 iges +004 xde +