aboutsummaryrefslogtreecommitdiff
path: root/tests/test-blockjob.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-04-13 17:31:02 +0200
committerKevin Wolf <kwolf@redhat.com>2018-05-23 14:30:50 +0200
commitda01ff7f38f52791f93fc3ca59afcfbb220f15af (patch)
tree74010498c6229085ce3f2cc2184168aec5fb99f8 /tests/test-blockjob.c
parent1908a5590c7d214b1b6886bc19b81076fb65cec9 (diff)
job: Move coroutine and related code to Job
This commit moves some core functions for dealing with the job coroutine from BlockJob to Job. This includes primarily entering the coroutine (both for the first and reentering) and yielding explicitly and at pause points. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'tests/test-blockjob.c')
-rw-r--r--tests/test-blockjob.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/test-blockjob.c b/tests/test-blockjob.c
index 5f43bd72a4..1d18325feb 100644
--- a/tests/test-blockjob.c
+++ b/tests/test-blockjob.c
@@ -199,8 +199,8 @@ static const BlockJobDriver test_cancel_driver = {
.job_driver = {
.instance_size = sizeof(CancelJob),
.free = block_job_free,
+ .start = cancel_job_start,
},
- .start = cancel_job_start,
.complete = cancel_job_complete,
};
@@ -254,7 +254,7 @@ static void test_cancel_running(void)
s = create_common(&job);
- block_job_start(job);
+ job_start(&job->job);
assert(job->job.status == JOB_STATUS_RUNNING);
cancel_common(s);
@@ -267,7 +267,7 @@ static void test_cancel_paused(void)
s = create_common(&job);
- block_job_start(job);
+ job_start(&job->job);
assert(job->job.status == JOB_STATUS_RUNNING);
block_job_user_pause(job, &error_abort);
@@ -284,7 +284,7 @@ static void test_cancel_ready(void)
s = create_common(&job);
- block_job_start(job);
+ job_start(&job->job);
assert(job->job.status == JOB_STATUS_RUNNING);
s->should_converge = true;
@@ -301,7 +301,7 @@ static void test_cancel_standby(void)
s = create_common(&job);
- block_job_start(job);
+ job_start(&job->job);
assert(job->job.status == JOB_STATUS_RUNNING);
s->should_converge = true;
@@ -322,7 +322,7 @@ static void test_cancel_pending(void)
s = create_common(&job);
- block_job_start(job);
+ job_start(&job->job);
assert(job->job.status == JOB_STATUS_RUNNING);
s->should_converge = true;
@@ -346,7 +346,7 @@ static void test_cancel_concluded(void)
s = create_common(&job);
- block_job_start(job);
+ job_start(&job->job);
assert(job->job.status == JOB_STATUS_RUNNING);
s->should_converge = true;