j123b567 / scpi-parser

Open Source SCPI device library
BSD 2-Clause "Simplified" License
463 stars 194 forks source link

SCPI_ParamNumber and illegal parameter value #58

Closed mvladic closed 8 years ago

mvladic commented 8 years ago

This is the code to get number parameter with scpi_special_numbers_def:

scpi_number_t param;
if (!SCPI_ParamNumber(context, scpi_special_numbers_def, &param, true)) {
    return SCPI_RES_ERR;
}

If I pass illegal parameter value (for example maxc), it will report -224, "Illegal parameter value", which is expected, but it will continue as error didn't happened (SCPI_ParamNumber returns SCPI_RES_OK) and param will be as def parameter was given.

j123b567 commented 8 years ago

Thank you for reporting. I have discovered, that SCPI_ParamNumber has no unit tests.