tests: mute coverity INFINITE_LOOP error

Error: INFINITE_LOOP (CWE-835): [#def17]
NetworkManager-0.9.11.0/libnm/tests/test-nm-client.c:93: loop_top: Top of the loop.
NetworkManager-0.9.11.0/libnm/tests/test-nm-client.c:94: loop_bottom: Bottom of the loop.
NetworkManager-0.9.11.0/libnm/tests/test-nm-client.c:93: loop_condition: If "notified" is initially true then it will remain true.

Error: INFINITE_LOOP (CWE-835): [#def18]
NetworkManager-0.9.11.0/libnm/tests/test-nm-client.c:191: loop_top: Top of the loop.
NetworkManager-0.9.11.0/libnm/tests/test-nm-client.c:192: loop_bottom: Bottom of the loop.
NetworkManager-0.9.11.0/libnm/tests/test-nm-client.c:191: loop_condition: If "result & NOTIFY_MASK" is initially true then it will remain true.
NetworkManager-0.9.11.0/libnm/tests/test-nm-client.c:191: loop_condition: If "result & SIGNAL_MASK" is initially true then it will remain true.

(cherry picked from commit ce6323d4df)
This commit is contained in:
Jiří Klimeš 2014-12-12 22:11:48 +01:00 committed by Thomas Haller
parent 61f4dd5f60
commit 1c2b75c5a0

View file

@ -90,6 +90,7 @@ test_device_added (void)
/* Tell the test service to add a new device */
nm_test_service_add_device (sinfo, client, "AddWiredDevice", "eth0");
/* coverity[loop_condition] */
while (!notified)
g_main_context_iteration (NULL, TRUE);
@ -188,6 +189,7 @@ test_device_added_signal_after_init (void)
/* Ensure the 'device-added' signal doesn't show up before
* the 'Devices' property change notification */
/* coverity[loop_condition] */
while (!(result & SIGNAL_MASK) && !(result & NOTIFY_MASK))
g_main_context_iteration (NULL, TRUE);