nautilus_directory_verify_request_counts (NautilusDirectory *directory)
{
    GList *l;
    RequestCounter counters;
    int i;
    gboolean fail;

    fail = FALSE;
    for (i = 0; i < REQUEST_TYPE_LAST; i++)
    {
        counters[i] = 0;
    }
    for (l = directory->details->monitor_list; l != NULL; l = l->next)
    {
        Monitor *monitor = l->data;
        request_counter_add_request (counters, monitor->request);
    }
    for (i = 0; i < REQUEST_TYPE_LAST; i++)
    {
        if (counters[i] != directory->details->monitor_counters[i])
        {
            g_warning ("monitor counter for %i is wrong, expecting %d but found %d",
                       i, counters[i], directory->details->monitor_counters[i]);
            fail = TRUE;
        }
    }
    for (i = 0; i < REQUEST_TYPE_LAST; i++)
    {
        counters[i] = 0;
    }
    for (l = directory->details->call_when_ready_list; l != NULL; l = l->next)
    {
        ReadyCallback *callback = l->data;
        request_counter_add_request (counters, callback->request);
    }
    for (i = 0; i < REQUEST_TYPE_LAST; i++)
    {
        if (counters[i] != directory->details->call_when_ready_counters[i])
        {
            g_warning ("call when ready counter for %i is wrong, expecting %d but found %d",
                       i, counters[i], directory->details->call_when_ready_counters[i]);
            fail = TRUE;
        }
    }
    g_assert (!fail);
}
nautilus_directory_verify_request_counts (NautilusDirectory *directory)
{
    GList *l;
    RequestCounter counters;
    int i;
    gboolean fail;

    fail = FALSE;
    for (i = 0; i < REQUEST_TYPE_LAST; i++)
    {
        counters[i] = 0;
    }
    for (l = directory->details->monitor_list; l != NULL; l = l->next)
    {
        Monitor *monitor = l->data;
        request_counter_add_request (counters, monitor->request);
    }
    for (i = 0; i < REQUEST_TYPE_LAST; i++)
    {
        if (counters[i] != directory->details->monitor_counters[i])
        {
            g_warning ("monitor counter for %i is wrong, expecting %d but found %d",
                       i, counters[i], directory->details->monitor_counters[i]);
            fail = TRUE;
        }
    }
    for (i = 0; i < REQUEST_TYPE_LAST; i++)
    {
        counters[i] = 0;
    }
    for (l = directory->details->call_when_ready_list; l != NULL; l = l->next)
    {
        ReadyCallback *callback = l->data;
        request_counter_add_request (counters, callback->request);
    }
    for (i = 0; i < REQUEST_TYPE_LAST; i++)
    {
        if (counters[i] != directory->details->call_when_ready_counters[i])
        {
            g_warning ("call when ready counter for %i is wrong, expecting %d but found %d",
                       i, counters[i], directory->details->call_when_ready_counters[i]);
            fail = TRUE;
        }
    }
    g_assert (!fail);
}