rename TASK_* -> TASK_STATUS_* (#31)

This commit is contained in:
Philipp Moritz 2016-10-04 16:59:44 -07:00 committed by Robert Nishihara
parent 8e044535e2
commit 4329afbd53
2 changed files with 11 additions and 11 deletions

8
task.h
View file

@ -93,10 +93,10 @@ void print_task(task_spec *spec, UT_string *output);
/* The scheduling_state can be used as a flag when we are listening
* for an event, for example TASK_WAITING | TASK_SCHEDULED. */
enum scheduling_state {
TASK_WAITING = 1,
TASK_SCHEDULED = 2,
TASK_RUNNING = 4,
TASK_DONE = 8
TASK_STATUS_WAITING = 1,
TASK_STATUS_SCHEDULED = 2,
TASK_STATUS_RUNNING = 4,
TASK_STATUS_DONE = 8
};
/* A task instance is one execution of a task specification.

View file

@ -74,7 +74,7 @@ TEST object_table_lookup_test(void) {
void task_log_test_callback(task_instance *instance, void *userdata) {
task_instance *other = userdata;
CHECK(*task_instance_state(instance) == TASK_SCHEDULED);
CHECK(*task_instance_state(instance) == TASK_STATUS_SCHEDULED);
CHECK(task_instance_size(instance) == task_instance_size(other));
CHECK(memcmp(instance, other, task_instance_size(instance)) == 0);
}
@ -86,9 +86,9 @@ TEST task_log_test(void) {
node_id node = globally_unique_id();
task_spec *task = example_task();
task_instance *instance =
make_task_instance(globally_unique_id(), task, TASK_SCHEDULED, node);
task_log_register_callback(db, task_log_test_callback, node, TASK_SCHEDULED,
instance);
make_task_instance(globally_unique_id(), task, TASK_STATUS_SCHEDULED, node);
task_log_register_callback(db, task_log_test_callback, node,
TASK_STATUS_SCHEDULED, instance);
task_log_add_task(db, instance);
event_loop_add_timer(loop, 100, timeout_handler, NULL);
event_loop_run(loop);
@ -112,11 +112,11 @@ TEST task_log_all_test(void) {
task_spec *task = example_task();
/* Schedule two tasks on different nodes. */
task_instance *instance1 = make_task_instance(
globally_unique_id(), task, TASK_SCHEDULED, globally_unique_id());
globally_unique_id(), task, TASK_STATUS_SCHEDULED, globally_unique_id());
task_instance *instance2 = make_task_instance(
globally_unique_id(), task, TASK_SCHEDULED, globally_unique_id());
globally_unique_id(), task, TASK_STATUS_SCHEDULED, globally_unique_id());
task_log_register_callback(db, task_log_all_test_callback, NIL_ID,
TASK_SCHEDULED, NULL);
TASK_STATUS_SCHEDULED, NULL);
task_log_add_task(db, instance1);
task_log_add_task(db, instance2);
event_loop_add_timer(loop, 100, timeout_handler, NULL);