Skip to content

Commit

Permalink
add zlib decompress testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
larshp committed Feb 1, 2024
1 parent 9b38c16 commit 60f9a7a
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/abap/cl_abap_gzip.clas.testclasses.abap
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
CLASS ltcl_gzip DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.

PRIVATE SECTION.
METHODS compress FOR TESTING.
METHODS decompress FOR TESTING.
METHODS identity FOR TESTING.
METHODS decompress_header FOR TESTING.
METHODS compress FOR TESTING RAISING cx_static_check.
METHODS decompress FOR TESTING RAISING cx_static_check.
METHODS decompress_flush FOR TESTING RAISING cx_static_check.
METHODS identity FOR TESTING RAISING cx_static_check.
METHODS decompress_header FOR TESTING RAISING cx_static_check.

ENDCLASS.

Expand Down Expand Up @@ -99,4 +100,23 @@ CLASS ltcl_gzip IMPLEMENTATION.
exp = '68656C6C6F20776F726C64' ).
ENDMETHOD.

METHOD decompress_flush.

DATA lv_compressed TYPE xstring.
DATA lv_raw TYPE xstring.

lv_compressed = 'CA48CDC9C907000000FFFF'.

cl_abap_gzip=>decompress_binary(
EXPORTING
gzip_in = lv_compressed
IMPORTING
raw_out = lv_raw ).

cl_abap_unit_assert=>assert_equals(
act = cl_abap_codepage=>convert_from( lv_raw )
exp = 'hello' ).

ENDMETHOD.

ENDCLASS.

0 comments on commit 60f9a7a

Please sign in to comment.