static void internal_umockcallrecorder_reset_all_calls()

in src/umockcallrecorder.c [67:95]


static void internal_umockcallrecorder_reset_all_calls(UMOCKCALLRECORDER_HANDLE umock_call_recorder)
{
    /* Codes_SRS_UMOCKCALLRECORDER_01_005: [ umockcallrecorder_reset_all_calls shall free all the expected and actual calls for the call recorder identified by umock_call_recorder. ]*/
    if (umock_call_recorder->expected_calls != NULL)
    {
        size_t i;
        for (i = 0; i < umock_call_recorder->expected_call_count; i++)
        {
            umockcall_destroy(umock_call_recorder->expected_calls[i].umockcall);
        }

        umockalloc_free(umock_call_recorder->expected_calls);
        umock_call_recorder->expected_calls = NULL;
    }
    umock_call_recorder->expected_call_count = 0;

    if (umock_call_recorder->actual_calls != NULL)
    {
        size_t i;
        for (i = 0; i < umock_call_recorder->actual_call_count; i++)
        {
            umockcall_destroy(umock_call_recorder->actual_calls[i]);
        }

        umockalloc_free(umock_call_recorder->actual_calls);
        umock_call_recorder->actual_calls = NULL;
    }
    umock_call_recorder->actual_call_count = 0;
}