/* * libbinrec: a recompiling translator for machine code * Copyright (c) 2016 Andrew Church * * This software may be copied and redistributed under certain conditions; * see the file "COPYING" in the source code distribution for details. * NO WARRANTY is provided with this software. */ #include "include/binrec.h" #include "src/common.h" #include "tests/common.h" #include "tests/log-capture.h" #include "tests/mem-wrappers.h" int main(void) { binrec_setup_t setup; memset(&setup, 0, sizeof(setup)); setup.malloc = mem_wrap_malloc; setup.realloc = mem_wrap_realloc; setup.free = mem_wrap_free; setup.log = log_capture; mem_wrap_fail_after(0); EXPECT_FALSE(binrec_create_handle(&setup)); EXPECT_STREQ(get_log_messages(), "[error] No memory for handle\n"); return EXIT_SUCCESS; }