summaryrefslogtreecommitdiff
path: root/android/tester-main.c
diff options
context:
space:
mode:
authorGrzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>2014-12-17 15:01:35 +0100
committerSzymon Janc <szymon.janc@tieto.com>2014-12-18 18:37:17 +0100
commit67ba6ce1127a1648c45e47dff136b6ad84d370bc (patch)
tree541ffe4d1004dcf7eb6ec96982eaa2c68ccd5156 /android/tester-main.c
parentf0613a37865ac578ac75df9153ef1eac91ed424e (diff)
downloadbluez-67ba6ce1127a1648c45e47dff136b6ad84d370bc.tar.gz
android/tester: Refractor properties veryfying
Pre condition for properties veryfying is to have set expected properties in step - there is no need to check it inside veryfying function. However veryfying function should check if number of expected or received number of properties is valid. If properties are expected but number of them is 0, test should fail.
Diffstat (limited to 'android/tester-main.c')
-rw-r--r--android/tester-main.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/android/tester-main.c b/android/tester-main.c
index 152459d30..a8a7bd389 100644
--- a/android/tester-main.c
+++ b/android/tester-main.c
@@ -501,6 +501,15 @@ static int verify_property(bt_property_t *exp_props, int exp_num_props,
int i, j;
int exp_prop_to_find = exp_num_props;
+ if (rec_num_props == 0)
+ return 1;
+
+ if (exp_num_props == 0) {
+ tester_debug("Wrong number of expected properties given");
+ tester_test_failed();
+ return 1;
+ }
+
/* Get first exp prop to match and search for it */
for (i = 0; i < exp_num_props; i++) {
for (j = 0; j < rec_num_props; j++) {
@@ -511,14 +520,6 @@ static int verify_property(bt_property_t *exp_props, int exp_num_props,
}
}
- if ((i == 0) && exp_props) {
- tester_warn("No property was verified: %s", exp_num_props ?
- "unknown error!" :
- "wrong \'.callback_result.num_properties\'?");
-
- return 1;
- }
-
return exp_prop_to_find;
}