File: test_bug_719.pro

package info (click to toggle)
gnudatalanguage 1.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 80,832 kB
  • sloc: cpp: 198,435; ansic: 47,740; sh: 691; python: 474; makefile: 149; xml: 69; f90: 28
file content (95 lines) | stat: -rw-r--r-- 2,178 bytes parent folder | download | duplicates (5)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
;
; Alain C. 2017-03-16 during MIRI test at JPL ! 
;
; this bug was found by chance when trying to finish TEST_DIAG_MATRIX
;
; as long as this bug is not solved, TEST_DIAG_MATRIX will be wrong.
;
; Two situations : 
;   - on Ubuntu (14.04, 15.10, 16.04), always crash
;   - On OSX 11, CentOS 5.11, Debian, sporadically crash 
;
pro TEST_BUG_719_FINDGEN, cumul_errors, test=test, verbose=verbose
;
nb_errors=0
;
m3x4=INDGEN(3,4)
;
ii=[2]
jj=[0]
;
expected=2
;
for loop=0, 9 do begin
   result=m3x4(ii, jj)
   if ~ARRAY_EQUAL(result,expected) then $
      ERRORS_ADD, nb_errors, 'case 3x4 Findgen + loop : '+STRING(loop)
endfor
;
; the same, using EXECUTE !
;
exe=EXECUTE('result_exe=m3x4(ii, jj)')
if ~ARRAY_EQUAL(result_exe,expected) then $
   ERRORS_ADD, nb_errors, 'case 3x4 Findgen EXECUTE'
;
; ----- final ----
;
BANNER_FOR_TESTSUITE, 'TEST_BUG_719_FINDGEN', nb_errors, /status
ERRORS_CUMUL, cumul_errors, nb_errors
if KEYWORD_SET(test) then STOP
;
end
;
; ------------------------
;
pro TEST_BUG_719_REFORM, cumul_errors, test=test, verbose=verbose
;
nb_errors=0
;
input=REFORM(INDGEN(12),3,4)
xx=[2]
yy=[0]
resu=REFORM(input[xx,yy])  
;
expected=2
;
if ~ARRAY_EQUAL(resu,expected) then ERRORS_ADD, nb_errors, 'case 3x4 Reform'
;
; the same, using EXECUTE !
;
exe=EXECUTE('result_exe=REFORM(input[xx,yy])')
if ~ARRAY_EQUAL(result_exe,expected) then $
   ERRORS_ADD, nb_errors, 'case 3x4 Findgen EXECUTE'
;
; ----- final ----
;
BANNER_FOR_TESTSUITE, 'TEST_BUG_719_REFORM', nb_errors, /status
ERRORS_CUMUL, cumul_errors, nb_errors
if KEYWORD_SET(test) then STOP
;
end
;
; ------------------------
;
pro TEST_BUG_719, help=help, verbose=verbose, no_exit=no_exit, test=test
;
if KEYWORD_SET(help) then begin
   print, 'pro TEST_DIAG_MATRIX, help=help, verbose=verbose, $'
   print, '                      no_exit=no_exit, test=test'
   return
endif
;
TEST_BUG_719_FINDGEN, nb_errors, test=test, verbose=verbose
;
TEST_BUG_719_REFORM, nb_errors, test=test, verbose=verbose
;
; ----------------- final message ----------
;
BANNER_FOR_TESTSUITE, 'TEST_BUG_719', nb_errors
;
if (nb_errors GT 0) AND ~KEYWORD_SET(no_exit) then EXIT, status=1
;
if KEYWORD_SET(test) then STOP
;
end