@@ -112,24 +112,20 @@ create or replace package body ut_assert_processor as
112112 end;
113113
114114 function who_called_expectation return varchar2 is
115- l_call_stack varchar2(32767) := dbms_utility.format_call_stack();
115+ c_call_stack constant varchar2(32767) := dbms_utility.format_call_stack();
116116 l_caller_stack_line varchar2(4000);
117117 l_caller_type_and_name varchar2(4000);
118118 l_line_no integer;
119- l_owner varchar2(100);
120- l_object_name varchar2(100);
121- l_last_space_pos integer;
122- l_object_delimiter_pos integer;
119+ l_owner varchar2(1000);
120+ l_object_name varchar2(1000);
123121 c_expectation_search_pattern constant varchar2(50) := '(.*\.UT_EXPECTATION[A-Z0-9#_$]*\s)+(.*)\s';
124122 begin
125- l_caller_stack_line := regexp_substr( l_call_stack , c_expectation_search_pattern, 1, 1, 'm', 2);
126- l_line_no := to_number( trim( substr( l_caller_stack_line, 11, 10 ) ) );
123+ l_caller_stack_line := regexp_substr( c_call_stack , c_expectation_search_pattern, 1, 1, 'm', 2);
124+ l_line_no := to_number( regexp_substr( l_caller_stack_line,'^\dx[0-9a-f]+\s+(\d+)',subexpression => 1 ) );
127125 l_caller_type_and_name := substr( l_caller_stack_line, 23 );
128- l_last_space_pos := instr( l_caller_type_and_name, ' ', -1 );
129- l_object_delimiter_pos := instr( l_caller_type_and_name, '.' );
130- if l_object_delimiter_pos > 0 then
131- l_owner := substr( l_caller_type_and_name, l_last_space_pos + 1, l_object_delimiter_pos - l_last_space_pos - 1 );
132- l_object_name := substr( l_caller_type_and_name, l_object_delimiter_pos + 1 );
126+ if l_caller_stack_line like '%.%' then
127+ l_owner := regexp_substr(l_caller_stack_line,'\s(\w+)\.(\w|\.)+$',subexpression => 1);
128+ l_object_name := regexp_substr(l_caller_stack_line,'\s(\w+)\.((\w|\.)+)$',subexpression => 2);
133129 end if;
134130 return
135131 case when l_owner is not null and l_object_name is not null and l_line_no is not null then
0 commit comments