nasa / CTF

This is a new repository for a new tool to be added to the cFS ecosystem called cFS Test Framework (CTF).
28 stars 6 forks source link

Function: "IfCondition" instruction causes error #35

Closed buerge3 closed 2 years ago

buerge3 commented 2 years ago

I am getting a new error when I try to run a CTF test script.

[11:15:42.336] test (311) *** ERROR: The label 'CPU1' has been already defined in current test script
[11:15:42.342] script_manager (134) *** ERROR: Failed to execute script: CSIC-9_software_upgrade.json

"The issue is that the function defines label 'CPU1', which is used in loop or if. The label 'CPU1' can only be defined once in one single script. The function in CTF is not a real function in C. It is more like a macro replacement. After replacement, the label is defined twice. CTF team discussed it today. We propose a solution to solve it. When CTF engine calls a function and inserts instructions from the function into the script, if the engine sees a label, it will auto-append an increasing number to the label. So when the function is called the second time, the replaced labels will be different." - Tao Wu