• Federico Vaga's avatar
    lib: bugfix do not override value on write · 1143b17d
    Federico Vaga authored
    The value that needs to be written must not be manipulated. However,
    we do need to manipulate it in some case like, for example, when
    configuring the offset. This is fixed by using a local variable.
    
    The previous code was overriding the value with the manipulation
    result: this is wrong and it led to the believe that this code was
    working, actually it was masking another bug (fixed in another patch).
    
    The following test in the integration test suite was passing due to
    this bug, however it should have failed because the read-back value is
    wrong.
    
        assert conf.value_get(PyAdcConf.ADC_CONF_CHN_OFFSET) == conf_rb.value_get(PyAdcConf.ADC_CONF_CHN_OFFSET)
    
    The value in `conf` ended up to be the same as its read back `conf_rb`
    due to the manilupation done direction on the pointer.
    
    So the test needs to be fixed as well to check on this possible regression.
    Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
    Reported-by: 's avatarNicolas Magnin <nicolas.magnin@cern.ch>
    1143b17d
Name
Last commit
Last update
LICENSES Loading commit data...
PyAdcLib Loading commit data...
doc Loading commit data...
lib Loading commit data...
pytest Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
CHANGELOG.rst Loading commit data...
Makefile Loading commit data...