static void test_allocator_injection(void) {
    hiredisAllocFuncs ha = {
        .mallocFn = hi_malloc_fail,
        .callocFn = hi_calloc_fail,
        .reallocFn = hi_realloc_fail,
        .strdupFn = strdup,
        .freeFn = free,
    };

    // Override hiredis allocators
    hiredisSetAllocators(&ha);

    test("redisContext uses injected allocators: ");
    redisContext *c = redisConnect("localhost", 6379);
    test_cond(c == NULL);

    test("redisReader uses injected allocators: ");
    redisReader *reader = redisReaderCreate();
    test_cond(reader == NULL);

    // Return allocators to default
    hiredisResetAllocators();
}
static void test_allocator_injection(void) {
    hiredisAllocFuncs ha = {
        .mallocFn = hi_malloc_fail,
        .callocFn = hi_calloc_fail,
        .reallocFn = hi_realloc_fail,
        .strdupFn = strdup,
        .freeFn = free,
    };

     
    hiredisSetAllocators(&ha);

    test("redisContext uses injected allocators: ");
    redisContext *c = redisConnect("localhost", 6379);
    test_cond(c == NULL);

    test("redisReader uses injected allocators: ");
    redisReader *reader = redisReaderCreate();
    test_cond(reader == NULL);

     
    hiredisResetAllocators();
}