[rygel/wip/basic-management: 134/138] core: return "Canceled" state when BasicManagement test is canceled



commit 42ea67f00aa90066952d58341b594f31c8c31a5c
Author: Jussi Kukkonen <jussi kukkonen intel com>
Date:   Mon Jun 24 11:30:44 2013 +0300

    core: return "Canceled" state when BasicManagement test is canceled

 src/librygel-core/rygel-basic-management-test.vala |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/src/librygel-core/rygel-basic-management-test.vala 
b/src/librygel-core/rygel-basic-management-test.vala
index ff264a4..83414b7 100644
--- a/src/librygel-core/rygel-basic-management-test.vala
+++ b/src/librygel-core/rygel-basic-management-test.vala
@@ -97,15 +97,19 @@ internal abstract class Rygel.BasicManagementTest : Object {
     protected virtual void finish_iteration () {
         this.current_iteration++;
 
+        /* No more iterations if
+         *  - init failed, recovery is impossible or
+         *  - execution has been canceled,
+         *  - execution has ended prematurely (skip remaining iterations),
+         *  - the specified nr of iterations have been executed already
+         */
         if (this.init_state != InitState.OK ||
-            this.execution_state == ExecutionState.COMPLETED ||
-            this.current_iteration >= this.iterations) {
-            /* No more iterations if 
-             *  - init failed, recovery is impossible or
-             *  - execution has ended (remaining iterations should be skipped)
-             *  - the specified nr of iterations have been executed already
-             */
+            (this.current_iteration >= this.iterations &&
+             this.execution_state == ExecutionState.IN_PROGRESS)) {
             this.execution_state = ExecutionState.COMPLETED;
+        }
+
+        if (this.execution_state != ExecutionState.IN_PROGRESS) {
             this.async_callback ();
         } else {
             this.run_iteration ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]