File: t24f.f

package info (click to toggle)
libhdf4 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 29,892 kB
  • sloc: ansic: 128,688; sh: 14,969; fortran: 12,444; java: 5,864; xml: 1,305; makefile: 900; yacc: 678; pascal: 418; perl: 360; javascript: 203; lex: 163; csh: 41
file content (245 lines) | stat: -rw-r--r-- 8,557 bytes parent folder | download | duplicates (3)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
C * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
C  Copyright by The HDF Group.                                               *
C  Copyright by the Board of Trustees of the University of Illinois.         *
C  All rights reserved.                                                      *
C                                                                            *
C  This file is part of HDF.  The full HDF copyright notice, including       *
C  terms governing use, modification, and redistribution, is contained in    *
C  the COPYING file, which can be found at the root of the source code       *
C  distribution tree, or in https://support.hdfgroup.org/ftp/HDF/releases/.  *
C  If you do not have access to either file, you may request a copy from     *
C  help@hdfgroup.org.                                                        *
C * * * * * * * * *  * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
C
C
      subroutine t24f (number_failed)
      implicit none
      include 'fortest.inc'
C Test Program:
C     		Writes 24-bit raster images with specified interlace
C		   code to a file.
C		Reads the images and their dimensions from the file.
C Input file: none
C Output file: tdf24f.hdf
C
C
      integer number_failed
      character*20 myname
      parameter (myname = 'r24')


      integer d1, d2, il
      character*80 TESTFILE
      character*1 CR
      character buf(3, 2, 2), buf1(2, 3, 2), buf2(2, 2, 3)
      character in(3,2,2), in1(2, 3, 2), in2(2, 2, 3)
      integer i, j, k, ret

      call ptestban('Testing', myname)
      TESTFILE = 'tdf24f.hdf'
      CR = char(10)
      number_failed = 0

      do 150 i=1, 2
          do 2 j=1, 2
              buf(1, j, i) = char(i+j)
              buf(2, j, i) = char(i+j)
              buf(3, j, i) = char(i+j)
              buf1(j, 1, i) = char(i-j)
              buf1(j, 2, i) = char(i-j)
              buf1(j, 3, i) = char(i-j)
              buf2(j, i, 1) = char(2*i - j)
              buf2(j, i, 2) = char(2*i - j)
              buf2(j, i, 3) = char(2*i - j)
2       continue
150   continue
      call MESSAGE(VERBO_HI, 'Setting il to 0')
      ret = d2setil(0)
      call VRFY(ret, 'd2setil',number_failed)
      call MESSAGE(VERBO_HI, ' Putting buffer 1')
      ret = d2pimg(TESTFILE, buf, 2, 2)
      call VRFY(ret, 'd2pimg',number_failed)
      call MESSAGE(VERBO_HI, 'Setting il to 1')
      ret = d2setil(1)
      call VRFY(ret, 'd2setil',number_failed)
      call MESSAGE(VERBO_HI, 'Adding buf1')
      ret = d2aimg(TESTFILE, buf1, 2, 2)
      call VRFY(ret, 'd2aimg',number_failed)
      call MESSAGE(VERBO_HI, 'Setting il to 2')
      ret = d2setil(2)
      call VRFY(ret, 'd2setil',number_failed)
      call MESSAGE(VERBO_HI, 'Adding buf2')
      ret = d2aimg(TESTFILE, buf2, 2, 2)
      call VRFY(ret, 'd2aimg',number_failed)
      call MESSAGE(VERBO_HI, 'Restarting file')
      ret = d2first()
      call VRFY(ret, 'd2first',number_failed)
      call MESSAGE(VERBO_HI, 'Req il 0')
      ret = d2reqil(0)
      call VRFY(ret, 'd2reqil',number_failed)
      call MESSAGE(VERBO_HI, 'Getting dims')
      ret = d2gdims(TESTFILE, d1, d2, il)
      call VRFY(ret, 'd2gdims',number_failed)
      call MESSAGE(VERBO_HI, 'Getting image')
      ret = d2gimg(TESTFILE, in, 2, 2)
      call VRFY(ret, 'd2gimg',number_failed)
      do 200 i=1, 2
          do 180 j=1, 2
              do 160 k=1,3
                  if (in(k,j,i) .ne. buf(k,j,i)) then
                  print *, 'Error at  ', k, j, i
                  endif
160           continue
180       continue
200   continue

      call MESSAGE(VERBO_HI, 'Getting dimensions')
      ret = d2gdims(TESTFILE, d1, d2, il)
      call VRFY(ret, 'd2gdims',number_failed)
      call MESSAGE(VERBO_HI, 'Getting image')
      ret = d2gimg(TESTFILE,  in, 2, 2)
      call VRFY(ret, 'd2gimg',number_failed)
      do 250 i=1, 2
          do 220 j=1, 2
              do 210 k = 1, 3
                  if (in(k,j,i) .ne. buf1(j,k,i) ) then
                      print *, 'Error at  ', k, j, i
                  endif
