Files
harbour-core/harbour/tests/base64.prg
Viktor Szakats 31a85b650e 2013-02-28 17:19 UTC+0100 Viktor Szakats (harbour syenar.net)
* utils/hbmk2/hbmk2.*.po
  * utils/hbmk2/hbmk2.prg
    % minor optimization to recent patch
    + cleanups in some help items
    + '-?' and '-h' options are now accepted as '-help'
    + '-??' and '-hh' options are now accepted as '-longhelp'
    - deleted '-license' option, it's now part of '-longhelp'
    ! hbshell_gtSelect() parameter fixed to be case insentitive
      in an internal check

  + tests/clipper.ch
    + added header file that translates certain Harbour
      specific functions to ones understood by Clipper.
      Useful to compile lightly Harbour specific code
      in Clipper (or other Clipper compatible language),
      for comparison.

  * tests/*.prg
  - tests/exthrb.prg
  + tests/hrbext.prg
  * website/samples/*.prg.html
    ! various cleanups, minor fixes, formatting
    + #included "clipper.ch" to enable running what's
      possible to run with Clipper

  * src/rtl/gtwin/gtwin.c
  * src/rtl/gtwvt/gtwvt.c
    ! return string type for hb_gtInfo( HB_GTI_FONTSEL )
      in sync with GTXWC

  * contrib/xhb/xhbfunc.c
  * include/hbdefs.h
    * HB_FUNC_EXEC() macro value to not end with ';',
      now it should be added on usage (almost all usages
      were such already). To be code formatter friendly.

  * contrib/xhb/xhb.hbp
  + contrib/xhb/xhbdepr.prg
    + added compatiblity stubs for functions deprecated from
      Harbour core, but still available in xHarbour. (xHarbour
      has yet to deprecate anything)
      So here we can gather stuff that's deprecated from Harbour
      core (except internal functions - most of them named '__*' -,
      and the "evil" ones)
    ; NOTE: Runtime efficiency is not a goal with these stubs,
            only "cheap" long term maintainability.

  - contrib/hbblat/tests/blattest.prg
  + contrib/hbblat/tests/test.prg
  * extras/guestbk/guestbk.hbp
  - extras/guestbk/testcgi.prg
  + extras/guestbk/cgi.prg
    * renames

  * src/vm/dynsym.c
  * contrib/hbfbird/tests/testapi.c
  * contrib/xhb/thtm.prg
    * minor
2013-02-28 16:25:51 +00:00

42 lines
1.0 KiB
Plaintext

/*
* $Id$
*/
/* RFC4648 test vectors for base64 */
#include "simpleio.ch"
PROCEDURE Main()
LOCAL cVector, cStr
LOCAL hTestVectors := { ;
"" => "", ;
"f" => "Zg==", ;
"fo" => "Zm8=", ;
"foo" => "Zm9v", ;
"foob" => "Zm9vYg==", ;
"fooba" => "Zm9vYmE=", ;
"foobar" => "Zm9vYmFy" }
FOR EACH cVector IN hTestVectors
cStr := hb_base64Encode( cVector:__enumKey )
IF !( cStr == cVector )
? hb_StrFormat( "hb_base64Encode(): expected '%s' got '%s' while encoding '%s'", ;
cVector:__enumKey(), cStr, cVector )
ELSE
? hb_StrFormat( "hb_base64Encode(): passed '%s'", cVector:__enumKey )
ENDIF
cStr := hb_base64Decode( cVector )
IF !( cStr == cVector:__enumKey() )
? hb_StrFormat( "hb_base64Decode(): expected '%s' got '%s' while decoding '%s'", ;
cVector, cStr, cVector:__enumKey() )
ELSE
? hb_StrFormat( "hb_base64Decode(): passed '%s'", cVector )
ENDIF
NEXT
RETURN