restore tests from operations module
[scilab.git] / scilab / modules / ast / tests / unit_tests / addition_output_type.dia.ref
1 // ============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
4 //
5 //  This file is distributed under the same license as the Scilab package.
6 // ============================================================================
7 // <-- JVM NOT MANDATORY -->
8 function ret = bool(b)
9     ret = (b == 1);
10 endfunction
11 types = list(int8, uint8, int16, uint16, int32, uint32, int64, uint64, double, bool);
12 ref =[  "int8","uint8","int16","uint16","int32","uint32","int64","uint64","int8","int8"; ...
13         "uint8","uint8","uint16","uint16","uint32","uint32","uint64","uint64","uint8","uint8"; ...
14         "int16","uint16","int16","uint16","int32","uint32","int64","uint64","int16","int16"; ...
15         "uint16","uint16","uint16","uint16","uint32","uint32","uint64","uint64","uint16","uint16"; ...
16         "int32","uint32","int32","uint32","int32","uint32","int64","uint64","int32","int32"; ...
17         "uint32","uint32","uint32","uint32","uint32","uint32","uint64","uint64","uint32","uint32"; ...
18         "int64","uint64","int64","uint64","int64","uint64","int64","uint64","int64","int64"; ...
19         "uint64","uint64","uint64","uint64","uint64","uint64","uint64","uint64","uint64","uint64"; ...
20         "int8","uint8","int16","uint16","int32","uint32","int64","uint64","constant","constant"; ...
21         "int8","uint8","int16","uint16","int32","uint32","int64","uint64","constant","boolean"]
22 ref  = 
23        column 1 to 9
24 !int8    uint8   int16   uint16  int32   uint32  int64   uint64  int8      !
25 !                                                                          !
26 !uint8   uint8   uint16  uint16  uint32  uint32  uint64  uint64  uint8     !
27 !                                                                          !
28 !int16   uint16  int16   uint16  int32   uint32  int64   uint64  int16     !
29 !                                                                          !
30 !uint16  uint16  uint16  uint16  uint32  uint32  uint64  uint64  uint16    !
31 !                                                                          !
32 !int32   uint32  int32   uint32  int32   uint32  int64   uint64  int32     !
33 !                                                                          !
34 !uint32  uint32  uint32  uint32  uint32  uint32  uint64  uint64  uint32    !
35 !                                                                          !
36 !int64   uint64  int64   uint64  int64   uint64  int64   uint64  int64     !
37 !                                                                          !
38 !uint64  uint64  uint64  uint64  uint64  uint64  uint64  uint64  uint64    !
39 !                                                                          !
40 !int8    uint8   int16   uint16  int32   uint32  int64   uint64  constant  !
41 !                                                                          !
42 !int8    uint8   int16   uint16  int32   uint32  int64   uint64  constant  !
43        column 10 to 10
44 !int8      !
45 !          !
46 !uint8     !
47 !          !
48 !int16     !
49 !          !
50 !uint16    !
51 !          !
52 !int32     !
53 !          !
54 !uint32    !
55 !          !
56 !int64     !
57 !          !
58 !uint64    !
59 !          !
60 !constant  !
61 !          !
62 !boolean   !
63 typesize = size(types);
64 //Scalar + Scalar
65 for i = 1 : typesize
66     for j = 1 : typesize
67         ScalarScalarComputed(i,j) = typeof(types(i)(1) + types(j)(1));
68     end
69 end
70 assert_checkequal(ref, ScalarScalarComputed);
71 //Scalar + Matrix
72 for i = 1 : typesize
73     for j = 1 : typesize
74         ScalarMatrixComputed(i,j) = typeof(types(i)(1) + types(j)([1 2]));
75     end
76 end
77 assert_checkequal(ref, ScalarMatrixComputed);
78 //Matrix + Scalar
79 for i = 1 : typesize
80     for j = 1 : typesize
81         MatrixScalarComputed(i,j) = typeof(types(i)([1 2]) + types(j)(1));
82     end
83 end
84 assert_checkequal(ref, MatrixScalarComputed);
85 //Matrix + Matrix
86 for i = 1 : typesize
87     for j = 1 : typesize
88         MatrixMatrixComputed(i,j) = typeof(types(i)([1 2]) + types(j)([1 2]));
89     end
90 end
91 assert_checkequal(ref, MatrixMatrixComputed);