[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdenetwork/kget
From:       Matthias Fuchs <mat69 () gmx ! net>
Date:       2011-08-28 19:28:39
Message-ID: 20110828192839.868FCAC87A () svn ! kde ! org
[Download RAW message or body]

SVN commit 1249935 by mfuchs:

Adds more data to SchedulerTest and makes comments more clear.

 M  +1 -0      core/scheduler.h  
 M  +13 -6     tests/schedulertest.cpp  
 M  +2 -2      tests/schedulertest.h  


--- trunk/KDE/kdenetwork/kget/core/scheduler.h #1249934:1249935
@@ -82,6 +82,7 @@
          * Can be used to suspend the scheduler before doing lenghty operations
          * and activating it later again
          *
+         * NOTE does not stop running jobs, just prevents changes to jobs
          * HACK this is needed since the scheduler would constantly update the queue
          * when stopping starting multiple transfers, this slows down that operation \
                a lot
          * and could result in transfers finishing before they are stopped etc.
--- trunk/KDE/kdenetwork/kget/tests/schedulertest.cpp #1249934:1249935
@@ -127,6 +127,7 @@
     QTest::newRow("limit 2, will first two start while last will be stopped?") << 2 \
<< (QList<Job::Status>() << Job::Stopped << Job::Stopped << Job::Running) << \
(QList<Job::Status>() << Job::Running << Job::Running << Job::Stopped);  \
QTest::newRow("no limit, two finished, will third be started?") << NO_LIMIT << \
(QList<Job::Status>() << Job::Finished << Job::Finished << Job::Stopped) << \
(QList<Job::Status>() << Job::Finished << Job::Finished << Job::Running);  \
QTest::newRow("no limit, will all three be started?") << NO_LIMIT << \
(QList<Job::Status>() << Job::Stopped << Job::Stopped << Job::Stopped) << \
(QList<Job::Status>() << Job::Running << Job::Running << Job::Running); +    \
QTest::newRow("no limit, will all three be started and one remain running?") << \
NO_LIMIT << (QList<Job::Status>() << Job::Stopped << Job::Running << Job::Stopped << \
Job::Stopped) << (QList<Job::Status>() << Job::Running << Job::Running << \
Job::Running << Job::Running);  } 
 
 void SchedulerTest::testCountRunningJobs()
@@ -161,6 +162,7 @@
     QTest::newRow("limit 2, will first two start while last will stay stopped?") << \
                2 << (QList<Job::Status>() << Job::Stopped << Job::Stopped << \
                Job::Stopped) << 2;
     QTest::newRow("limit 2, will first two start while last will be stopped?") << 2 \
                << (QList<Job::Status>() << Job::Stopped << Job::Stopped << \
                Job::Running) << 2;
     QTest::newRow("no limit, two finished, will third be started?") << NO_LIMIT << \
(QList<Job::Status>() << Job::Finished << Job::Finished << Job::Stopped) << 1; +    \
QTest::newRow("no limit, two finished, will third be started and fourth stay \
running?") << NO_LIMIT << (QList<Job::Status>() << Job::Finished << Job::Finished << \
                Job::Stopped << Job::Running) << 2;
     QTest::newRow("no limit, will all three be started?") << NO_LIMIT << \
(QList<Job::Status>() << Job::Stopped << Job::Stopped << Job::Stopped) << 3;  }
 
@@ -193,11 +195,13 @@
     QTest::addColumn<int>("limit");
     QTest::addColumn<QList<Job::Status> >("status");
 
-    QTest::newRow("limit 2, two finished, will third be started?") << 2 << \
                (QList<Job::Status>() << Job::Finished << Job::Finished << \
                Job::Stopped);
-    QTest::newRow("limit 2, will first two start while last will stay stopped?") << \
                2 << (QList<Job::Status>() << Job::Stopped << Job::Stopped << \
                Job::Stopped);
-    QTest::newRow("limit 2, will first two start while last will be stopped?") << 2 \
                << (QList<Job::Status>() << Job::Stopped << Job::Stopped << \
                Job::Running);
-    QTest::newRow("no limit, two finished, will third be started?") << NO_LIMIT << \
                (QList<Job::Status>() << Job::Finished << Job::Finished << \
                Job::Stopped);
