File: test_fixprint.pro

package info (click to toggle)
gnudatalanguage 1.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80,832 kB
  • sloc: cpp: 198,435; ansic: 47,740; sh: 691; python: 474; makefile: 149; xml: 69; f90: 28
file content (52 lines) | stat: -rw-r--r-- 1,252 bytes parent folder | download
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
;
; by Sylwester Arabas <slayoo@igf.fuw.edu.pl>
; ---------------------------------
; 
; Modifications history :
;
; - 2025-04-15 : AC. using cumulative error count !
;
; ---------------------------------
;;
pro TEST_FIXPRINT, help=help, no_exit=no_exit, test=test
; 
if KEYWORD_SET(help) then begin
   print, 'pro TEST_FIXPRINT, help=help, no_exit=no_exit, test=test'
   return
endif
;
errors=0
;
if ~EXECUTE('a=FIX(0,type=0)') then begin
   ERRORS_ADD, errors, 'FIX(type=0) failed!'
endif
;
if (FIX('123',/print,type=1))[0] ne 123 then begin
   ERRORS_ADD, errors, 'FIX(string,/print,type=byte) failed!'
endif
;
if (FIX(123,/print,type=1))[0] ne 123 then begin
   ERRORS_ADD, errors, 'FIX(int,/print,type=byte) failed!'
endif
;
if (FIX('123',type=1))[0] ne 49 then begin
   ERRORS_ADD, errors, 'FIX(string,type=byte) failed!'
endif
;
if FIX(123b,/print,type=7) ne ' 123' then begin
   ERRORS_ADD, errors, 'FIX(byte,/print,type=string) failed!'
endif
;
if FIX(123b,type=7) ne '{' then begin
   ERRORS_ADD, errors, 'FIX(byte,type=string) failed!'
endif
;
; ----------------- final message ----------
;
BANNER_FOR_TESTSUITE, 'TEST_FIXPRINT', errors
;
if (errors GT 0) AND ~KEYWORD_SET(no_exit) then EXIT, status=1
;
if KEYWORD_SET(test) then STOP
;
end