summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Wagner <david.wagner@intel.com>2015-03-13 19:22:18 +0100
committerEric Laurent <elaurent@google.com>2015-04-24 13:39:11 -0700
commit61acdd918efd8f409cbfd34aa304a4d4d63c1b6b (patch)
tree0f5a7b79aa67015c92a8550b7d1e9abc22ca1f93 /test
parente5bbac4c4ead44ca7dc67e4273c6357a8c048f65 (diff)
downloadexternal_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-xtest/test-fixed-point-parameter/Main.py11
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