Scicos: fix SIGSEGV on blocks_link.tst 59/18959/3
Clément DAVID [Mon, 23 Jan 2017 10:19:27 +0000 (11:19 +0100)]
Change-Id: I188173368605fa52a6f3bc3397f31008fe73d4f8

scilab/modules/scicos/src/cpp/view_scilab/GraphicsAdapter.cpp
scilab/modules/xcos/tests/unit_tests/blocks_link.dia.ref
scilab/modules/xcos/tests/unit_tests/blocks_link.tst

index dbcc279..357360d 100644 (file)
@@ -780,7 +780,12 @@ void GraphicsAdapter::add_partial_links_information(Controller& controller, mode
 
             for (size_t i = 0; i < originalChildren.size(); ++i)
             {
-                add_partial_links_information(controller, controller.getObject(originalChildren[i]), controller.getObject(clonedChildren[i]));
+                // a clone preserve position thus null ID, ignore them on
+                // this loop
+                if (originalChildren[i] != ScicosID())
+                {
+                    add_partial_links_information(controller, controller.getObject(originalChildren[i]), controller.getObject(clonedChildren[i]));
+                }
             }
             break;
         }
index 3c1c277..018fc00 100644 (file)
@@ -23,15 +23,15 @@ defaultlibs = ["Branching",
 "Threshold"];
 defaultlibs  = defaultlibs + "lib";
 notTested = ["SUPER_f", "DSUPER", ..              // Specific blocks
-"IN_f", "OUT_f", "INIMPL_f", "OUTIMPL_f",..
-"CLKIN_f", "CLKINV_f", "CLKOUT_f", "CLKOUTV_f",..
-"VirtualCLK0",..
-"SPLIT_f", "CLKSPLIT_f",..
-"TEXT_f", "PAL_f", "DEBUG", "DEBUG_SCICOS"..
+"IN_f", "OUT_f", "INIMPL_f", "OUTIMPL_f", ..
+"CLKIN_f", "CLKINV_f", "CLKOUT_f", "CLKOUTV_f", ..
+"VirtualCLK0", ..
+"SPLIT_f", "CLKSPLIT_f", ..
+"TEXT_f", "PAL_f", "DEBUG", "DEBUG_SCICOS", ..
 "SIGNUM", "MAXMIN", "ABS_VALUE", ..    // buggy blocks
 "PENDULUM_ANIM", "BPLATFORM", "MBLOCK", ..
 "TKSCALE", "BARXY", ..
-"SLIDER_f", "WFILE_f", "func_block" ..  // Deprecated blocks
+"SLIDER_f", "WFILE_f", "func_block", "SOM_f", ..  // Deprecated blocks
 "MPBLOCK", "fortran_block", ..       // blocks with code generation
 "CBLOCK", "scifunc_block", "scifunc_block_m"];
 invalidFunctions = unique(gsort(["csuper", "junk", ..
@@ -78,10 +78,6 @@ function [xx, yy, ok, gc] = edit_curv(xx, yy,  axis, args, gc)
         gc = list(rect, axisdata);
     end
 endfunction
-// Stubbing the messagebox method
-function [btn] = messagebox(msg, msgboxtitle, msgboxicon, buttons, ismodal)
-    btn=1;
-endfunction
 // Stubbing global scicos flags
 needcompile = 0;
 alreadyran = %f;
index 36a0090..c5fb09f 100644 (file)
@@ -26,15 +26,15 @@ defaultlibs = ["Branching",
 
 defaultlibs  = defaultlibs + "lib";
 notTested = ["SUPER_f", "DSUPER", ..              // Specific blocks
-"IN_f", "OUT_f", "INIMPL_f", "OUTIMPL_f",..
-"CLKIN_f", "CLKINV_f", "CLKOUT_f", "CLKOUTV_f",..
-"VirtualCLK0",..
-"SPLIT_f", "CLKSPLIT_f",..
-"TEXT_f", "PAL_f", "DEBUG", "DEBUG_SCICOS"..
+"IN_f", "OUT_f", "INIMPL_f", "OUTIMPL_f", ..
+"CLKIN_f", "CLKINV_f", "CLKOUT_f", "CLKOUTV_f", ..
+"VirtualCLK0", ..
+"SPLIT_f", "CLKSPLIT_f", ..
+"TEXT_f", "PAL_f", "DEBUG", "DEBUG_SCICOS", ..
 "SIGNUM", "MAXMIN", "ABS_VALUE", ..    // buggy blocks
 "PENDULUM_ANIM", "BPLATFORM", "MBLOCK", ..
 "TKSCALE", "BARXY", ..
-"SLIDER_f", "WFILE_f", "func_block" ..  // Deprecated blocks
+"SLIDER_f", "WFILE_f", "func_block", "SOM_f", ..  // Deprecated blocks
 "MPBLOCK", "fortran_block", ..       // blocks with code generation
 "CBLOCK", "scifunc_block", "scifunc_block_m"];
 
@@ -88,11 +88,6 @@ function [xx, yy, ok, gc] = edit_curv(xx, yy,  axis, args, gc)
     end
 endfunction
 
-// Stubbing the messagebox method
-function [btn] = messagebox(msg, msgboxtitle, msgboxicon, buttons, ismodal)
-    btn=1;
-endfunction
-
 // Stubbing global scicos flags
 needcompile = 0;
 alreadyran = %f;