DevOps Automation

DevOps Automation

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#DevOps
 View Only

How to STUB a function with array as parameter?

  • 1.  How to STUB a function with array as parameter?

    Posted Mon June 03, 2024 10:20 AM

    Hi, 

    I am using RTRT tool for code coverage.

    In my code I have STUB functions. 

    These STUB functions have parameters, I need to pass these functions. 

    My function has Array as a parameter. How to add in STUB fucntion. 

    For example: My STUB fucntions are 

    1. DebounceLogic(UNS32 Command_array[], UNS16 Counter, INT16 Index)

    • Here My Array has Initialized as
    • UNS32 Command_array[4] = { 0x00001000, 0x00002000, 0x00004000, 0x00008000 }
    • Remaining parameters are initialized to 0. 
    • Do I need to do variable test for parameters ? How to pass this STUB (this STUB function was called only once). 
    • I tried giving as :   STUB Latch_c.DebounceLogic({ 0x00001000, 0x00002000, 0x00004000, 0x00008000 }, 1, 0)

    2. Transmitter(UNS16 Tx_array[])

    • Here my array has initialized as 
    • UNS16 Tx_array[5] = {0x0E00, 0xE000, 0x0000, 0x0000, 0xC400 }    

    These are _in parameters. 

    Please do needful as soon as possible. 

    Thanks & Regards,

    Kiranmayee

    #Ratinaltestrealtime #STUBarray #STUBinRTRT



    ------------------------------
    Kiranmayee G
    ------------------------------