36 vcpu_factory_ut()
noexcept =
default;
37 ~vcpu_factory_ut()
override =
default;
45 throw std::runtime_error(
"error");
47 return std::unique_ptr<vcpu>(
g_vcpu);
58 g_vcm->set_factory(
nullptr);
61 g_vcm->set_factory(std::make_unique<vcpu_factory_ut>());
75 this->test_vcpu_invalid_id();
76 this->test_vcpu_null_debug_ring();
77 this->test_vcpu_valid();
78 this->test_vcpu_write_empty_string();
79 this->test_vcpu_write_hello_world();
80 this->test_vcpu_init_null_attr();
81 this->test_vcpu_init_valid_attr();
82 this->test_vcpu_fini_null_attr();
83 this->test_vcpu_fini_valid_attr();
84 this->test_vcpu_fini_without_init_without_run();
85 this->test_vcpu_fini_with_init_without_run();
86 this->test_vcpu_fini_without_init_with_run();
87 this->test_vcpu_fini_with_init_with_run();
88 this->test_vcpu_run_null_attr();
89 this->test_vcpu_run_valid_attr();
90 this->test_vcpu_run_without_init();
91 this->test_vcpu_run_with_init();
92 this->test_vcpu_hlt_null_attr();
93 this->test_vcpu_hlt_valid_attr();
94 this->test_vcpu_hlt_without_run();
95 this->test_vcpu_hlt_with_run();
97 this->test_vcpu_is_bootstrap_vcpu();
98 this->test_vcpu_is_not_bootstrap_vcpu();
99 this->test_vcpu_is_host_vm_vcpu();
100 this->test_vcpu_is_not_host_vm_vcpu();
101 this->test_vcpu_is_guest_vm_vcpu();
102 this->test_vcpu_is_not_guest_vm_vcpu();
103 this->test_vcpu_is_running_vm_vcpu();
104 this->test_vcpu_is_not_running_vm_vcpu();
105 this->test_vcpu_is_initialized_vm_vcpu();
106 this->test_vcpu_is_not_initialized_vm_vcpu();
108 this->test_vcpu_intel_x64_invalid_id();
109 this->test_vcpu_intel_x64_valid();
110 this->test_vcpu_intel_x64_init_null_params();
111 this->test_vcpu_intel_x64_init_valid_params();
112 this->test_vcpu_intel_x64_init_valid();
113 this->test_vcpu_intel_x64_init_vmcs_throws();
114 this->test_vcpu_intel_x64_fini_null_params();
115 this->test_vcpu_intel_x64_fini_valid_params();
116 this->test_vcpu_intel_x64_fini_valid();
117 this->test_vcpu_intel_x64_fini_no_init();
118 this->test_vcpu_intel_x64_run_launch();
119 this->test_vcpu_intel_x64_run_launch_is_host_vcpu();
120 this->test_vcpu_intel_x64_run_resume();
121 this->test_vcpu_intel_x64_run_no_init();
122 this->test_vcpu_intel_x64_run_vmxon_throws();
123 this->test_vcpu_intel_x64_run_vmcs_throws();
124 this->test_vcpu_intel_x64_hlt_no_init();
125 this->test_vcpu_intel_x64_hlt_no_run();
126 this->test_vcpu_intel_x64_hlt_valid();
127 this->test_vcpu_intel_x64_hlt_valid_is_host_vcpu();
128 this->test_vcpu_intel_x64_hlt_vmxon_throws();
130 this->test_vcpu_manager_create_valid();
131 this->test_vcpu_manager_create_valid_twice_overwrites();
132 this->test_vcpu_manager_create_make_vcpu_returns_null();
133 this->test_vcpu_manager_create_make_vcpu_throws();
134 this->test_vcpu_manager_create_init_throws();
135 this->test_vcpu_manager_delete_valid();
136 this->test_vcpu_manager_delete_valid_twice();
137 this->test_vcpu_manager_delete_no_create();
138 this->test_vcpu_manager_delete_fini_throws();
139 this->test_vcpu_manager_run_valid();
140 this->test_vcpu_manager_run_valid_twice();
141 this->test_vcpu_manager_run_run_throws();
142 this->test_vcpu_manager_run_hlt_throws();
143 this->test_vcpu_manager_run_no_create();
144 this->test_vcpu_manager_hlt_valid();
145 this->test_vcpu_manager_hlt_valid_twice();
146 this->test_vcpu_manager_hlt_hlt_throws();
147 this->test_vcpu_manager_hlt_no_create();
148 this->test_vcpu_manager_write_null();
149 this->test_vcpu_manager_write_hello();
150 this->test_vcpu_manager_write_no_create();
#define expect_exception(f, e)
int main(int argc, char *argv[])
int64_t unsigned long void * data
void uint64_t uint64_t uint64_t *rdx noexcept
#define RUN_ALL_TESTS(ut)
virtual std::unique_ptr< vcpu > make_vcpu(vcpuid::type vcpuid, user_data *data=nullptr)