All files / src/git/zlib zcl_abapgit_zlib_stream.clas.testclasses.abap

100% Statements 53/53
100% Branches 1/1
100% Functions 1/1
100% Lines 53/53

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 541x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
 
CLASS ltcl_test DEFINITION FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS FINAL.
 
  PRIVATE SECTION.
    METHODS test FOR TESTING.
 
ENDCLASS.
 
 
CLASS ltcl_test IMPLEMENTATION.
 
  METHOD test.
 
    DATA: lo_stream    TYPE REF TO zcl_abapgit_zlib_stream,
          lv_remaining TYPE i,
          lv_int       TYPE i,
          lv_bits      TYPE string,
          lv_bytes     TYPE xstring.
 
 
    CREATE OBJECT lo_stream
      EXPORTING
        iv_data = '112233445566'.
 
    lv_bits = lo_stream->take_bits( 8 ).
 
    cl_abap_unit_assert=>assert_equals(
      act = lv_bits
      exp = '00010001' ).
 
    lv_remaining = lo_stream->remaining( ).
 
    cl_abap_unit_assert=>assert_equals(
      act = lv_remaining
      exp = 6 ).
 
    lv_int = lo_stream->take_int( 8 ).
 
    cl_abap_unit_assert=>assert_equals(
      act = lv_int
      exp = 34 ).
 
    lv_bytes = lo_stream->take_bytes( 2 ).
 
    cl_abap_unit_assert=>assert_equals(
      act = lv_bytes
      exp = '3344' ).
 
  ENDMETHOD.
 
ENDCLASS.