* Bug #12774 fixed - Fix various typos.
[scilab.git] / scilab / modules / m2sci / tests / nonreg_tests / bug_1636.dia.ref
1 // <-- Non-regression test for bug 1636 -->
2 //
3 // <-- Bugzilla URL -->
4 // http://bugzilla.scilab.org/show_bug.cgi?id=1636
5 //
6 // <-- Short Description -->
7 //    When processing an m-file with multiple continuation lines in the
8 //    initial function statement, i.e the first line, I received an index
9 //    error in  line 181 of m2sci_syntax. On investigation, I found the index
10 //    k was zero and traced this to lines 141 and 171 which set k=k-1 after
11 //    appending line k to line k-1. I have produced a modified
12 //    m2sci_syntax.sci file with the line if k<> 1 then k=k-1; end instead of
13 //    k=k-1 for lines 141 and 181 which seems to work OK. No errors and
14 //    produces an sci file
15 // Copyright INRIA
16 // Scilab Project - F. Belahcene
17 MFILECONTENTS=["function A = bug1636(x,y,...";
18                 "z,t,...";
19                 "u,v,w,...";
20                 "z)";
21                 "a=x+y+z+t+u+v+w+z;"]
22  MFILECONTENTS  =
23  
24 !function A = bug1636(x,y,...  !
25 !                              !
26 !z,t,...                       !
27 !                              !
28 !u,v,w,...                     !
29 !                              !
30 !z)                            !
31 !                              !
32 !a=x+y+z+t+u+v+w+z;            !
33 MFILE=TMPDIR+"/bug1636.m"
34  MFILE  =
35  
36  TMPDIR/bug1636.m   
37 SCIFILE=TMPDIR+"/bug1636.sci"
38  SCIFILE  =
39  
40  TMPDIR/bug1636.sci   
41 mputl(MFILECONTENTS,MFILE);
42 mfile2sci(MFILE,TMPDIR,%f,%t);
43   ****** Beginning of mfile2sci() session ******
44   File to convert: TMPDIR/bug1636.m
45   Result file path: TMPDIR/
46   Recursive mode: OFF
47   Only double values used in M-file: YES
48   Verbose mode: 3
49   Generate formated code: NO
50   M-file reading...
51   M-file reading: Done
52   Syntax modification...
53   Syntax modification: Done
54   Macro to tree conversion...
55   Conversion of M-tree...
56   Conversion of M-tree: Done
57   Macro to tree conversion: Done
58   ****** End of mfile2sci() session ******
59 SCIFILECONTENTS=mgetl(SCIFILE);
60 SCIFILECONTENTSREF=["function [A] = bug1636(x,y,z,t,u,v,w,z)";
61                 "";
62                 "// Output variables initialisation (not found in input variables)"
63                 "A=[];";
64                 "";
65                 "// Display mode";
66                 "mode(0);"
67                 "";
68                 "// Display warning for floating point exception";
69                 "ieee(1);";
70                 "";
71                 "";
72                 "";
73                 "";
74                 "a = mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(x,y),z),t),u),v),w),z);"
75                 "endfunction"]
76  SCIFILECONTENTSREF  =
77  
78 !function [A] = bug1636(x,y,z,t,u,v,w,z)                               !
79 !                                                                      !
80 !                                                                      !
81 !                                                                      !
82 !// Output variables initialisation (not found in input variables)     !
83 !                                                                      !
84 !A=[];                                                                 !
85 !                                                                      !
86 !                                                                      !
87 !                                                                      !
88 !// Display mode                                                       !
89 !                                                                      !
90 !mode(0);                                                              !
91 !                                                                      !
92 !                                                                      !
93 !                                                                      !
94 !// Display warning for floating point exception                       !
95 !                                                                      !
96 !ieee(1);                                                              !
97 !                                                                      !
98 !                                                                      !
99 !                                                                      !
100 !                                                                      !
101 !                                                                      !
102 !                                                                      !
103 !                                                                      !
104 !                                                                      !
105 !                                                                      !
106 !a = mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(x,y),z),t),u),v),!
107 !     w),z);                                                           !
108 !                                                                      !
109 !endfunction                                                           !
110                 
111 if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then bugmes();quit;end