summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Wagner <david.wagner@intel.com>2015-03-13 18:46:36 +0100
committerEric Laurent <elaurent@google.com>2015-04-24 13:39:11 -0700
commitdc04b7b42a10fc389e70c93a52e6aa8259d0d94d (patch)
tree7abf2ff0c16ea540e15b7ed700fca9199240f6b7
parentd828b6a20d4996b2908ac085d8bda5599144be74 (diff)
downloadexternal_parameter-framework-dc04b7b42a10fc389e70c93a52e6aa8259d0d94d.zip
external_parameter-framework-dc04b7b42a10fc389e70c93a52e6aa8259d0d94d.tar.gz
external_parameter-framework-dc04b7b42a10fc389e70c93a52e6aa8259d0d94d.tar.bz2
fixed point tests: return 1 in case of failure
The fixed-point tests did not return any error code even upon failure. This lead to believing that they were passing. Signed-off-by: David Wagner <david.wagner@intel.com>
-rwxr-xr-xtest/test-fixed-point-parameter/Main.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/test/test-fixed-point-parameter/Main.py b/test/test-fixed-point-parameter/Main.py
index 9a2eafc..65e1c8d 100755
--- a/test/test-fixed-point-parameter/Main.py
+++ b/test/test-fixed-point-parameter/Main.py
@@ -1,6 +1,6 @@
#!/usr/bin/python2.7
#
-# Copyright (c) 2014, Intel Corporation
+# Copyright (c) 2014-2015, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@@ -83,29 +83,35 @@ class FixedPointTester():
Decimal(self._upperAllowedBound) + Decimal(littleValue)
]
-
def run(self):
""" Runs the test suite for a given Qn.m number
"""
+
+ runSuccess = True
+
for value in self._shouldWork:
print('Testing %s for %s' % (value, self._paramPath))
value, success = self.checkBounds(value)
if not success:
+ runSuccess = False
print('Bound ERROR for %s' % self._paramPath)
continue
value, success = self.checkSanity(value)
if not success:
+ runSuccess = False
print('Sanity ERROR %s' % self._paramPath)
continue
value, success = self.checkConsistency(value)
if not success:
+ runSuccess = False
print('Consistency ERROR %s' % self._paramPath)
continue
value, success = self.checkBijectivity(value)
if not success:
+ runSuccess = False
print('Bijectivity ERROR %s' % self._paramPath)
continue
@@ -113,8 +119,11 @@ class FixedPointTester():
print('Testing invalid value %s for %s' % (value, self._paramPath))
value, success = self.checkBounds(value)
if success:
+ runSuccess = False
print("ERROR: This test should have failed but it has not")
+ return runSuccess
+
def checkBounds(self, valueToSet):
""" Checks if we are able to set valueToSet via the parameter-framework
@@ -232,10 +241,13 @@ if __name__ == '__main__':
# does not recognize the string as a path.
configPath = './ParameterFrameworkConfiguration.xml'
+ success = True
+
with PfwClient(configPath) as pfw:
for size in [8, 16, 32]:
for integral in range(0, size):
for fractional in range (0, size - integral):
tester = FixedPointTester(pfw, size, integral, fractional)
- tester.run()
+ success = tester.run() and success
+ exit(0 if success else 1)