File: test_base64.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 (23 lines) | stat: -rw-r--r-- 547 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
; by Sylwester Arabas <slayoo (at) igf.fuw.edu.pl>
pro test_base64

  ; empty string -> 0b
  if idl_base64('') ne 0b then begin
    message, 'FAILED 01', /conti
    exit, status=1
  endif

  ; random byte arrays of length from 1 to 10.000
  for c = 1l, 10000 do begin
    arr = bytarr(c, /nozero)
    if ~array_equal(idl_base64(idl_base64(arr)), arr) then begin 
      help, arr
      print, arr
      print, idl_base64(arr)
      print, idl_base64(idl_base64(arr))
      message, 'FAILED 02', /conti
      exit, status=1
    endif
  endfor
 
end