From 61acdd918efd8f409cbfd34aa304a4d4d63c1b6b Mon Sep 17 00:00:00 2001 From: David Wagner Date: Fri, 13 Mar 2015 19:22:18 +0100 Subject: 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 --- test/test-fixed-point-parameter/Main.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'test') 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 -- cgit v1.1