210           continue
220       continue
250   continue

      call MESSAGE(VERBO_HI, 'Getting dimensions')
      ret = d2gdims(TESTFILE, d1, d2, il)
      call VRFY(ret, 'd2gdims',number_failed)
      call MESSAGE(VERBO_HI, 'Getting image')
      ret = d2gimg(TESTFILE,  in, 2, 2)
      call VRFY(ret, 'd2gimg',number_failed)
      do 300 i=1, 2
          do 280 j=1, 2
              do 260 k = 1, 3
                  if (in(k,j,i) .ne. buf2(j,i,k)) then
                      print *, 'Error at  ', k, j, i
                  endif
260           continue
280       continue
300   continue

      call MESSAGE(VERBO_HI, 'Restarting file')
      ret = d2first()
      call VRFY(ret, 'd2first',number_failed)
      call MESSAGE(VERBO_HI, 'Req il 1')
      ret = d2reqil(1)
      call VRFY(ret, 'd2reqil',number_failed)
      call MESSAGE(VERBO_HI, 'Getting dimensions')
      ret = d2gdims(TESTFILE, d1, d2, il)
      call VRFY(ret, 'd2gdims',number_failed)
      call MESSAGE(VERBO_HI, 'Getting image')
      ret = d2gimg(TESTFILE,  in1, 2, 2)
      call VRFY(ret, 'd2gimg',number_failed)
      do 350 i=1, 2
          do 320 j=1, 2
              do 310 k=1,3
                 if (in1(j,k,i) .ne. buf(k,j,i)) then
                     print *, 'Error at  ', k, j, i
                 endif
310           continue
320       continue
350   continue

      call MESSAGE(VERBO_HI, 'Getting dimensions')
      ret = d2gdims(TESTFILE, d1, d2, il)
      call VRFY(ret, 'd2gdims',number_failed)
      call MESSAGE(VERBO_HI, 'Getting image')
      ret = d2gimg(TESTFILE,  in1, 2, 2)
      call VRFY(ret, 'd2gimg',number_failed)
      do 400 i=1, 2
          do 380 j=1, 2
              do 360 k = 1, 3
                  if (in1(j,k,i) .ne. buf1(j,k,i)) then
                      print *, 'Error at  ', k,j,i
                  endif
360           continue
380       continue
400   continue

      call MESSAGE(VERBO_HI, 'Getting dimensions')
      ret = d2gdims(TESTFILE, d1, d2, il)
      call VRFY(ret, 'd2gdims',number_failed)
      call MESSAGE(VERBO_HI, 'Getting image')
      ret = d2gimg(TESTFILE,  in1, 2, 2)
      call VRFY(ret, 'd2gimg',number_failed)
      do 450 i=1, 2
          do 420 j=1, 2
              do 410 k =1, 3
                  if (in1(j,k,i) .ne. buf2(j,i,k)) then
                      print *, 'Error at  ', k, j, i
                  endif
410           continue
420       continue
450   continue

      call MESSAGE(VERBO_HI, 'Restarting file')
      ret = d2first()
      call VRFY(ret, 'd2first',number_failed)
      call MESSAGE(VERBO_HI, 'Req il 2')
      ret = d2reqil(2)
      call VRFY(ret, 'd2reqil',number_failed)
      call MESSAGE(VERBO_HI, 'Getting dimensions')
      ret = d2gdims(TESTFILE, d1, d2, il)
      call VRFY(ret, 'd2gdims',number_failed)
      call MESSAGE(VERBO_HI, 'Getting image')
      ret = d2gimg(TESTFILE,  in2, 2, 2)
      call VRFY(ret, 'd2gimg',number_failed)
      do 500 i=1, 2
          do 480 j=1, 2
              do 460 k=1, 3
                  if (in2(j,i,k) .ne. buf(k,j,i)) then
                      print *, 'Error at  ', k, j, i
                  endif
460           continue
480       continue
500   continue

      call MESSAGE(VERBO_HI, 'Getting dimensions')
      ret = d2gdims(TESTFILE, d1, d2, il)
      call VRFY(ret, 'd2gdims',number_failed)
      call MESSAGE(VERBO_HI, 'Getting image')
      ret = d2gimg(TESTFILE,  in2, 2, 2)
      call VRFY(ret, 'd2gimg',number_failed)
      do 550 i=1, 2
          do 520 j=1, 2
              do 510 k = 1,3
                  if (in2(j,i,k) .ne. buf1(j,k,i)) then
                      print *, 'Error at  ', k, j, i
                  endif
510           continue
520       continue
550   continue

      call MESSAGE(VERBO_HI, 'Getting dimensions')
      ret = d2gdims(TESTFILE, d1, d2, il)
      call VRFY(ret, 'd2gdims',number_failed)
      call MESSAGE(VERBO_HI, 'Getting image')
      ret = d2gimg(TESTFILE,  in2, 2, 2)
      call VRFY(ret, 'd2gimg',number_failed)
      do 600 i=1, 2
          do 580 j=1, 2
              do 560 k = 1, 3
                  if (in2(j,i,k) .ne. buf2(j,i,k)) then
                      print *, 'Error at  ', k, j, i
                  endif
560           continue
580       continue
600   continue

      if (number_failed .eq. 0) then
          call MESSAGE(VERBO_DEF + 1,
     +   '****** ALL TESTS SUCCESSFUL ******')
      else
          print *, '****** ', number_failed, ' TESTS FAILED  ******'
      endif

      return
      end