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

Skip to content

No CodeCoverage for (UserDefinedAggregate)Functions #1099

Open
@ffm145

Description

@ffm145

Describe the bug
Tests for UDAFs are not in CodeCoverage ("0 lines covered").

Provide version info
v3.1.10.3349

To Reproduce
Steps to reproduce the behavior:

  1. Create the SecondMaxImplementation from Oracle: https://docs.oracle.com/cd/B28359_01/appdev.111/b28425/aggr_functions.htm#BEJBFBHH
  2. Test it manually: select secondmax(num) from (select level num from dual connect by level<4);
  3. Create the Unit Test:
create or replace package secondmax_t authid current_user as

  --%suite(Test for UDAF Function)

  --%test(Test SECONDMAX.)
  procedure secondmax;

end secondmax_t;
/
create or replace package body secondmax_t as

  --%suite(Test for UDAF Function)

  --%test(Test SECONDMAX.)
  procedure secondmax
  is
    l_result number;
  begin
execute immediate 'select secondmax(cnt) from (select level cnt from dual connect by level<4)' into l_result;
    ut.expect(a_actual=>l_result).to_equal(a_expected=>2);
  end;
end secondmax_t;
/

When you run CodeCoverage the 2 relevant lines are missed...

What is wrong here???

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions