Skip to content
Snippets Groups Projects
Commit d630f122 authored by Frédéric Dalleau's avatar Frédéric Dalleau :sun_with_face:
Browse files

bluez-hfp: Ensure that process_next isn't called twice


When the profile list are parsed process_next is called. It is also
caled when the pairing is terminated. When only one profile was
discovered, the only task in process_q would be popped at first
process_next() call. The second call would find an empty process_q
and quit the mainloop without executing the test.

This patch arrange the pairing and non pairing tests so they are
symmetrical. The call to tester.get_device is synchronous.

Reviewed-by: default avatarPhilip Withnall <philip.withnall@collabora.co.uk>
Signed-off-by: default avatarFrédéric Dalleau <frederic.dalleau@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D4561
parent c2f649f6
No related branches found
Tags apertis/1%0.20160928.0
No related merge requests found
......@@ -59,8 +59,6 @@ class HfpAgDeviceProfileTester(DeviceProfileTester):
if 'HFP AG' in profiles:
process_q.append(self.test_hfp_ag)
process_next()
def test_hfp_ag(self):
TEST_START("HFP AG")
......@@ -210,8 +208,12 @@ if __name__ == "__main__":
TEST_START('Pairing Responder')
tester.start_pairing_responder(test2_cb)
def skiptest():
tester.get_device()
process_next()
if options.skip_pair:
process_q.append(tester.get_device)
process_q.append(skiptest)
else:
process_q.append(test1)
process_q.append(test2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment