25 bfelf_loader_ut::test_bfelf_file_init_success()
28 auto &&
data = get_test();
29 auto &&buff = std::get<0>(
data);
32 auto ret = bfelf_file_init(buff.get(),
size, &ef);
37 bfelf_loader_ut::test_bfelf_file_init_invalid_file_arg()
40 auto &&
data = get_test();
41 auto &&size = std::get<1>(
data);
43 auto ret = bfelf_file_init(
nullptr, size, &ef);
48 bfelf_loader_ut::test_bfelf_file_init_invalid_file_size_arg()
51 auto &&
data = get_test();
52 auto &&buff = std::get<0>(
data);
54 auto ret = bfelf_file_init(buff.get(), 0, &ef);
59 bfelf_loader_ut::test_bfelf_file_init_invalid_elf_file()
61 auto &&
data = get_test();
62 auto &&buff = std::get<0>(
data);
63 auto &&size = std::get<1>(
data);
65 auto ret = bfelf_file_init(buff.get(),
size,
nullptr);
70 bfelf_loader_ut::test_bfelf_file_init_invalid_magic_0()
73 auto &&
data = get_test();
74 auto &&buff = std::get<0>(
data);
75 auto &&size = std::get<1>(
data);
76 auto &&test =
reinterpret_cast<bfelf_test *
>(buff.get());
78 test->
header.e_ident[bfei_mag0] = 0;
80 auto ret = bfelf_file_init(buff.get(),
size, &ef);
85 bfelf_loader_ut::test_bfelf_file_init_invalid_magic_1()
88 auto &&
data = get_test();
89 auto &&buff = std::get<0>(
data);
90 auto &&size = std::get<1>(
data);
91 auto &&test =
reinterpret_cast<bfelf_test *
>(buff.get());
93 test->
header.e_ident[bfei_mag1] = 0;
95 auto ret = bfelf_file_init(buff.get(),
size, &ef);
100 bfelf_loader_ut::test_bfelf_file_init_invalid_magic_2()
103 auto &&
data = get_test();
104 auto &&buff = std::get<0>(
data);
105 auto &&size = std::get<1>(
data);
106 auto &&test =
reinterpret_cast<bfelf_test *
>(buff.get());
108 test->
header.e_ident[bfei_mag2] = 0;
110 auto ret = bfelf_file_init(buff.get(),
size, &ef);
115 bfelf_loader_ut::test_bfelf_file_init_invalid_magic_3()
118 auto &&
data = get_test();
119 auto &&buff = std::get<0>(
data);
120 auto &&size = std::get<1>(
data);
121 auto &&test =
reinterpret_cast<bfelf_test *
>(buff.get());
123 test->
header.e_ident[bfei_mag3] = 0;
125 auto ret = bfelf_file_init(buff.get(),
size, &ef);
130 bfelf_loader_ut::test_bfelf_file_init_invalid_class()
133 auto &&
data = get_test();
134 auto &&buff = std::get<0>(
data);
135 auto &&size = std::get<1>(
data);
136 auto &&test =
reinterpret_cast<bfelf_test *
>(buff.get());
138 test->
header.e_ident[bfei_class] = 0x4;
140 auto ret = bfelf_file_init(buff.get(),
size, &ef);
145 bfelf_loader_ut::test_bfelf_file_init_invalid_data()
148 auto &&
data = get_test();
149 auto &&buff = std::get<0>(
data);
150 auto &&size = std::get<1>(
data);
151 auto &&test =
reinterpret_cast<bfelf_test *
>(buff.get());
153 test->
header.e_ident[bfei_data] = 0x8;
155 auto ret = bfelf_file_init(buff.get(),
size, &ef);
160 bfelf_loader_ut::test_bfelf_file_init_invalid_ident_version()
163 auto &&
data = get_test();
164 auto &&buff = std::get<0>(
data);
165 auto &&size = std::get<1>(
data);
166 auto &&test =
reinterpret_cast<bfelf_test *
>(buff.get());
168 test->
header.e_ident[bfei_version] = 0x15;
170 auto ret = bfelf_file_init(buff.get(),
size, &ef);
175 bfelf_loader_ut::test_bfelf_file_init_invalid_osabi()
178 auto &&
data = get_test();
179 auto &&buff = std::get<0>(
data);
180 auto &&size = std::get<1>(
data);
181 auto &&test =
reinterpret_cast<bfelf_test *
>(buff.get());
183 test->
header.e_ident[bfei_osabi] = 0x16;
185 auto ret = bfelf_file_init(buff.get(),
size, &ef);
190 bfelf_loader_ut::test_bfelf_file_init_invalid_abiversion()
193 auto &&
data = get_test();
194 auto &&buff = std::get<0>(
data);
195 auto &&size = std::get<1>(
data);
196 auto &&test =
reinterpret_cast<bfelf_test *
>(buff.get());
198 test->
header.e_ident[bfei_abiversion] = 0x23;
200 auto ret = bfelf_file_init(buff.get(),
size, &ef);
205 bfelf_loader_ut::test_bfelf_file_init_invalid_type()
208 auto &&
data = get_test();
209 auto &&buff = std::get<0>(
data);
210 auto &&size = std::get<1>(
data);
211 auto &&test =
reinterpret_cast<bfelf_test *
>(buff.get());
213 test->
header.e_type = 0xDEAD;
215 auto ret = bfelf_file_init(buff.get(),
size, &ef);
220 bfelf_loader_ut::test_bfelf_file_init_invalid_machine()
223 auto &&
data = get_test();
224 auto &&buff = std::get<0>(
data);
225 auto &&size = std::get<1>(
data);
226 auto &&test =
reinterpret_cast<bfelf_test *
>(buff.get());
228 test->
header.e_machine = 0xDEAD;
230 auto ret = bfelf_file_init(buff.get(),
size, &ef);
235 bfelf_loader_ut::test_bfelf_file_init_invalid_version()
238 auto &&
data = get_test();
239 auto &&buff = std::get<0>(
data);
240 auto &&size = std::get<1>(
data);
241 auto &&test =
reinterpret_cast<bfelf_test *
>(buff.get());
243 test->
header.e_version = 0xDEAD;
245 auto ret = bfelf_file_init(buff.get(),
size, &ef);
250 bfelf_loader_ut::test_bfelf_file_init_invalid_flags()
253 auto &&
data = get_test();
254 auto &&buff = std::get<0>(
data);
255 auto &&size = std::get<1>(
data);
256 auto &&test =
reinterpret_cast<bfelf_test *
>(buff.get());
258 test->
header.e_flags = 0xDEAD;
260 auto ret = bfelf_file_init(buff.get(),
size, &ef);
#define BFELF_ERROR_INVALID_ARG
int64_t unsigned long void * data
#define BFELF_ERROR_UNSUPPORTED_FILE
constexpr const auto size
#define BFELF_ERROR_INVALID_SIGNATURE