camerabin2: Fix some racyness in tests
authorThiago Santos <thiago.sousa.santos@collabora.com>
Mon, 14 Nov 2011 21:34:18 +0000 (18:34 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Mon, 14 Nov 2011 21:39:42 +0000 (18:39 -0300)
commit316091d452d1577faafd01384fb1541a6712aace
treef12e3698e1b5354fb95f8fa96a2e2474a5d76be4
parent1d5b324e7d218af826b81151404f74b9d6303834
camerabin2: Fix some racyness in tests

Fix some racyness as the test was checking the idle property
right after it got the preview message for video recordings. In some
conditions, it might happen that camerabin2 still hasn't decremented
the processing counter after posting the preview and/or the image/video-done
message and the test will get idle=false and fail.

The approach for checking for the idle property was a busy loop with
a sleep. Far from elegant, but good enough for these tests.
tests/check/elements/camerabin2.c