28 static auto operator"" _uce(
const char *
str, std::size_t len)
29 { (void)str; (void)len;
return std::make_shared<bfn::unknown_command_error>(
""); }
31 static auto operator"" _mae(
const char *
str, std::size_t len)
32 { (void)str; (void)len;
return std::make_shared<bfn::missing_argument_error>(); }
34 static auto operator"" _uvte(
const char *
str, std::size_t len)
35 { (void)str; (void)len;
return std::make_shared<bfn::unknown_vmcall_type_error>(
""); }
37 static auto operator"" _uvste(
const char *
str, std::size_t len)
38 { (void)str; (void)len;
return std::make_shared<bfn::unknown_vmcall_string_type_error>(
""); }
40 static auto operator"" _uvdte(
const char *
str, std::size_t len)
41 { (void)str; (void)len;
return std::make_shared<bfn::unknown_vmcall_data_type_error>(
""); }
44 bfm_ut::test_command_line_parser_with_no_args()
54 bfm_ut::test_command_line_parser_with_empty_args()
56 auto &&args = {
" "_s};
64 bfm_ut::test_command_line_parser_with_unknown_command()
66 auto &&args = {
"unknown"_s};
74 bfm_ut::test_command_line_parser_with_unknown_command_resets_state()
76 auto &&args1 = {
"unload"_s};
77 auto &&args2 = {
"unknown"_s};
88 bfm_ut::test_command_line_parser_with_unknown_option_single_bar()
90 auto &&args = {
"-unknown"_s};
98 bfm_ut::test_command_line_parser_with_unknown_option_dual_bar()
100 auto &&args = {
"--unknown"_s};
108 bfm_ut::test_command_line_parser_with_single_bar_help()
110 auto &&args = {
"-h"_s};
118 bfm_ut::test_command_line_parser_with_dual_bar_help()
120 auto &&args = {
"--help"_s};
128 bfm_ut::test_command_line_parser_with_single_bar_help_unknown_option()
130 auto &&args = {
"-h"_s,
"unknown"_s};
138 bfm_ut::test_command_line_parser_with_dual_bar_help_unknown_option()
140 auto &&args = {
"--help"_s,
"unknown"_s};
148 bfm_ut::test_command_line_parser_with_load_no_modules()
150 auto &&args = {
"load"_s};
158 bfm_ut::test_command_line_parser_with_load_no_modules_empty_arg()
160 auto &&args = {
"load"_s,
" "_s};
168 bfm_ut::test_command_line_parser_with_valid_load()
170 auto &&args = {
"load"_s,
"filename"_s};
179 bfm_ut::test_command_line_parser_with_valid_load_unknown_option()
181 auto &&args = {
"load"_s,
"--unknow_option"_s,
"filename"_s};
190 bfm_ut::test_command_line_parser_with_unknown_command_before_valid_load()
192 auto &&args = {
"unknown_cmd"_s,
"load"_s,
"filename"_s};
200 bfm_ut::test_command_line_parser_with_unknown_command_after_valid_load()
202 auto &&args = {
"load"_s,
"filename"_s,
"unknown_cmd"_s};
211 bfm_ut::test_command_line_parser_with_help_and_valid_load()
213 auto &&args = {
"-h"_s,
"load"_s,
"filename"_s};
221 bfm_ut::test_command_line_parser_with_valid_unload()
223 auto &&args = {
"unload"_s};
231 bfm_ut::test_command_line_parser_with_valid_start()
233 auto &&args = {
"start"_s};
241 bfm_ut::test_command_line_parser_with_valid_stop()
243 auto &&args = {
"stop"_s};
251 bfm_ut::test_command_line_parser_with_valid_dump()
253 auto &&args = {
"dump"_s};
262 bfm_ut::test_command_line_parser_with_valid_status()
264 auto &&args = {
"status"_s};
272 bfm_ut::test_command_line_parser_no_vcpuid()
274 auto &&args = {
"dump"_s,
"--vcpuid"_s};
283 bfm_ut::test_command_line_parser_invalid_vcpuid()
285 auto &&args = {
"dump"_s,
"--vcpuid"_s,
"not_a_number"_s};
293 bfm_ut::test_command_line_parser_valid_vcpuid()
295 auto &&args = {
"dump"_s,
"--vcpuid"_s,
"2"_s};
304 bfm_ut::test_command_line_parser_missing_vmcall_opcode()
306 auto &&args = {
"vmcall"_s};
314 bfm_ut::test_command_line_parser_unknown_vmcall_opcode()
316 auto &&args = {
"vmcall"_s,
"unknown"_s};
324 bfm_ut::test_command_line_parser_vmcall_versions_missing_index()
326 auto &&args = {
"vmcall"_s,
"versions"_s};
334 bfm_ut::test_command_line_parser_vmcall_versions_invalid_index()
336 auto &&args = {
"vmcall"_s,
"versions"_s,
"not_a_number"_s};
344 bfm_ut::test_command_line_parser_vmcall_versions_success()
346 auto &&args = {
"vmcall"_s,
"versions"_s,
"1"_s};
359 bfm_ut::test_command_line_parser_vmcall_versions_success_with_missing_cpuid()
361 auto &&args = {
"vmcall"_s,
"versions"_s,
"1"_s,
"--cpuid"_s};
374 bfm_ut::test_command_line_parser_vmcall_versions_success_with_invalid_cpuid()
376 auto &&args = {
"vmcall"_s,
"versions"_s,
"1"_s,
"--cpuid"_s,
"not_a_number"_s};
384 bfm_ut::test_command_line_parser_vmcall_versions_success_with_cpuid()
386 auto &&args = {
"vmcall"_s,
"versions"_s,
"1"_s,
"--cpuid"_s,
"2"_s};
399 bfm_ut::test_command_line_parser_vmcall_registers_missing_registers()
401 auto &&args = {
"vmcall"_s,
"registers"_s};
412 bfm_ut::test_command_line_parser_vmcall_registers_one_register_invalid_register()
414 auto &&args = {
"vmcall"_s,
"registers"_s,
"not_a_number"_s};
422 bfm_ut::test_command_line_parser_vmcall_registers_one_register()
424 auto &&args = {
"vmcall"_s,
"registers"_s,
"2"_s};
436 bfm_ut::test_command_line_parser_vmcall_registers_all_registers()
438 auto &&args = {
"vmcall"_s,
"registers"_s,
"2"_s,
"3"_s,
"4"_s,
"5"_s,
"6"_s,
"7"_s,
"8"_s,
"9"_s,
"10"_s,
"11"_s,
"12"_s,
"13"_s,
"14"_s,
"15"_s};
463 bfm_ut::test_command_line_parser_vmcall_string_missing_type()
465 auto &&args = {
"vmcall"_s,
"string"_s};
473 bfm_ut::test_command_line_parser_vmcall_string_unknown_type()
475 auto &&args = {
"vmcall"_s,
"string"_s,
"unknown"_s};
483 bfm_ut::test_command_line_parser_vmcall_string_missing_string()
485 auto &&args = {
"vmcall"_s,
"string"_s,
"unformatted"_s};
493 bfm_ut::test_command_line_parser_vmcall_string_unformatted()
495 auto &&args = {
"vmcall"_s,
"string"_s,
"unformatted"_s,
"hello world"_s};
511 bfm_ut::test_command_line_parser_vmcall_string_json_missing_json()
513 auto &&args = {
"vmcall"_s,
"string"_s,
"json"_s};
521 bfm_ut::test_command_line_parser_vmcall_string_json_invalid_json()
523 auto &&args = {
"vmcall"_s,
"string"_s,
"json"_s,
"hello world"_s};
531 bfm_ut::test_command_line_parser_vmcall_string_json()
533 auto &&args = {
"vmcall"_s,
"string"_s,
"json"_s,
"{\"msg\":\"hello world\"}"_s};
549 bfm_ut::test_command_line_parser_vmcall_data_missing_type()
551 auto &&args = {
"vmcall"_s,
"data"_s};
559 bfm_ut::test_command_line_parser_vmcall_data_unknown_type()
561 auto &&args = {
"vmcall"_s,
"data"_s,
"unknown"_s};
569 bfm_ut::test_command_line_parser_vmcall_data_missing_ifile()
571 auto &&args = {
"vmcall"_s,
"data"_s,
"unformatted"_s};
579 bfm_ut::test_command_line_parser_vmcall_data_missing_ofile()
581 auto &&args = {
"vmcall"_s,
"data"_s,
"unformatted"_s,
"ifile.txt"_s};
589 bfm_ut::test_command_line_parser_vmcall_data()
591 auto &&args = {
"vmcall"_s,
"data"_s,
"unformatted"_s,
"ifile.txt"_s,
"ofile.txt"_s};
607 bfm_ut::test_command_line_parser_vmcall_unittest_missing_index()
609 auto &&args = {
"vmcall"_s,
"unittest"_s};
617 bfm_ut::test_command_line_parser_vmcall_unittest_invalid_index()
619 auto &&args = {
"vmcall"_s,
"unittest"_s,
"not_a_number"_s};
627 bfm_ut::test_command_line_parser_vmcall_unittest_success()
629 auto &&args = {
"vmcall"_s,
"unittest"_s,
"1"_s};
642 bfm_ut::test_command_line_parser_vmcall_event_missing_index()
644 auto &&args = {
"vmcall"_s,
"event"_s};
652 bfm_ut::test_command_line_parser_vmcall_event_invalid_index()
654 auto &&args = {
"vmcall"_s,
"event"_s,
"not_a_number"_s};
662 bfm_ut::test_command_line_parser_vmcall_event_success()
664 auto &&args = {
"vmcall"_s,
"event"_s,
"1"_s};
#define expect_exception(f, e)
#define expect_no_exception(f)
#define VMCALL_MAGIC_NUMBER