Changeset c6d87c10 in mainline
- Timestamp:
- 2019-08-06T19:25:44Z (6 years ago)
- Children:
- d89b259
- Parents:
- dba056b
- git-author:
- Michal Koutný <xm.koutny+hos@…> (2015-06-20 01:05:41)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2019-08-06 19:25:44)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/sysman/test/job_closure.c
rdba056b rc6d87c10 88 88 static job_t *dummy_job(unit_t *unit, unit_state_t target_state) 89 89 { 90 job_t *old_job = unit->job;91 unit->job = NULL;92 93 90 job_t *result = job_create(unit, target_state); 94 95 job_del_ref(&result);96 unit->job = old_job;97 98 91 return result; 92 } 93 94 static void dummy_add_closure(dyn_array_t *closure) 95 { 96 dyn_array_foreach(*closure, job_t *, it) { 97 (*it)->unit->job = *it; 98 } 99 99 } 100 100 … … 144 144 mock_add_dependency(u2, u3); 145 145 146 /* Intentionally omit u0 */ 146 147 job_t *main_job = job_create(u1, STATE_STARTED); 147 148 assert(main_job); … … 153 154 dyn_array_append(&exp_closure, job_t *, dummy_job(u2, STATE_STARTED)); 154 155 dyn_array_append(&exp_closure, job_t *, dummy_job(u3, STATE_STARTED)); 156 157 dummy_add_closure(&act_closure); 155 158 156 159 PCUT_ASSERT_TRUE(same_jobs(&exp_closure, &act_closure)); … … 182 185 dyn_array_append(&exp_closure, job_t *, dummy_job(u2, STATE_STARTED)); 183 186 dyn_array_append(&exp_closure, job_t *, dummy_job(u3, STATE_STARTED)); 187 188 dummy_add_closure(&act_closure); 184 189 185 190 PCUT_ASSERT_TRUE(same_jobs(&exp_closure, &act_closure)); … … 214 219 dyn_array_append(&exp_closure, job_t *, dummy_job(u3, STATE_STARTED)); 215 220 221 dummy_add_closure(&act_closure); 222 216 223 PCUT_ASSERT_TRUE(same_jobs(&exp_closure, &act_closure)); 217 224 PCUT_ASSERT_TRUE(job_blocked(u1->job, u2->job));
Note:
See TracChangeset
for help on using the changeset viewer.