Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1645445

Browse files
committed
Formatting fixes.
1 parent 8697cea commit 1645445

2 files changed

Lines changed: 47 additions & 38 deletions

File tree

source/expectations/data_values/ut_compound_data_value.tpb

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ create or replace type body ut_compound_data_value as
6969
return l_result_string;
7070
end;
7171

72-
overriding member function diff( a_other ut_data_value, a_exclude_xpath varchar2, a_include_xpath varchar2, a_join_by_xpath varchar2, a_unordered boolean := false ) return varchar2 is
72+
overriding member function diff(
73+
a_other ut_data_value, a_exclude_xpath varchar2, a_include_xpath varchar2,
74+
a_join_by_xpath varchar2, a_unordered boolean := false
75+
) return varchar2 is
7376
l_result clob;
7477
l_result_string varchar2(32767);
7578
begin
@@ -80,8 +83,10 @@ create or replace type body ut_compound_data_value as
8083
end;
8184

8285
-- TODO : Rework to exclude xpath
83-
member function get_data_diff(a_other ut_data_value, a_exclude_xpath varchar2, a_include_xpath varchar2,
84-
a_join_by_xpath varchar2, a_unordered boolean) return clob is
86+
member function get_data_diff(
87+
a_other ut_data_value, a_exclude_xpath varchar2, a_include_xpath varchar2,
88+
a_join_by_xpath varchar2, a_unordered boolean
89+
) return clob is
8590
c_max_rows integer := ut_utils.gc_diff_max_rows;
8691
l_result clob;
8792
l_results ut_utils.t_clob_tab := ut_utils.t_clob_tab();
@@ -191,8 +196,10 @@ create or replace type body ut_compound_data_value as
191196
return l_result;
192197
end;
193198

194-
member function compare_implementation(a_other ut_data_value, a_unordered boolean, a_inclusion_compare boolean,
195-
a_is_negated boolean, a_join_by_list ut_varchar2_list:=ut_varchar2_list()) return integer is
199+
member function compare_implementation(
200+
a_other ut_data_value, a_unordered boolean, a_inclusion_compare boolean,
201+
a_is_negated boolean, a_join_by_list ut_varchar2_list := ut_varchar2_list()
202+
) return integer is
196203

197204
l_diff_id ut_compound_data_helper.t_hash;
198205
l_other ut_compound_data_value;
@@ -205,33 +212,35 @@ create or replace type body ut_compound_data_value as
205212
l_sql_rowcount integer :=0;
206213

207214
begin
208-
l_other := treat(a_other as ut_compound_data_value);
209-
l_diff_id := ut_compound_data_helper.get_hash(self.data_id||l_other.data_id);
210-
211-
open l_loop_curs for ut_compound_data_helper.gen_compare_sql(a_inclusion_compare, a_is_negated, a_unordered,
212-
treat(a_other as ut_data_value_refcursor), a_join_by_list ) using self.data_id,l_other.data_id;
213-
loop
214-
fetch l_loop_curs bulk collect into l_diff_tab limit l_max_rows;
215-
exit when l_diff_tab.count = 0;
216-
if (ut_utils.gc_diff_max_rows > l_sql_rowcount ) then
217-
ut_compound_data_helper.insert_diffs_result(l_diff_tab,l_diff_id);
218-
end if;
219-
l_sql_rowcount := l_sql_rowcount + l_diff_tab.count;
220-
if (ut_utils.gc_diff_max_rows <= l_sql_rowcount and l_max_rows != ut_utils.gc_bc_fetch_limit ) then
221-
l_max_rows := ut_utils.gc_bc_fetch_limit;
222-
end if;
223-
end loop;
224-
225-
ut_compound_data_helper.set_rows_diff(l_sql_rowcount);
226-
--result is OK only if both are same
227-
if l_sql_rowcount = 0 and ( self.elements_count = l_other.elements_count or a_inclusion_compare )then
228-
l_result := 0;
229-
else
230-
l_result := 1;
231-
end if;
215+
l_other := treat(a_other as ut_compound_data_value);
216+
l_diff_id := ut_compound_data_helper.get_hash(self.data_id||l_other.data_id);
217+
218+
open l_loop_curs for
219+
ut_compound_data_helper.gen_compare_sql(
220+
a_inclusion_compare, a_is_negated, a_unordered,
221+
treat(a_other as ut_data_value_refcursor), a_join_by_list
222+
) using self.data_id,l_other.data_id;
223+
loop
224+
fetch l_loop_curs bulk collect into l_diff_tab limit l_max_rows;
225+
exit when l_diff_tab.count = 0;
226+
if (ut_utils.gc_diff_max_rows > l_sql_rowcount ) then
227+
ut_compound_data_helper.insert_diffs_result(l_diff_tab,l_diff_id);
228+
end if;
229+
l_sql_rowcount := l_sql_rowcount + l_diff_tab.count;
230+
if (ut_utils.gc_diff_max_rows <= l_sql_rowcount and l_max_rows != ut_utils.gc_bc_fetch_limit ) then
231+
l_max_rows := ut_utils.gc_bc_fetch_limit;
232+
end if;
233+
end loop;
232234

233-
return l_result;
235+
ut_compound_data_helper.set_rows_diff(l_sql_rowcount);
236+
--result is OK only if both are same
237+
if l_sql_rowcount = 0 and ( self.elements_count = l_other.elements_count or a_inclusion_compare ) then
238+
l_result := 0;
239+
else
240+
l_result := 1;
241+
end if;
234242

243+
return l_result;
235244
end;
236245

237246
end;

source/expectations/data_values/ut_data_value_refcursor.tpb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ create or replace type body ut_data_value_refcursor as
2525
member procedure extract_cursor(self in out nocopy ut_data_value_refcursor, a_value sys_refcursor) is
2626
c_bulk_rows constant integer := 10000;
2727
l_cursor sys_refcursor := a_value;
28-
l_ctx number;
29-
l_xml xmltype;
30-
l_ut_owner varchar2(250) := ut_utils.ut_owner;
31-
l_set_id integer := 0;
28+
l_ctx number;
29+
l_xml xmltype;
30+
l_ut_owner varchar2(250) := ut_utils.ut_owner;
31+
l_set_id integer := 0;
3232
begin
3333
-- We use DBMS_XMLGEN in order to:
3434
-- 1) be able to process data in bulks (set of rows)
@@ -67,8 +67,8 @@ create or replace type body ut_data_value_refcursor as
6767
end;
6868

6969
member procedure init(self in out nocopy ut_data_value_refcursor, a_value sys_refcursor) is
70-
l_cursor sys_refcursor := a_value;
71-
cursor_not_open exception;
70+
l_cursor sys_refcursor := a_value;
71+
cursor_not_open exception;
7272
l_cursor_number number;
7373
begin
7474
self.is_data_null := ut_utils.boolean_to_int(a_value is null);
@@ -80,13 +80,13 @@ create or replace type body ut_data_value_refcursor as
8080
if l_cursor is not null then
8181
if l_cursor%isopen then
8282
--Get some more info regarding cursor, including if it containts collection columns and what is their name
83-
self.elements_count := 0;
83+
self.elements_count := 0;
8484
extract_cursor(l_cursor);
8585
l_cursor_number := dbms_sql.to_cursor_number(l_cursor);
8686
self.cursor_details := ut_cursor_details(l_cursor_number);
8787
dbms_sql.close_cursor(l_cursor_number);
8888
elsif not l_cursor%isopen then
89-
raise cursor_not_open;
89+
raise cursor_not_open;
9090
end if;
9191
end if;
9292
exception

0 commit comments

Comments
 (0)