Menu

#3 Unexpected behavior passing 1 library to parameter LIBL of RUCALLTST

2.0
closed
nobody
None
2026-03-05
2019-08-29
Kyle Lawson
No

In /trunk/host/iRPGUnit/QSRC/LIBL.RPGLE there is a method named setTestSuiteLibl.

I was using the LIBL() parameter of RUCALLTST. I found that if I pass the one library I need, the tests fail. If I pass the library I need and some other unrelated library then it succeeds. It appears in the method that if the passed library list has 1 member it only is looking for it to have *JOBD in it. Otherwise if there is more than 1 then the passed library list is used.

Maybe a proposed change would be...

select;
when (libl.numE = 1);
if (libl.lib(1) = 'JOBD');
if (jobd.nm = '
DFT');
jobd.nm = 'RPGUNIT';
jobd.lib = testPgmLib;
endif;
loadedLibl = loadLibl(jobd);
restoreLibl(loadedLibl);
return *ON;

         **Begin Suggested Code**
         else;
            changeLibl('*CRTDFT': libL);
            return *ON;
         **End Suggested Code**

         endif;

      when (libl.numE > 1);
         changeLibl('*CRTDFT': libL);
         return *ON;
      endsl;

      return *OFF;

Discussion

  • Thomas Raddatz

    Thomas Raddatz - 2019-08-30

    Good point!
    In fact I fixed it this way in order to honor special value *CURRENT:

              select;
              when (libl.numE = 1);
                 select;
                 when (libl.lib(1) = '*JOBD');
                    if (jobd.nm = '*DFT');
                       jobd.nm = 'RPGUNIT';
                       jobd.lib = testPgmLib;
                    endif;
                    loadedLibl = loadLibl(jobd);
                    restoreLibl(loadedLibl);
                    return *ON;
                 when (libl.lib(1) = '*CURRENT');
                    // keep current library list
                 other;
                    changeLibl('*CRTDFT': libL);
                    return *ON;
                 endsl;
    
              when (libl.numE > 1);
                 changeLibl('*CRTDFT': libL);
                 return *ON;
              endsl;
    

    I will create a new plug-in version after my vacation.
    Thanks,
    Thomas.

     
  • Thomas Raddatz

    Thomas Raddatz - 2019-08-30
    • status: open --> pending
     
  • Kyle Lawson

    Kyle Lawson - 2019-08-30

    Awesome thanks!

     
  • Thomas Raddatz

    Thomas Raddatz - 2026-03-05
    • status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB