From 141b8ec432e56e5fb1c140446172890a2d6774ab Mon Sep 17 00:00:00 2001 From: Cedric Delamarre Date: Thu, 13 Jul 2017 14:07:25 +0200 Subject: [PATCH] [bug_15199] tests added test_run optimization bug_15199 test_run optimization bug_15199 mode_nwni_profiling Change-Id: Ie7bea5308bceb6585459a5544d6ec297c4510f46 --- scilab/CHANGES.md | 2 +- .../tests/nonreg_tests/bug_15199.dia.ref | 24 ++++++++++++++++++ .../optimization/tests/nonreg_tests/bug_15199.tst | 26 ++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 scilab/modules/optimization/tests/nonreg_tests/bug_15199.dia.ref create mode 100644 scilab/modules/optimization/tests/nonreg_tests/bug_15199.tst diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md index d03b9ff..30b6b22 100644 --- a/scilab/CHANGES.md +++ b/scilab/CHANGES.md @@ -386,6 +386,7 @@ the [development mailing list](dev@lists.scilab.org) for a particular toolbox. * [#15144](http://bugzilla.scilab.org/show_bug.cgi?id=15144): `mean` and `stdev` could not be overloaded. * [#15185](http://bugzilla.scilab.org/show_bug.cgi?id=15185): "Region to Superblock" did not restore broken links. * [#15188](http://bugzilla.scilab.org/show_bug.cgi?id=15188): Failed to load hdf5_is_file function. +* [#15199](http://bugzilla.scilab.org/show_bug.cgi?id=15199): Scilab crash when using fsolve for functions containing other functions. * [#15205](http://bugzilla.scilab.org/show_bug.cgi?id=15205): `get_scicos_version` returned the previous version. * [#15207](http://bugzilla.scilab.org/show_bug.cgi?id=15207): `xcos(scs_m)` did not work for sub-systems. @@ -730,4 +731,3 @@ the [development mailing list](dev@lists.scilab.org) for a particular toolbox. * [#14685](http://bugzilla.scilab.org/show_bug.cgi?id=14685): datavec produced an invalid index error. * [#14980] (http://bugzilla.scilab.org/show_bug.cgi?id=14980): The datatip display of the root locus arcs is broken. * [#14992] (http://bugzilla.scilab.org/show_bug.cgi?id=14992): `readgateway` has been removed, use `whereis` instead. - diff --git a/scilab/modules/optimization/tests/nonreg_tests/bug_15199.dia.ref b/scilab/modules/optimization/tests/nonreg_tests/bug_15199.dia.ref new file mode 100644 index 0000000..9c8f22f --- /dev/null +++ b/scilab/modules/optimization/tests/nonreg_tests/bug_15199.dia.ref @@ -0,0 +1,24 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2017 - ESI-Group - Delamarre Cedric +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// <-- CLI SHELL MODE --> +// +// <-- Non-regression test for bug 15199 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/show_bug.cgi?id=15199 +// +// <-- Short Description --> +// Scilab crash when using fsolve for functions containing other functions +// +function y=fy(x) +function z=fz(t) +z=t-x +endfunction +T=fsolve(1,fz) +y=T-x +endfunction +assert_checkequal(fsolve(1,fy), 1); diff --git a/scilab/modules/optimization/tests/nonreg_tests/bug_15199.tst b/scilab/modules/optimization/tests/nonreg_tests/bug_15199.tst new file mode 100644 index 0000000..c298fb2 --- /dev/null +++ b/scilab/modules/optimization/tests/nonreg_tests/bug_15199.tst @@ -0,0 +1,26 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2017 - ESI-Group - Delamarre Cedric +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// <-- CLI SHELL MODE --> +// +// <-- Non-regression test for bug 15199 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/show_bug.cgi?id=15199 +// +// <-- Short Description --> +// Scilab crash when using fsolve for functions containing other functions +// + +function y=fy(x) +function z=fz(t) +z=t-x +endfunction +T=fsolve(1,fz) +y=T-x +endfunction + +assert_checkequal(fsolve(1,fy), 1); -- 1.7.9.5