zcl_abapgit_timer: delete unit tests (#7004)

This commit is contained in:
Lars Hvam 2024-07-31 18:17:06 +02:00 committed by GitHub
parent 27e767e935
commit 1c2b65814f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 102 deletions

View File

@ -1,101 +0,0 @@
CLASS ltcl_timer DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA mv_disabled TYPE abap_bool.
METHODS:
setup,
check_result
IMPORTING
iv_result TYPE string
iv_regex TYPE string,
run_timer FOR TESTING,
run_timer_with_count FOR TESTING,
run_timer_with_text FOR TESTING.
ENDCLASS.
CLASS ltcl_timer IMPLEMENTATION.
METHOD setup.
DATA lv_skip TYPE c LENGTH 30.
GET PARAMETER ID 'TSE' FIELD lv_skip.
mv_disabled = boolc( sy-sysid = 'ABC' OR lv_skip CS 'SKIP_TIMER' ).
ENDMETHOD.
METHOD check_result.
FIND REGEX iv_regex IN iv_result.
cl_abap_unit_assert=>assert_subrc(
act = sy-subrc
msg = |Did not return right measurement, got: { iv_result }| ).
ENDMETHOD.
METHOD run_timer.
DATA lo_timer TYPE REF TO zcl_abapgit_timer.
IF mv_disabled = abap_true.
RETURN.
ENDIF.
lo_timer = zcl_abapgit_timer=>create( )->start( ).
WAIT UP TO 1 SECONDS.
check_result(
iv_result = lo_timer->end( )
iv_regex = '1.0[0-9] seconds' ).
ENDMETHOD.
METHOD run_timer_with_count.
DATA lo_timer TYPE REF TO zcl_abapgit_timer.
IF mv_disabled = abap_true.
RETURN.
ENDIF.
lo_timer = zcl_abapgit_timer=>create( iv_count = 1 )->start( ).
WAIT UP TO 1 SECONDS.
check_result(
iv_result = lo_timer->end( )
iv_regex = '1 object, 1.0[0-9] seconds' ).
lo_timer = zcl_abapgit_timer=>create( iv_count = 1234 )->start( ).
WAIT UP TO 1 SECONDS.
check_result(
iv_result = lo_timer->end( )
iv_regex = '1234 objects, 1.0[0-9] seconds' ).
ENDMETHOD.
METHOD run_timer_with_text.
CONSTANTS lc_total TYPE string VALUE 'Total:'.
DATA lo_timer TYPE REF TO zcl_abapgit_timer.
IF mv_disabled = abap_true.
RETURN.
ENDIF.
lo_timer = zcl_abapgit_timer=>create( lc_total )->start( ).
WAIT UP TO 1 SECONDS.
check_result(
iv_result = lo_timer->end( )
iv_regex = |{ lc_total } 1.0[0-9] seconds| ).
ENDMETHOD.
ENDCLASS.

View File

@ -10,7 +10,6 @@
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
<WITH_UNIT_TESTS>X</WITH_UNIT_TESTS>
</VSEOCLASS>
</asx:values>
</asx:abap>