nasa / CTF

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

SetUserVariable does not convert values from strings before doing operations #33

Closed twchristian closed 2 years ago

twchristian commented 2 years ago

A user reported an error when using SetUserVariable to multiply a value that was represented as a string in the test script. CTF does not convert variables or comparison values provided in SetUserVariable before attempting to perform the operation, so some operations will fail or behave unexpectedly if either value is a string. The proposed solution is to attempt to convert values to the same type as the variable, and to provide an optional type parameter when directly assigning a variable to convert before storing.

Workaround: use raw numbers (no quotes) for numeric values and strings for text values whenever possible in test scripts, so that no type conversion is necessary.

blueoceanwater commented 2 years ago

will be released in v1.6