static int test_rand_add(void)
{
    RAND_DRBG *master = RAND_DRBG_get0_master();
    RAND_DRBG_get_entropy_fn old_get_entropy = master->get_entropy;
    RAND_DRBG_cleanup_entropy_fn old_cleanup_entropy = master->cleanup_entropy;
    int rv = 0;
    unsigned char rand_add_buf[256];
    master->get_entropy = get_pool_entropy;
    master->cleanup_entropy = cleanup_pool_entropy;
    master->reseed_prop_counter++;
    RAND_DRBG_uninstantiate(master);
    memset(rand_add_buf, 0xCD, sizeof(rand_add_buf));
    RAND_add(rand_add_buf, sizeof(rand_add_buf), sizeof(rand_add_buf));
    if (!TEST_true(RAND_DRBG_instantiate(master, NULL, 0)))
        goto error;
    rv = 1;
error:
    master->get_entropy = old_get_entropy;
    master->cleanup_entropy = old_cleanup_entropy;
    return rv;
}
['static int test_rand_add(void)\n{\n    RAND_DRBG *master = RAND_DRBG_get0_master();\n    RAND_DRBG_get_entropy_fn old_get_entropy = master->get_entropy;\n    RAND_DRBG_cleanup_entropy_fn old_cleanup_entropy = master->cleanup_entropy;\n    int rv = 0;\n    unsigned char rand_add_buf[256];\n    master->get_entropy = get_pool_entropy;\n    master->cleanup_entropy = cleanup_pool_entropy;\n    master->reseed_prop_counter++;\n    RAND_DRBG_uninstantiate(master);\n    memset(rand_add_buf, 0xCD, sizeof(rand_add_buf));\n    RAND_add(rand_add_buf, sizeof(rand_add_buf), sizeof(rand_add_buf));\n    if (!TEST_true(RAND_DRBG_instantiate(master, NULL, 0)))\n        goto error;\n    rv = 1;\nerror:\n    master->get_entropy = old_get_entropy;\n    master->cleanup_entropy = old_cleanup_entropy;\n    return rv;\n}', 'RAND_DRBG *RAND_DRBG_get0_master(void)\n{\n    if (!RUN_ONCE(&rand_drbg_init, do_rand_drbg_init))\n        return NULL;\n    return master_drbg;\n}', 'int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))\n{\n    if (pthread_once(once, init) != 0)\n        return 0;\n    return 1;\n}']