void test_dequeue_thread_sets_queued_false() { Thread* thread = Thread::create(state); thread->queued(state, Qtrue); state->dequeue_thread(thread); TS_ASSERT_EQUALS(Qfalse, thread->queued()); }
void test_dequeue_thread_removes_from_scheduled() { Thread* thread = Thread::create(state); thread->priority(state, Fixnum::from(0)); state->queue_thread(thread); List* zeroes = as<List>(state->globals.scheduled_threads->at(state, 0)); TS_ASSERT_EQUALS(1, zeroes->count()->to_native()); state->dequeue_thread(thread); TS_ASSERT_EQUALS(Qfalse, thread->queued()); TS_ASSERT_EQUALS(0, zeroes->count()->to_native()); }