-    QTest::newRow("no limit, will all three be started?") << NO_LIMIT << \
(QList<Job::Status>() << Job::Stopped << Job::Stopped << Job::Stopped); +    \
QTest::newRow("limit 2, two finished one stopped") << 2 << (QList<Job::Status>() << \
Job::Finished << Job::Finished << Job::Stopped); +    QTest::newRow("limit 2, two \
finished one running") << 2 << (QList<Job::Status>() << Job::Finished << \
Job::Finished << Job::Stopped); +    QTest::newRow("limit 2, three stopped") << 2 << \
(QList<Job::Status>() << Job::Stopped << Job::Stopped << Job::Stopped); +    \
QTest::newRow("limit 2, two stopped one running") << 2 << (QList<Job::Status>() << \
Job::Stopped << Job::Stopped << Job::Running); +    QTest::newRow("no limit, two \
finished one stopped") << NO_LIMIT << (QList<Job::Status>() << Job::Finished << \
Job::Finished << Job::Stopped); +    QTest::newRow("no limit, three stopped") << \
NO_LIMIT << (QList<Job::Status>() << Job::Stopped << Job::Stopped << Job::Stopped); + \
QTest::newRow("no limit, one running, three stopped") << NO_LIMIT << \
(QList<Job::Status>() << Job::Running << Job::Stopped << Job::Stopped << \
Job::Stopped);  }
 
 void SchedulerTest::testSchedulerStopStart()
@@ -240,6 +244,7 @@
     QTest::newRow("limit 2, will first two start while last will be stopped?") << 2 \
<< (QList<Job::Status>() << Job::Stopped << Job::Stopped << Job::Running) << \
(QList<Job::Status>() << Job::Running << Job::Running << Job::Stopped);  \
QTest::newRow("no limit, two finished, will third be started?") << NO_LIMIT << \
(QList<Job::Status>() << Job::Finished << Job::Finished << Job::Stopped) << \
(QList<Job::Status>() << Job::Finished << Job::Finished << Job::Running);  \
QTest::newRow("no limit, will all three be started?") << NO_LIMIT << \
(QList<Job::Status>() << Job::Stopped << Job::Stopped << Job::Stopped) << \
(QList<Job::Status>() << Job::Running << Job::Running << Job::Running); +    \
QTest::newRow("limit 2, two finished, will third stay running?") << 2 << \
(QList<Job::Status>() << Job::Finished << Job::Finished << Job::Running) << \
(QList<Job::Status>() << Job::Finished << Job::Finished << Job::Running);  }
 
 
@@ -282,11 +287,13 @@
     QTest::addColumn<QList<Job::Status> >("status");
     QTest::addColumn<QList<Job::Status> >("finalStatus");
 
+    //NOTE Scheduler does not stop jobs, it just prevents new ones from being \
started  QTest::newRow("limit 2, two finished, will third be started?") << 2 << \
(QList<Job::Status>() << Job::Finished << Job::Finished << Job::Stopped) << \
(QList<Job::Status>() << Job::Finished << Job::Finished << Job::Running);  \
QTest::newRow("limit 2, will first two start while last will stay stopped?") << 2 << \
(QList<Job::Status>() << Job::Stopped << Job::Stopped << Job::Stopped) << \
                (QList<Job::Status>() << Job::Running << Job::Running << \
                Job::Stopped);
-    QTest::newRow("limit 2, will first two start while last will be stopped?") << 2 \
<< (QList<Job::Status>() << Job::Stopped << Job::Stopped << Job::Running) << \
(QList<Job::Status>() << Job::Running << Job::Running << Job::Stopped); +    \
QTest::newRow("limit 2, will first start and second not while last will stay \
running?") << 2 << (QList<Job::Status>() << Job::Stopped << Job::Stopped << \
Job::Running) << (QList<Job::Status>() << Job::Running << Job::Running << \
Job::Stopped);  QTest::newRow("no limit, two finished, will third be started?") << \
NO_LIMIT << (QList<Job::Status>() << Job::Finished << Job::Finished << Job::Stopped) \
<< (QList<Job::Status>() << Job::Finished << Job::Finished << Job::Running);  \
QTest::newRow("no limit, will all three be started?") << NO_LIMIT << \
(QList<Job::Status>() << Job::Stopped << Job::Stopped << Job::Stopped) << \
(QList<Job::Status>() << Job::Running << Job::Running << Job::Running); +    \
QTest::newRow("limit 2, two finished, will third stay running?") << 2 << \
(QList<Job::Status>() << Job::Finished << Job::Finished << Job::Running) << \
(QList<Job::Status>() << Job::Finished << Job::Finished << Job::Running);  
 }
 
--- trunk/KDE/kdenetwork/kget/tests/schedulertest.h #1249934:1249935
@@ -104,8 +104,8 @@
         void testSuspendScheduler_data();
 
         /**
-         * Tests the case where the JobQueuePolicy is set to stop,
-         * by default it is set to start.
+         * Tests the case where the JobQueuePolicy is set to stop
+         * (this also happens on Scheduler::stop()) by default it is set to start.
          * Jobs with a Start policy might be started depending on their
          * other settings
          */


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic