summaryrefslogtreecommitdiffstats
path: root/tests/nonRegression/bug925.sci
blob: 5ea7d972a8c514941548e9d7922ea613effe8004 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// <-- Non-regression test for bug 925 -->
//
// <-- Bugzilla URL -->
// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=925
//
// <-- Short Description -->
//    Bad insertion conversion
//
//    Following Matlab code:
//    function test(A,B)
//    A(3)=B(4);
//
//    is converted to Scilab code :
//    function [] = test(A,B)
//
//    // Display warning for floating point exception
//    ieee(1)
//
//    A = mtlb_i(A,1,mtlb_e(B,3));
//    endfunction
//
//    what is obviously wrong !
//    4 has become 1 ....

// Copyright INRIA
// Scilab Project - V. Couvert

// Modified by Pierre MARECHAL
// Copyright INRIA
// Date : 18 Mar 2005

MFILECONTENTS=["function bug925(A,B)";"A(4)=B(3)"]

MFILE=TMPDIR+"/bug925.m"
SCIFILE=TMPDIR+"/bug925.sci"

mputl(MFILECONTENTS,MFILE);
mfile2sci(MFILE,TMPDIR);
SCIFILECONTENTS=mgetl(SCIFILE);

SCIFILECONTENTSREF=["function [] = bug925(A,B)";
		"";
		"// Display mode";
		"mode(0);";
		"";
		"// Display warning for floating point exception";
		"ieee(1);";
		"";
		"A = mtlb_i(A,4,mtlb_e(B,3));";
		"endfunction"]


if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then
	affich_result(%F,925);
else
	affich_result(%T,925);
end