25 bfelf_loader_ut::test_bfelf_file_get_needed_invalid_ef()
30 auto ret = bfelf_file_get_needed(
nullptr, index, &needed);
35 bfelf_loader_ut::test_bfelf_file_get_needed_invalid_index()
41 auto ret = bfelf_file_get_needed(&ef, index, &needed);
46 bfelf_loader_ut::test_bfelf_file_get_needed_invalid_size()
51 auto ret = bfelf_file_get_needed(&ef, index,
nullptr);
56 bfelf_loader_ut::test_bfelf_file_get_needed_success()
59 bfelf_file_t dummy_misc_ef;
60 bfelf_file_t dummy_code_ef;
62 ret = bfelf_file_init(m_dummy_misc.get(), m_dummy_misc_length, &dummy_misc_ef);
64 ret = bfelf_file_init(m_dummy_code.get(), m_dummy_code_length, &dummy_code_ef);
67 auto &&dummy_misc_pair = get_elf_exec(&dummy_misc_ef);
68 auto &&dummy_code_pair = get_elf_exec(&dummy_code_ef);
70 m_dummy_misc_exec = std::move(std::get<0>(dummy_misc_pair));
71 m_dummy_code_exec = std::move(std::get<0>(dummy_code_pair));
73 bfelf_loader_t loader;
74 memset(&loader, 0,
sizeof(loader));
76 ret = bfelf_loader_add(&loader, &dummy_misc_ef, m_dummy_misc_exec.get(), m_dummy_misc_exec.get());
78 ret = bfelf_loader_add(&loader, &dummy_code_ef, m_dummy_code_exec.get(), m_dummy_code_exec.get());
81 ret = bfelf_loader_relocate(&loader);
87 ret = bfelf_file_get_needed(&dummy_misc_ef, index, &needed);
void * memset(void *block, int c, size_t size)
#define BFELF_ERROR_INVALID_ARG
#define BFELF_ERROR_INVALID_INDEX
auto index(const T virt, const F from)