25 bfelf_loader_ut::test_bfelf_loader_add_invalid_loader()
28 bfelf_file_t dummy_misc_ef;
30 ret = bfelf_file_init(m_dummy_misc.get(), m_dummy_misc_length, &dummy_misc_ef);
33 ret = bfelf_loader_add(
nullptr, &dummy_misc_ef, m_dummy_misc_exec.get(), m_dummy_misc_exec.get());
38 bfelf_loader_ut::test_bfelf_loader_add_invalid_elf_file()
40 bfelf_loader_t loader;
41 memset(&loader, 0,
sizeof(loader));
43 auto ret = bfelf_loader_add(&loader,
nullptr, m_dummy_misc_exec.get(), m_dummy_misc_exec.get());
48 bfelf_loader_ut::test_bfelf_loader_add_invalid_addr()
52 bfelf_loader_t loader;
53 memset(&loader, 0,
sizeof(loader));
55 bfelf_file_t dummy_misc_ef;
57 ret = bfelf_file_init(m_dummy_misc.get(), m_dummy_misc_length, &dummy_misc_ef);
60 ret = bfelf_loader_add(&loader, &dummy_misc_ef,
nullptr, m_dummy_misc_exec.get());
65 bfelf_loader_ut::test_bfelf_loader_add_too_many_files()
69 bfelf_loader_t loader;
70 memset(&loader, 0,
sizeof(loader));
74 bfelf_file_t dummy_misc_ef;
76 ret = bfelf_file_init(m_dummy_misc.get(), m_dummy_misc_length, &dummy_misc_ef);
79 auto &&dummy_misc_pair = get_elf_exec(&dummy_misc_ef);
80 auto &&dummy_misc_exec = std::move(std::get<0>(dummy_misc_pair));
82 ret = bfelf_loader_add(&loader, &dummy_misc_ef, dummy_misc_exec.get(), dummy_misc_exec.get());
84 if (i < MAX_NUM_MODULES)
96 bfelf_loader_ut::test_bfelf_loader_add_fake()
101 auto &&
data = get_test();
102 auto &&buff = std::get<0>(
data);
105 ret = bfelf_file_init(buff.get(),
size, &ef);
108 bfelf_loader_t loader;
109 memset(&loader, 0,
sizeof(loader));
111 char nothing[10] = {};
113 ret = bfelf_loader_add(&loader, &ef, static_cast<char *>(nothing), static_cast<char *>(nothing));
void * memset(void *block, int c, size_t size)
#define BFELF_ERROR_INVALID_ARG
int64_t unsigned long void * data
constexpr const auto size
#define BFELF_ERROR_LOADER_FULL