diff options
author | David Wagner <david.wagner@intel.com> | 2015-03-13 19:22:18 +0100 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-04-24 13:39:11 -0700 |
commit | 61acdd918efd8f409cbfd34aa304a4d4d63c1b6b (patch) | |
tree | 0f5a7b79aa67015c92a8550b7d1e9abc22ca1f93 /test | |
parent | e5bbac4c4ead44ca7dc67e4273c6357a8c048f65 (diff) | |
download | external_parameter-framework-61acdd918efd8f409cbfd34aa304a4d4d63c1b6b.zip external_parameter-framework-61acdd918efd8f409cbfd34aa304a4d4d63c1b6b.tar.gz external_parameter-framework-61acdd918efd8f409cbfd34aa304a4d4d63c1b6b.tar.bz2 |
fixed-point-tests: abort if a getParameter fails
We used to drop errors during "get" operation because it is unlikely to fail
and not in the scope of the fixed-point tests. However, we should catch such
error and abort immediately.
Signed-off-by: David Wagner <david.wagner@intel.com>
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-fixed-point-parameter/Main.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test-fixed-point-parameter/Main.py b/test/test-fixed-point-parameter/Main.py index b61be88..94d0753 100755 --- a/test/test-fixed-point-parameter/Main.py +++ b/test/test-fixed-point-parameter/Main.py @@ -160,7 +160,7 @@ class FixedPointTester(): returns: the value the parameter-framework returns us after the get returns: True if we are able to set, False otherwise """ - (_, firstGet, _) = self._pfwClient.get(self._paramPath) + firstGet = self._pfwClient.get(self._paramPath) try: returnValue = Decimal(firstGet) @@ -201,7 +201,8 @@ class FixedPointTester(): returns: value the parameter-framework returns us after the second get returns: True if we are able to set, False otherwise """ - (_, secondGet, _) = pfw.get(self._paramPath) + secondGet = pfw.get(self._paramPath) + if secondGet != valuePreviouslySet: return secondGet, False @@ -228,8 +229,12 @@ class PfwClient(): def get(self, parameter): (success, value, errorMsg) = self._instance.accessParameterValue(parameter, "", False) + if not success: + raise Exception("A getParameter failed, which is unexpected. The" + "parameter-framework answered:\n%s" % errorMsg) + print('get %s ---> %s' % (parameter, value)) - return success, value, errorMsg + return value if __name__ == '__main__': # It is necessary to add a ./ in front of the path, otherwise the parameter-framework |