summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan CORNET <allan.cornet@scilab.org>2011-05-11 12:39:43 +0200
committerVincent COUVERT <vincent.couvert@scilab.org>2011-05-11 12:53:09 +0200
commit26010e1de341df941b54da7c31c1dbd380c8bb06 (patch)
treefdc81174c16fab03efd6e3c4d55d6e5c08f1dcef
parent118800f5c887479029f6f7eaea46e27a622cf6bb (diff)
downloadscilab-26010e1de341df941b54da7c31c1dbd380c8bb06.zip
scilab-26010e1de341df941b54da7c31c1dbd380c8bb06.tar.gz
Bug 9457 fixed - set('figure_style', 'new') returned a error message.
Change-Id: Ia0163468668942276ec542fe2310724fca3e51f3
-rw-r--r--scilab/CHANGES_5.3.X2
-rw-r--r--scilab/modules/graphics/sci_gateway/c/sci_set.c12
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_9457.dia.ref19
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_9457.tst24
4 files changed, 55 insertions, 2 deletions
diff --git a/scilab/CHANGES_5.3.X b/scilab/CHANGES_5.3.X
index 7827ecd..10997cc 100644
--- a/scilab/CHANGES_5.3.X
+++ b/scilab/CHANGES_5.3.X
@@ -361,6 +361,8 @@ Bug Fixes:
361 361
362* Bug 9442 fixed - Sometimes, an exception could be thrown in the console. 362* Bug 9442 fixed - Sometimes, an exception could be thrown in the console.
363 363
364* Bug 9457 fixed - set("figure_style", "new") returned a error message.
365
364 366
365 Changes between versions 5.3.0 and 5.3.1 of Scilab 367 Changes between versions 5.3.0 and 5.3.1 of Scilab
366 ================================================= 368 =================================================
diff --git a/scilab/modules/graphics/sci_gateway/c/sci_set.c b/scilab/modules/graphics/sci_gateway/c/sci_set.c
index 5a9f06c..c07544f 100644
--- a/scilab/modules/graphics/sci_gateway/c/sci_set.c
+++ b/scilab/modules/graphics/sci_gateway/c/sci_set.c
@@ -261,7 +261,7 @@ int sci_set(char *fname, unsigned long fname_len)
261 } 261 }
262 else 262 else
263 { 263 {
264#define NB_PROPERTIES_SUPPORTED 5 264#define NB_PROPERTIES_SUPPORTED 6
265 /* No object specified */ 265 /* No object specified */
266 /* ONLY supported properties are */ 266 /* ONLY supported properties are */
267 /* 'current_entity' */ 267 /* 'current_entity' */
@@ -269,17 +269,20 @@ int sci_set(char *fname, unsigned long fname_len)
269 /* 'current_figure' */ 269 /* 'current_figure' */
270 /* 'current_axes' */ 270 /* 'current_axes' */
271 /* 'default_values' */ 271 /* 'default_values' */
272 /* 'figure_style' for compatibility but do nothing */
272 /* others values must return a error */ 273 /* others values must return a error */
273 char *propertyField = cstk(l2); 274 char *propertyField = cstk(l2);
274 char *propertiesSupported[NB_PROPERTIES_SUPPORTED] = {"current_entity", 275 char *propertiesSupported[NB_PROPERTIES_SUPPORTED] = {"current_entity",
275 "hdl", 276 "hdl",
276 "current_figure", 277 "current_figure",
277 "current_axes", 278 "current_axes",
279 "figure_style",
278 "default_values"}; 280 "default_values"};
279 int i = 0; 281 int i = 0;
280 int iPropertyFounded = 0; 282 int iPropertyFounded = 0;
281 for (i = 0; i < NB_PROPERTIES_SUPPORTED; i++) 283 for (i = 0; i < NB_PROPERTIES_SUPPORTED; i++)
282 { 284 {
285
283 if (strcmp(propertiesSupported[i], propertyField) == 0) 286 if (strcmp(propertiesSupported[i], propertyField) == 0)
284 { 287 {
285 iPropertyFounded = 1; 288 iPropertyFounded = 1;
@@ -288,7 +291,12 @@ int sci_set(char *fname, unsigned long fname_len)
288 291
289 if (iPropertyFounded) 292 if (iPropertyFounded)
290 { 293 {
291 sciSet( NULL, cstk(l2), &l3, valueType, &numrow3, &numcol3); 294 // we do nothing with "figure_style" "new" (to remove in 5.4)
295 int bDoSet = ((isMatrixOfString) && (strcmp(propertyField, "figure_style") == 0) && (strcmp(cstk(l3), "new") == 0)) != 1;
296 if (bDoSet)
297 {
298 sciSet( NULL, cstk(l2), &l3, valueType, &numrow3, &numcol3);
299 }
292 } 300 }
293 else 301 else
294 { 302 {
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_9457.dia.ref b/scilab/modules/graphics/tests/nonreg_tests/bug_9457.dia.ref
new file mode 100644
index 0000000..aff9453
--- /dev/null
+++ b/scilab/modules/graphics/tests/nonreg_tests/bug_9457.dia.ref
@@ -0,0 +1,19 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2011 - DIGITEO - Allan CORNET
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- TEST WITH GRAPHIC -->
8// <-- Non-regression test for bug 9457 -->
9//
10// <-- Bugzilla URL -->
11// http://bugzilla.scilab.org/show_bug.cgi?id=9457
12//
13// <-- Short Description -->
14// set("figure_style", "new") returned a error message
15ierr = execstr("set(""figure_style"", ""new"")", "errcatch");
16if ierr <> 0 then bugmes();quit;end
17ierr = execstr("set(""figure_style"", ""old"")", "errcatch");
18if ierr <> 999 then bugmes();quit;end
19if lasterror() <> msprintf("%s", gettext("Old graphic mode is no longer available. Please refer to the set help page.\n")) then bugmes();quit;end
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_9457.tst b/scilab/modules/graphics/tests/nonreg_tests/bug_9457.tst
new file mode 100644
index 0000000..3c59aa2
--- /dev/null
+++ b/scilab/modules/graphics/tests/nonreg_tests/bug_9457.tst
@@ -0,0 +1,24 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2011 - DIGITEO - Allan CORNET
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7
8// <-- TEST WITH GRAPHIC -->
9
10// <-- Non-regression test for bug 9457 -->
11//
12// <-- Bugzilla URL -->
13// http://bugzilla.scilab.org/show_bug.cgi?id=9457
14//
15// <-- Short Description -->
16// set("figure_style", "new") returned a error message
17
18ierr = execstr("set(""figure_style"", ""new"")", "errcatch");
19if ierr <> 0 then pause, end
20
21ierr = execstr("set(""figure_style"", ""old"")", "errcatch");
22if ierr <> 999 then pause, end
23if lasterror() <> msprintf("%s", gettext("Old graphic mode is no longer available. Please refer to the set help page.\n")) then pause, end
24