From: Bruno JOFRET Date: Thu, 14 Feb 2013 09:14:15 +0000 (+0100) Subject: * Bug #10278 fixed - clear(1) returns a wrong error message. X-Git-Tag: 5.4.1~344 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=38eaac29fb40b8c9cb50a6e3159d4834a089aba8 * Bug #10278 fixed - clear(1) returns a wrong error message. Change-Id: I7e9eb99047211a0dc1ae5eab03a0eb9fda667d3e --- diff --git a/scilab/CHANGES_5.4.X b/scilab/CHANGES_5.4.X index ce43834..a885699 100644 --- a/scilab/CHANGES_5.4.X +++ b/scilab/CHANGES_5.4.X @@ -230,6 +230,8 @@ Bug fixes * Bug #9305 fixed - In the optimisation help page, new chapter "Least Squares functions" created. +* Bug #10278 fixed - clear(1) returns a wrong error message. + * Bug #10415 fixed - Remove a session line in history causes the removal of the session node in history browser diff --git a/scilab/modules/core/sci_gateway/c/sci_clear.c b/scilab/modules/core/sci_gateway/c/sci_clear.c index d71ef4e..7730a82 100644 --- a/scilab/modules/core/sci_gateway/c/sci_clear.c +++ b/scilab/modules/core/sci_gateway/c/sci_clear.c @@ -113,7 +113,7 @@ static int sci_clear_n_rhs(const char *fname) if (isScalar(pvApiCtx, piAddressVar)) { - Scierror(201, _("%s: Wrong type for argument %d: Valid variable name expected.\n"), fname, k + 1); + Scierror(201, _("%s: Wrong type for argument %d: A single string expected.\n"), fname, k + 1); return 0; } else diff --git a/scilab/modules/core/tests/nonreg_tests/bug_10278.dia.ref b/scilab/modules/core/tests/nonreg_tests/bug_10278.dia.ref new file mode 100644 index 0000000..3d9bff2 --- /dev/null +++ b/scilab/modules/core/tests/nonreg_tests/bug_10278.dia.ref @@ -0,0 +1,20 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2011 - DIGITEO - Allan CORNET +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// +// <-- Non-regression test for bug 10278 --> +// +// <-- JVM NOT MANDATORY --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/show_bug.cgi?id=10278 +// +// <-- Short Description --> +// clear(1) returned a wrong error message +ierr = execstr("clear(1)", "errcatch"); +assert_checkequal(ierr, 201); +msg_ref = msprintf(gettext("%s: Wrong type for argument %d: A single string expected.\n"), "clear", 1); +assert_checkerror ("clear(1)", msg_ref); diff --git a/scilab/modules/core/tests/nonreg_tests/bug_10278.tst b/scilab/modules/core/tests/nonreg_tests/bug_10278.tst new file mode 100644 index 0000000..0607aa8 --- /dev/null +++ b/scilab/modules/core/tests/nonreg_tests/bug_10278.tst @@ -0,0 +1,21 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2011 - DIGITEO - Allan CORNET +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// +// <-- Non-regression test for bug 10278 --> +// +// <-- JVM NOT MANDATORY --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/show_bug.cgi?id=10278 +// +// <-- Short Description --> +// clear(1) returned a wrong error message + +ierr = execstr("clear(1)", "errcatch"); +assert_checkequal(ierr, 201); +msg_ref = msprintf(gettext("%s: Wrong type for argument %d: A single string expected.\n"), "clear", 1); +assert_checkerror ("clear(1)", msg_ref); diff --git a/scilab/modules/core/tests/unit_tests/clear.dia.ref b/scilab/modules/core/tests/unit_tests/clear.dia.ref index 543ba09..89c6e62 100644 --- a/scilab/modules/core/tests/unit_tests/clear.dia.ref +++ b/scilab/modules/core/tests/unit_tests/clear.dia.ref @@ -32,7 +32,7 @@ msg_ref = msprintf(gettext("Redefining permanent variable.\n")); assert_checkequal (msg_err, msg_ref); ierr = execstr("clear(1)", "errcatch"); assert_checkequal(ierr, 201); -msg_ref = msprintf(gettext("%s: Wrong type for argument %d: Valid variable name expected.\n"), "clear", 1); +msg_ref = msprintf(gettext("%s: Wrong type for argument %d: A single string expected.\n"), "clear", 1); assert_checkerror ("clear(1)", msg_ref); ierr = execstr("clear toto", "errcatch"); assert_checkequal(ierr, 0); diff --git a/scilab/modules/core/tests/unit_tests/clear.tst b/scilab/modules/core/tests/unit_tests/clear.tst index bb169f6..3992470 100644 --- a/scilab/modules/core/tests/unit_tests/clear.tst +++ b/scilab/modules/core/tests/unit_tests/clear.tst @@ -39,7 +39,7 @@ assert_checkequal (msg_err, msg_ref); ierr = execstr("clear(1)", "errcatch"); assert_checkequal(ierr, 201); -msg_ref = msprintf(gettext("%s: Wrong type for argument %d: Valid variable name expected.\n"), "clear", 1); +msg_ref = msprintf(gettext("%s: Wrong type for argument %d: A single string expected.\n"), "clear", 1); assert_checkerror ("clear(1)", msg_ref); ierr = execstr("clear toto", "errcatch");