Tests: Fix t_vpi_unimpl exiting early with missed error

This commit is contained in:
Wilson Snyder 2023-07-05 14:12:22 -04:00
parent 6f7bc38088
commit 8182c3fe2c
2 changed files with 7 additions and 24 deletions

View File

@ -98,68 +98,45 @@ int _mon_check_unimpl(p_cb_data cb_data) {
// now exercise unimplemented fns
vpi_get_cb_info(cb, NULL);
CHECK_RESULT(callback_count, 1);
vpi_register_systf(NULL);
CHECK_RESULT(callback_count, 2);
vpi_get_systf_info(NULL, NULL);
CHECK_RESULT(callback_count, 3);
vpi_handle_multi(0, NULL, NULL);
CHECK_RESULT(callback_count, 4);
vpi_get64(0, NULL);
CHECK_RESULT(callback_count, 5);
vpi_get_delays(NULL, NULL);
CHECK_RESULT(callback_count, 6);
vpi_put_delays(NULL, NULL);
CHECK_RESULT(callback_count, 7);
vpi_get_value_array(NULL, NULL, NULL, 0);
CHECK_RESULT(callback_count, 8);
vpi_put_value_array(NULL, NULL, NULL, 0);
CHECK_RESULT(callback_count, 9);
vpi_get_time(NULL, NULL);
CHECK_RESULT(callback_count, 10);
vpi_mcd_name(0);
CHECK_RESULT(callback_count, 11);
vpi_compare_objects(NULL, NULL);
CHECK_RESULT(callback_count, 12);
vpi_get_data(0, NULL, 0);
CHECK_RESULT(callback_count, 13);
vpi_put_data(0, NULL, 0);
CHECK_RESULT(callback_count, 14);
vpi_get_userdata(NULL);
CHECK_RESULT(callback_count, 15);
vpi_put_userdata(NULL, NULL);
CHECK_RESULT(callback_count, 16);
vpi_handle_by_multi_index(NULL, 0, NULL);
CHECK_RESULT(callback_count, 17);
vpi_control(0);
CHECK_RESULT(callback_count, 18);
s_vpi_time time_s;
time_s.type = 0;
vpi_get_time(NULL, &time_s);
CHECK_RESULT(callback_count, 19);
handle = vpi_put_value(NULL, NULL, NULL, 0);
CHECK_RESULT(callback_count, 20);
CHECK_RESULT(handle, 0);
handle = vpi_handle(0, NULL);
CHECK_RESULT(callback_count, 21);
CHECK_RESULT(handle, 0);
vpi_iterate(0, NULL);
CHECK_RESULT(callback_count, 22);
handle = vpi_register_cb(NULL);
CHECK_RESULT(callback_count, 23);
CHECK_RESULT(handle, 0);
s_cb_data cb_data_s;
cb_data_s.reason = 0; // Bad
handle = vpi_register_cb(&cb_data_s);
CHECK_RESULT(callback_count, 24);
CHECK_RESULT(handle, 0);
(void)vpi_get_str(vpiRange, clk_h); // Bad type
CHECK_RESULT(callback_count, 25);
// Supported but illegal tests:
// Various checks that guarded passing NULL handles
@ -171,6 +148,8 @@ int _mon_check_unimpl(p_cb_data cb_data) {
cp = vpi_get_str(vpiType, NULL);
CHECK_RESULT_Z(cp);
vpi_release_handle(NULL);
printf("End of main test\n");
}
return 0; // Ok
}

View File

@ -36,6 +36,10 @@ extern "C" int mon_check();
`else
status = mon_check();
`endif
if (status != 0) begin
$write("%%Error: t_vpi_unimpl.cpp:%0d: C Test failed\n", status);
$stop;
end
$write("*-* All Finished *-*\n");
$finish;
end