diff --git a/teeio-validator/include/ide_test.h b/teeio-validator/include/ide_test.h index 531e9f1..26ae2dd 100644 --- a/teeio-validator/include/ide_test.h +++ b/teeio-validator/include/ide_test.h @@ -17,7 +17,7 @@ #define NOT_IMPLEMENTED(msg) \ TEEIO_DEBUG((TEEIO_DEBUG_ERROR, "Not implemented - %s\n", msg)); \ - assert(false) + TEEIO_ASSERT(false) #define MAX_SUPPORTED_PORTS_NUM 16 #define MAX_SUPPORTED_SWITCHES_NUM 16 diff --git a/teeio-validator/teeio_validator/ide_test.c b/teeio-validator/teeio_validator/ide_test.c index 34829eb..a2a76dd 100644 --- a/teeio-validator/teeio_validator/ide_test.c +++ b/teeio-validator/teeio_validator/ide_test.c @@ -269,12 +269,12 @@ bool is_valid_test_case(const char* test_case_name) ide_run_test_suite_t *alloc_run_test_suite(IDE_TEST_SUITE *suite, IDE_TEST_CONFIG *test_config) { ide_run_test_suite_t *rts = (ide_run_test_suite_t *)malloc(sizeof(ide_run_test_suite_t)); - assert(rts != NULL); + TEEIO_ASSERT(rts != NULL); memset(rts, 0, sizeof(ide_run_test_suite_t)); sprintf(rts->name, "TestSuite_%d", suite->id); ide_common_test_suite_context_t *context = (ide_common_test_suite_context_t *)malloc(sizeof(ide_common_test_suite_context_t)); - assert(context); + TEEIO_ASSERT(context); memset(context, 0, sizeof(ide_common_test_suite_context_t)); context->signature = SUITE_CONTEXT_SIGNATURE; @@ -288,11 +288,11 @@ ide_run_test_suite_t *alloc_run_test_suite(IDE_TEST_SUITE *suite, IDE_TEST_CONFI bool alloc_run_test_config(ide_run_test_suite_t *rts, int config_id, IDE_TEST_TOPOLOGY_TYPE top_type) { - assert(top_type < IDE_TEST_TOPOLOGY_TYPE_NUM); - assert(config_id < IDE_TEST_CONFIGURATION_TYPE_NUM); + TEEIO_ASSERT(top_type < IDE_TEST_TOPOLOGY_TYPE_NUM); + TEEIO_ASSERT(config_id < IDE_TEST_CONFIGURATION_TYPE_NUM); ide_run_test_config_t *run_test_config = (ide_run_test_config_t *)malloc(sizeof(ide_run_test_config_t)); - assert(run_test_config); + TEEIO_ASSERT(run_test_config); memset(run_test_config, 0, sizeof(ide_run_test_config_t)); ide_test_config_funcs_t *config_func = &m_config_funcs[top_type][config_id]; @@ -305,7 +305,7 @@ bool alloc_run_test_config(ide_run_test_suite_t *rts, int config_id, IDE_TEST_TO // assign test_config_context ide_common_test_config_context_t *context = (ide_common_test_config_context_t *)malloc(sizeof(ide_common_test_config_context_t)); - assert(context); + TEEIO_ASSERT(context); memset(context, 0, sizeof(ide_common_test_config_context_t)); context->group_context = NULL; // this is assigned in run-time context->suite_context = rts->test_context; @@ -341,15 +341,15 @@ bool alloc_run_test_config(ide_run_test_suite_t *rts, int config_id, IDE_TEST_TO bool alloc_run_test_configs(ide_run_test_suite_t *rts, IDE_TEST_CONFIG *test_config, int top_id, int config_id) { IDE_TEST_CONFIGURATION *configuration = get_configuration_by_id(test_config, config_id); - assert(configuration); - assert(configuration->enabled); - assert(configuration->bit_map != 0); - assert(configuration->type < IDE_TEST_TOPOLOGY_TYPE_NUM); + TEEIO_ASSERT(configuration); + TEEIO_ASSERT(configuration->enabled); + TEEIO_ASSERT(configuration->bit_map != 0); + TEEIO_ASSERT(configuration->type < IDE_TEST_TOPOLOGY_TYPE_NUM); IDE_TEST_TOPOLOGY *top = get_topology_by_id(test_config, top_id); - assert(top); - assert(top->enabled); - assert(top->type == configuration->type); + TEEIO_ASSERT(top); + TEEIO_ASSERT(top->enabled); + TEEIO_ASSERT(top->type == configuration->type); uint32_t config_bitmask = m_top_config_bitmasks[configuration->type]; @@ -370,14 +370,14 @@ ide_common_test_switch_internal_conn_context_t* alloc_switch_internal_conn_conte while(conn != NULL) { conn_context = (ide_common_test_switch_internal_conn_context_t*)malloc(sizeof(ide_common_test_switch_internal_conn_context_t)); - assert(conn_context); + TEEIO_ASSERT(conn_context); memset(conn_context, 0, sizeof(ide_common_test_switch_internal_conn_context_t)); IDE_SWITCH* sw = get_switch_by_id(test_config, conn->switch_id); - assert(sw); + TEEIO_ASSERT(sw); IDE_PORT* ups_port = get_port_from_switch_by_id(sw, conn->ups_port); IDE_PORT* dps_port = get_port_from_switch_by_id(sw, conn->dps_port); - assert(ups_port && dps_port); + TEEIO_ASSERT(ups_port && dps_port); conn_context->switch_id = conn->switch_id; conn_context->ups.port = ups_port; @@ -404,19 +404,19 @@ ide_common_test_switch_internal_conn_context_t* alloc_switch_internal_conn_conte ide_run_test_group_t *alloc_run_test_group(ide_run_test_suite_t *rts, IDE_TEST_CONFIG *test_config, int top_id) { ide_run_test_group_t *run_test_group = (ide_run_test_group_t *)malloc(sizeof(ide_run_test_group_t)); - assert(run_test_group); + TEEIO_ASSERT(run_test_group); memset(run_test_group, 0, sizeof(ide_run_test_group_t)); IDE_TEST_TOPOLOGY *top = get_topology_by_id(test_config, top_id); - assert(top != NULL); - assert(top->type < IDE_TEST_TOPOLOGY_TYPE_NUM); + TEEIO_ASSERT(top != NULL); + TEEIO_ASSERT(top->type < IDE_TEST_TOPOLOGY_TYPE_NUM); IDE_PORT *root_port = get_port_by_id(test_config, top->root_port); IDE_PORT *upper_port = get_port_by_id(test_config, top->upper_port); IDE_PORT *lower_port = get_port_by_id(test_config, top->lower_port); - assert(root_port != NULL); - assert(upper_port != NULL); - assert(lower_port != NULL); + TEEIO_ASSERT(root_port != NULL); + TEEIO_ASSERT(upper_port != NULL); + TEEIO_ASSERT(lower_port != NULL); sprintf(run_test_group->name, "%s", m_ide_test_topology_name[top->type]); @@ -425,7 +425,7 @@ ide_run_test_group_t *alloc_run_test_group(ide_run_test_suite_t *rts, IDE_TEST_C run_test_group->teardown_func = group_funcs->teardown; ide_common_test_group_context_t *context = (ide_common_test_group_context_t *)malloc(sizeof(ide_common_test_group_context_t)); - assert(context); + TEEIO_ASSERT(context); memset(context, 0, sizeof(ide_common_test_group_context_t)); context->signature = GROUP_CONTEXT_SIGNATURE; @@ -468,11 +468,11 @@ ide_run_test_group_t *alloc_run_test_group(ide_run_test_suite_t *rts, IDE_TEST_C */ bool alloc_run_test_case(ide_run_test_group_t *run_test_group, IDE_COMMON_TEST_CASE test_case, uint32_t case_id) { - assert(test_case < IDE_COMMON_TEST_CASE_NUM); - assert(case_id <= MAX_CASE_ID); + TEEIO_ASSERT(test_case < IDE_COMMON_TEST_CASE_NUM); + TEEIO_ASSERT(case_id <= MAX_CASE_ID); ide_run_test_case_t *run_test_case = (ide_run_test_case_t *)malloc(sizeof(ide_run_test_case_t)); - assert(run_test_case != NULL); + TEEIO_ASSERT(run_test_case != NULL); memset(run_test_case, 0, sizeof(ide_run_test_case_t)); strncpy(run_test_case->class, m_ide_test_case_name[(int)test_case], MAX_NAME_LENGTH); @@ -486,7 +486,7 @@ bool alloc_run_test_case(ide_run_test_group_t *run_test_group, IDE_COMMON_TEST_C run_test_case->complete_ide_stream = case_funcs->complete_ide_stream; ide_common_test_case_context_t* context = (ide_common_test_case_context_t *)malloc(sizeof(ide_common_test_case_context_t)); - assert(context); + TEEIO_ASSERT(context); memset(context, 0, sizeof(ide_common_test_case_context_t)); context->group_context = run_test_group->test_context; @@ -525,7 +525,7 @@ bool alloc_run_test_cases( } run_test_group = alloc_run_test_group(run_test_suite, test_config, top->id); - assert(run_test_group); + TEEIO_ASSERT(run_test_group); for (int j = 0; j < tc->cases_cnt; j++) { @@ -560,13 +560,13 @@ ide_run_test_suite_t *prepare_tests_data(IDE_TEST_CONFIG *test_config) } run_test_suite = alloc_run_test_suite(suite, test_config); - assert(run_test_suite); + TEEIO_ASSERT(run_test_suite); bool ret = alloc_run_test_configs(run_test_suite, test_config, suite->topology_id, suite->configuration_id); - assert(ret); + TEEIO_ASSERT(ret); ret = alloc_run_test_cases(run_test_suite, test_config, suite, top); - assert(ret); + TEEIO_ASSERT(ret); // insert into run_test_suite chain ide_run_test_suite_t *itr = run_test_suite_header; @@ -591,10 +591,10 @@ bool do_run_test_case(ide_run_test_case_t *test_case, ide_run_test_case_result_t { bool ret = true; ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_case->test_context; - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = (ide_common_test_group_context_t *)case_context->group_context; - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); TEEIO_PRINT((" Run %s\n", test_case->name)); @@ -633,7 +633,7 @@ bool do_run_test_case(ide_run_test_case_t *test_case, ide_run_test_case_result_t if(test_case->teardown_func != NULL) { ret = test_case->teardown_func(test_case->test_context); - assert(ret); + TEEIO_ASSERT(ret); } return ret; @@ -642,7 +642,7 @@ bool do_run_test_case(ide_run_test_case_t *test_case, ide_run_test_case_result_t ide_run_test_case_result_t *alloc_run_test_case_result(ide_run_test_group_result_t* group_result, const char* case_name, const char* case_class) { ide_run_test_case_result_t *case_result = (ide_run_test_case_result_t *)malloc(sizeof(ide_run_test_case_result_t)); - assert(case_result); + TEEIO_ASSERT(case_result); memset(case_result, 0, sizeof(ide_run_test_case_result_t)); strncpy(case_result->name, case_name, MAX_NAME_LENGTH); @@ -668,10 +668,10 @@ bool do_run_test_group(ide_run_test_group_t *run_test_group, ide_run_test_config { bool ret = true; ide_common_test_group_context_t *group_context = (ide_common_test_group_context_t *)run_test_group->test_context; - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); ide_common_test_config_context_t *config_context = (ide_common_test_config_context_t *)run_test_config->test_context; - assert(config_context->signature == CONFIG_CONTEXT_SIGNATURE); + TEEIO_ASSERT(config_context->signature == CONFIG_CONTEXT_SIGNATURE); config_context->group_context = group_context; if(run_test_group->test_case == NULL) { @@ -708,7 +708,7 @@ bool do_run_test_group(ide_run_test_group_t *run_test_group, ide_run_test_config // call test_config's enable function ret = run_test_config->enable_func(config_context); - assert(ret); + TEEIO_ASSERT(ret); // run the test_case do_run_test_case(test_case, case_result); @@ -717,7 +717,7 @@ bool do_run_test_group(ide_run_test_group_t *run_test_group, ide_run_test_config // check config ret = run_test_config->check_func(config_context); case_result->config_result = config_context->test_result; - assert(ret); + TEEIO_ASSERT(ret); } // next case @@ -729,7 +729,7 @@ bool do_run_test_group(ide_run_test_group_t *run_test_group, ide_run_test_config if (run_test_group->teardown_func != NULL) { ret = run_test_group->teardown_func(group_context); - assert(ret); + TEEIO_ASSERT(ret); } // config_context is reused between different run_group_test @@ -744,7 +744,7 @@ bool do_run_test_group(ide_run_test_group_t *run_test_group, ide_run_test_config ide_run_test_group_result_t* alloc_run_test_group_result(ide_run_test_group_t *run_test_group, ide_run_test_config_t *run_test_config) { ide_run_test_group_result_t* group_result = (ide_run_test_group_result_t *)malloc(sizeof(ide_run_test_group_result_t)); - assert(group_result); + TEEIO_ASSERT(group_result); memset(group_result, 0, sizeof(ide_run_test_group_result_t)); strncpy(group_result->name, run_test_group->name, MAX_NAME_LENGTH); @@ -778,7 +778,7 @@ bool do_run_test_suite(ide_run_test_suite_t *run_test_suite) { // alloc group_result ide_run_test_group_result_t* group_result = alloc_run_test_group_result(run_test_group, run_test_config); - assert(group_result); + TEEIO_ASSERT(group_result); do_run_test_group(run_test_group, run_test_config, group_result); @@ -810,7 +810,7 @@ bool test_group_cases_statics(ide_run_test_group_result_t *group_result, int *pa } else if(case_result->case_result == IDE_COMMON_TEST_CASE_RESULT_FAILED) { *failed += 1; } else { - assert(false); + TEEIO_ASSERT(false); } case_result = case_result->next; @@ -834,7 +834,7 @@ bool test_suite_cases_statics(ide_run_test_suite_t *run_test_suite, int *passed, while(run_test_config) { ide_common_test_config_context_t *config_context = (ide_common_test_config_context_t *)run_test_config->test_context; - assert(config_context->signature == CONFIG_CONTEXT_SIGNATURE); + TEEIO_ASSERT(config_context->signature == CONFIG_CONTEXT_SIGNATURE); ide_run_test_group_result_t * group_result = run_test_config->group_result; @@ -870,7 +870,7 @@ bool print_test_results(ide_run_test_suite_t *run_test_suite) while(run_test_config) { ide_common_test_config_context_t *config_context = (ide_common_test_config_context_t *)run_test_config->test_context; - assert(config_context->signature == CONFIG_CONTEXT_SIGNATURE); + TEEIO_ASSERT(config_context->signature == CONFIG_CONTEXT_SIGNATURE); ide_run_test_group_result_t * group_result = run_test_config->group_result; while(group_result) { diff --git a/teeio-validator/teeio_validator/pci_ide.c b/teeio-validator/teeio_validator/pci_ide.c index e8f391d..f8b685b 100644 --- a/teeio-validator/teeio_validator/pci_ide.c +++ b/teeio-validator/teeio_validator/pci_ide.c @@ -80,7 +80,7 @@ int open_configuration_space(char *bdf) { if (bdf == NULL) { - assert(false); + TEEIO_ASSERT(false); return -1; } @@ -193,7 +193,7 @@ bool parse_keyp_table(ide_common_test_port_context_t *port_context) if (port_context == NULL || port_context->port->port_type != IDE_PORT_TYPE_ROOTPORT) { - assert(false); + TEEIO_ASSERT(false); return false; } @@ -208,11 +208,11 @@ bool parse_keyp_table(ide_common_test_port_context_t *port_context) } size = lseek(fd, 0x0, SEEK_END); - assert(size <= 4096); + TEEIO_ASSERT(size <= 4096); lseek(fd, 0, SEEK_SET); size_t bytes_read = read(fd, buffer, size); - assert(bytes_read == size); + TEEIO_ASSERT(bytes_read == size); INTEL_KEYP_ACPI *keyp = (INTEL_KEYP_ACPI *)buffer; if (memcmp(keyp->signature, KEYP_SIGNATURE, sizeof(keyp->signature)) != 0) @@ -232,7 +232,7 @@ bool parse_keyp_table(ide_common_test_port_context_t *port_context) while (offset < size) { kcu = (INTEL_KEYP_KEY_CONFIGURATION_UNIT *)(buffer + offset); - assert(offset + kcu->Length <= size); + TEEIO_ASSERT(offset + kcu->Length <= size); if (kcu->ProtocolType != 1) { offset += kcu->Length; @@ -267,7 +267,7 @@ bool parse_keyp_table(ide_common_test_port_context_t *port_context) port_context->mapped_kcbar_addr = map_kcbar_addr(kcbar_addr, &port_context->kcbar_fd); if (port_context->mapped_kcbar_addr == NULL) { - assert(false); + TEEIO_ASSERT(false); return false; } @@ -322,7 +322,7 @@ bool scan_devices(void *test_context) { bool ret = false; ide_common_test_group_context_t *context = (ide_common_test_group_context_t *)test_context; - assert(context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(context->signature == GROUP_CONTEXT_SIGNATURE); IDE_TEST_TOPOLOGY *top = context->top; @@ -350,7 +350,7 @@ bool open_root_port(ide_common_test_port_context_t *port_context) char str[MAX_NAME_LENGTH] = {0}; IDE_PORT *port = port_context->port; - assert(port->port_type == IDE_PORT_TYPE_ROOTPORT); + TEEIO_ASSERT(port->port_type == IDE_PORT_TYPE_ROOTPORT); // open configuration space and get ecap offset int fd = open_configuration_space(port->bdf); @@ -528,7 +528,7 @@ bool find_free_rp_stream_index_and_ide_id(ide_common_test_port_context_t* port_c } if(j == cnt) { // the stream_id in Stream_X must have a corresponding entry in id_maps - assert(false); + TEEIO_ASSERT(false); } else { // check if the stream is in secure state. If not, then this Stream_X can be re-used. if(id_maps[j].state != IDE_STREAM_STATUS_SECURE) { @@ -550,14 +550,14 @@ bool find_free_rp_stream_index_and_ide_id(ide_common_test_port_context_t* port_c TEEIO_DEBUG((TEEIO_DEBUG_INFO, "%d: ide_id=%02x ide_type=%s rp_stream_index=%02x stream_id=%02x state=%d\n", i, id_maps[i].ide_id, m_ide_type_name[id_maps[i].ide_type], id_maps[i].rp_stream_index, id_maps[i].stream_id, id_maps[i].state)); if(rp_or_dev && id_maps[i].ide_id != INVALID_IDE_ID && id_maps[i].rp_stream_index == INVALID_RP_STREAM_INDEX) { - assert(false); + TEEIO_ASSERT(false); } } // now find available ide_id *ide_id = INVALID_IDE_ID; if(ide_type == IDE_TEST_IDE_TYPE_LNK_IDE) { - assert(ide_cap.lnk_ide_supported == 1); + TEEIO_ASSERT(ide_cap.lnk_ide_supported == 1); for(i = 0; i < num_lnk_ide + 1; i++) { if(id_maps[i].ide_id == INVALID_IDE_ID || id_maps[i].state != IDE_STREAM_STATUS_SECURE) { break; @@ -567,7 +567,7 @@ bool find_free_rp_stream_index_and_ide_id(ide_common_test_port_context_t* port_c *ide_id = i; } } else if(ide_type == IDE_TEST_IDE_TYPE_SEL_IDE) { - assert(ide_cap.sel_ide_supported == 1); + TEEIO_ASSERT(ide_cap.sel_ide_supported == 1); for(i = num_lnk_ide; i < cnt; i++) { if(id_maps[i].ide_id == INVALID_IDE_ID || id_maps[i].state != IDE_STREAM_STATUS_SECURE) { break; @@ -677,15 +677,15 @@ bool populate_addr_assoc_reg_block( */ bool init_host_port(ide_common_test_group_context_t *group_context) { - assert(group_context != NULL); - assert(group_context->top != NULL); + TEEIO_ASSERT(group_context != NULL); + TEEIO_ASSERT(group_context->top != NULL); // IDE_TEST_TOPOLOGY_TYPE top_type = group_context->top->type; ide_common_test_port_context_t *port_context = &group_context->upper_port; - assert(port_context != NULL); - assert(port_context->port != NULL); - assert(port_context->port->port_type == IDE_PORT_TYPE_ROOTPORT); - assert(group_context->upper_port.port->id == group_context->root_port.port->id); + TEEIO_ASSERT(port_context != NULL); + TEEIO_ASSERT(port_context->port != NULL); + TEEIO_ASSERT(port_context->port->port_type == IDE_PORT_TYPE_ROOTPORT); + TEEIO_ASSERT(group_context->upper_port.port->id == group_context->root_port.port->id); if(!open_root_port(port_context)) { return false; @@ -777,10 +777,10 @@ bool close_dev_port(ide_common_test_port_context_t *port_context, IDE_TEST_TOPOL bool open_dev_port(ide_common_test_port_context_t *port_context) { - assert(port_context != NULL); + TEEIO_ASSERT(port_context != NULL); IDE_PORT *port = port_context->port; - assert(port != NULL); - assert(port->port_type == IDE_PORT_TYPE_ENDPOINT); + TEEIO_ASSERT(port != NULL); + TEEIO_ASSERT(port->port_type == IDE_PORT_TYPE_ENDPOINT); char str[MAX_NAME_LENGTH] = {0}; @@ -839,12 +839,12 @@ bool open_dev_port(ide_common_test_port_context_t *port_context) */ bool init_dev_port(ide_common_test_group_context_t *group_context) { - assert(group_context != NULL); - assert(group_context->top != NULL); + TEEIO_ASSERT(group_context != NULL); + TEEIO_ASSERT(group_context->top != NULL); IDE_TEST_TOPOLOGY_TYPE top_type = group_context->top->type; ide_common_test_port_context_t *port_context = &group_context->lower_port; - assert(port_context != NULL); + TEEIO_ASSERT(port_context != NULL); if(!open_dev_port(port_context)) { return false; @@ -1106,7 +1106,7 @@ void set_host_ide_key_set( } else { - assert(false); + TEEIO_ASSERT(false); } mmio_write_reg32(ctrl_reg_ptr, stream_txrx_control.raw); } @@ -1171,7 +1171,7 @@ uint32_t read_host_stream_status_in_ecap(int cfg_space_fd, uint32_t ecap_offset, // skip control register offset += 4; } else { - assert(false); + TEEIO_ASSERT(false); } data = device_pci_read_32(offset, cfg_space_fd); diff --git a/teeio-validator/teeio_validator/scan_pci.c b/teeio-validator/teeio_validator/scan_pci.c index f2e4698..f00df8d 100644 --- a/teeio-validator/teeio_validator/scan_pci.c +++ b/teeio-validator/teeio_validator/scan_pci.c @@ -78,7 +78,7 @@ bool scan_rp_switch_internal_port_at_bus(IDE_PORT* port, uint8_t bus, uint8_t* S *SecBus = data32.byte1; *SubBus = data32.byte2; - assert(*SecBus <= *SubBus); + TEEIO_ASSERT(*SecBus <= *SubBus); res = true; @@ -137,7 +137,7 @@ bool scan_endpoint_at_bus(uint8_t bus, IDE_PORT* port) close(fd); } - assert(res); + TEEIO_ASSERT(res); return res; } diff --git a/teeio-validator/teeio_validator/teeio_debug.c b/teeio-validator/teeio_validator/teeio_debug.c index 3b953d5..d4edc35 100644 --- a/teeio-validator/teeio_validator/teeio_debug.c +++ b/teeio-validator/teeio_validator/teeio_debug.c @@ -78,6 +78,6 @@ void teeio_assert(const char *file_name, int line_number, const char *descriptio #endif #endif - assert(false); + TEEIO_ASSERT(false); } #endif /* TEEIO_ASSERT_ENABLE */ \ No newline at end of file diff --git a/teeio-validator/teeio_validator/test_case/test_case_full.c b/teeio-validator/teeio_validator/test_case/test_case_full.c index 4a81e01..17956b5 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_full.c +++ b/teeio-validator/teeio_validator/test_case/test_case_full.c @@ -38,12 +38,12 @@ void enable_host_ide_stream(int cfg_space_fd, uint32_t ecap_offset, TEST_IDE_TYP bool test_full_1_setup(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); ide_common_test_port_context_t* upper_port = &group_context->upper_port; ide_common_test_port_context_t* lower_port = &group_context->lower_port; @@ -58,12 +58,12 @@ bool test_full_1_setup(void *test_context) bool test_full_1_run(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = (ide_common_test_group_context_t *)case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); TEST_IDE_TYPE ide_type = TEST_IDE_TYPE_SEL_IDE; if (group_context->top->type == IDE_TEST_TOPOLOGY_TYPE_LINK_IDE) @@ -167,12 +167,12 @@ bool test_full_teardown_common(void *test_context) { // first diable dev_ide and host_ide ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); ide_common_test_port_context_t* upper_port = &group_context->upper_port; ide_common_test_port_context_t* lower_port = &group_context->lower_port; diff --git a/teeio-validator/teeio_validator/test_case/test_case_keyprog_1.c b/teeio-validator/teeio_validator/test_case/test_case_keyprog_1.c index a73d4ee..4a261b1 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_keyprog_1.c +++ b/teeio-validator/teeio_validator/test_case/test_case_keyprog_1.c @@ -60,14 +60,14 @@ bool test_keyprog_setup_common(void *test_context) libspdm_return_t status; ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); - assert(group_context->spdm_context); - assert(group_context->session_id); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context->spdm_context); + TEEIO_ASSERT(group_context->session_id); // query ide_reg_block_count = PCI_IDE_KM_IDE_REG_BLOCK_SUPPORTED_COUNT; @@ -84,7 +84,7 @@ bool test_keyprog_setup_common(void *test_context) if (LIBSPDM_STATUS_IS_ERROR(status)) { TEEIO_DEBUG((TEEIO_DEBUG_ERROR, "pci_ide_km_query failed with status=0x%x\n", status)); - assert(false); + TEEIO_ASSERT(false); return false; } @@ -188,12 +188,12 @@ bool test_keyprog_1_run(void *test_context) libspdm_return_t status; bool pass = true; ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = (ide_common_test_group_context_t *)case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); uint8_t stream_id = group_context->stream_id; void *doe_context = group_context->doe_context; diff --git a/teeio-validator/teeio_validator/test_case/test_case_keyprog_2.c b/teeio-validator/teeio_validator/test_case/test_case_keyprog_2.c index bd7ce52..59732c4 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_keyprog_2.c +++ b/teeio-validator/teeio_validator/test_case/test_case_keyprog_2.c @@ -123,12 +123,12 @@ bool test_keyprog_2_run(void *test_context) bool status; bool pass = true; ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = (ide_common_test_group_context_t *)case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); uint8_t stream_id = group_context->stream_id; void *doe_context = group_context->doe_context; diff --git a/teeio-validator/teeio_validator/test_case/test_case_keyprog_3.c b/teeio-validator/teeio_validator/test_case/test_case_keyprog_3.c index 0ca8c98..290f5fd 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_keyprog_3.c +++ b/teeio-validator/teeio_validator/test_case/test_case_keyprog_3.c @@ -119,14 +119,14 @@ libspdm_return_t test_ide_km_key_prog_case3(const void *pci_doe_context, bool test_keyprog_3_setup(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); - assert(group_context->spdm_context); - assert(group_context->session_id); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context->spdm_context); + TEEIO_ASSERT(group_context->session_id); bool res = test_keyprog_setup_common(test_context); if(res) { @@ -144,12 +144,12 @@ bool test_keyprog_3_run(void *test_context) bool status; bool pass = true; ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = (ide_common_test_group_context_t *)case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); uint8_t stream_id = group_context->stream_id; void *doe_context = group_context->doe_context; diff --git a/teeio-validator/teeio_validator/test_case/test_case_keyprog_4.c b/teeio-validator/teeio_validator/test_case/test_case_keyprog_4.c index 378652f..c0f598a 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_keyprog_4.c +++ b/teeio-validator/teeio_validator/test_case/test_case_keyprog_4.c @@ -125,12 +125,12 @@ bool test_keyprog_4_run(void *test_context) bool status; bool pass = true; ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = (ide_common_test_group_context_t *)case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); uint8_t stream_id = group_context->stream_id; void *doe_context = group_context->doe_context; diff --git a/teeio-validator/teeio_validator/test_case/test_case_keyprog_5.c b/teeio-validator/teeio_validator/test_case/test_case_keyprog_5.c index 78b3120..14fc387 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_keyprog_5.c +++ b/teeio-validator/teeio_validator/test_case/test_case_keyprog_5.c @@ -125,12 +125,12 @@ bool test_keyprog_5_run(void *test_context) bool status; bool pass = true; ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = (ide_common_test_group_context_t *)case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); uint8_t stream_id = group_context->stream_id; void *doe_context = group_context->doe_context; diff --git a/teeio-validator/teeio_validator/test_case/test_case_keyprog_6.c b/teeio-validator/teeio_validator/test_case/test_case_keyprog_6.c index 5f66095..99d7277 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_keyprog_6.c +++ b/teeio-validator/teeio_validator/test_case/test_case_keyprog_6.c @@ -125,12 +125,12 @@ bool test_keyprog_6_run(void *test_context) bool status; bool pass = true; ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = (ide_common_test_group_context_t *)case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); uint8_t stream_id = group_context->stream_id; void *doe_context = group_context->doe_context; diff --git a/teeio-validator/teeio_validator/test_case/test_case_ksetgo_1.c b/teeio-validator/teeio_validator/test_case/test_case_ksetgo_1.c index 12745e3..e63b22e 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_ksetgo_1.c +++ b/teeio-validator/teeio_validator/test_case/test_case_ksetgo_1.c @@ -152,7 +152,7 @@ bool test_ksetgo_setup_common( if (LIBSPDM_STATUS_IS_ERROR(status)) { TEEIO_DEBUG((TEEIO_DEBUG_ERROR, "pci_ide_km_query failed with status=0x%x\n", status)); - assert(false); + TEEIO_ASSERT(false); return false; } @@ -165,7 +165,7 @@ bool test_ksetgo_setup_common( kcbar_addr, k_set, rp_stream_index); - assert(result); + TEEIO_ASSERT(result); result = ide_km_key_prog( doe_context, spdm_context, @@ -175,7 +175,7 @@ bool test_ksetgo_setup_common( kcbar_addr, k_set, rp_stream_index); - assert(result); + TEEIO_ASSERT(result); result = ide_km_key_prog( doe_context, spdm_context, @@ -185,7 +185,7 @@ bool test_ksetgo_setup_common( kcbar_addr, k_set, rp_stream_index); - assert(result); + TEEIO_ASSERT(result); prime_host_ide_keys( (INTEL_KEYP_ROOT_COMPLEX_KCBAR *)kcbar_addr, @@ -201,7 +201,7 @@ bool test_ksetgo_setup_common( kcbar_addr, k_set, rp_stream_index); - assert(result); + TEEIO_ASSERT(result); result = ide_km_key_prog( doe_context, spdm_context, @@ -211,7 +211,7 @@ bool test_ksetgo_setup_common( kcbar_addr, k_set, rp_stream_index); - assert(result); + TEEIO_ASSERT(result); result = ide_km_key_prog( doe_context, spdm_context, @@ -221,7 +221,7 @@ bool test_ksetgo_setup_common( kcbar_addr, k_set, rp_stream_index); - assert(result); + TEEIO_ASSERT(result); prime_host_ide_keys( (INTEL_KEYP_ROOT_COMPLEX_KCBAR *)kcbar_addr, @@ -236,14 +236,14 @@ bool test_ksetgo_setup_common( bool test_ksetgo_1_setup(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); - assert(group_context->spdm_context); - assert(group_context->session_id); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context->spdm_context); + TEEIO_ASSERT(group_context->session_id); return test_ksetgo_setup_common(group_context->doe_context, group_context->spdm_context, &group_context->session_id, group_context->upper_port.mapped_kcbar_addr, group_context->stream_id, group_context->rp_stream_index, @@ -256,12 +256,12 @@ bool test_ksetgo_1_run(void *test_context) bool res = false; ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = (ide_common_test_group_context_t *)case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); uint8_t stream_id = group_context->stream_id; void *doe_context = group_context->doe_context; diff --git a/teeio-validator/teeio_validator/test_case/test_case_ksetgo_2.c b/teeio-validator/teeio_validator/test_case/test_case_ksetgo_2.c index 793b54e..3634a63 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_ksetgo_2.c +++ b/teeio-validator/teeio_validator/test_case/test_case_ksetgo_2.c @@ -44,14 +44,14 @@ libspdm_return_t test_ide_km_key_set_go(const void *pci_doe_context, bool test_ksetgo_2_setup(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); - assert(group_context->spdm_context); - assert(group_context->session_id); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context->spdm_context); + TEEIO_ASSERT(group_context->session_id); return test_ksetgo_setup_common(group_context->doe_context, group_context->spdm_context, &group_context->session_id, group_context->upper_port.mapped_kcbar_addr, group_context->stream_id, group_context->rp_stream_index, @@ -64,12 +64,12 @@ bool test_ksetgo_2_run(void *test_context) bool res = false; ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = (ide_common_test_group_context_t *)case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); uint8_t stream_id = group_context->stream_id; void *doe_context = group_context->doe_context; diff --git a/teeio-validator/teeio_validator/test_case/test_case_ksetgo_3.c b/teeio-validator/teeio_validator/test_case/test_case_ksetgo_3.c index 2da2cd6..c43aa65 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_ksetgo_3.c +++ b/teeio-validator/teeio_validator/test_case/test_case_ksetgo_3.c @@ -62,12 +62,12 @@ bool pre_alloc_slot_ids(uint8_t rp_stream_index, ide_key_set_t* k_set, uint8_t n bool test_ksetgo_3_setup(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); ide_common_test_port_context_t* upper_port = &group_context->upper_port; ide_common_test_port_context_t* lower_port = &group_context->lower_port; @@ -270,12 +270,12 @@ bool test_ksetgo_3_run(void *test_context) bool res = false; ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = (ide_common_test_group_context_t *)case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); uint8_t stream_id = group_context->stream_id; void *doe_context = group_context->doe_context; diff --git a/teeio-validator/teeio_validator/test_case/test_case_ksetgo_4.c b/teeio-validator/teeio_validator/test_case/test_case_ksetgo_4.c index 36b9d7f..438fbb5 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_ksetgo_4.c +++ b/teeio-validator/teeio_validator/test_case/test_case_ksetgo_4.c @@ -61,12 +61,12 @@ libspdm_return_t test_ide_km_key_set_go(const void *pci_doe_context, bool test_ksetgo_4_setup(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); ide_common_test_port_context_t* upper_port = &group_context->upper_port; ide_common_test_port_context_t* lower_port = &group_context->lower_port; @@ -268,12 +268,12 @@ bool test_ksetgo_4_run(void *test_context) bool res = false; ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = (ide_common_test_group_context_t *)case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); uint8_t stream_id = group_context->stream_id; void *doe_context = group_context->doe_context; diff --git a/teeio-validator/teeio_validator/test_case/test_case_ksetstop_1.c b/teeio-validator/teeio_validator/test_case/test_case_ksetstop_1.c index a688844..d54e094 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_ksetstop_1.c +++ b/teeio-validator/teeio_validator/test_case/test_case_ksetstop_1.c @@ -114,12 +114,12 @@ bool test_pci_ide_km_key_set_stop(const void *pci_doe_context, bool test_ksetstop_1_setup(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); ide_common_test_port_context_t* upper_port = &group_context->upper_port; ide_common_test_port_context_t* lower_port = &group_context->lower_port; @@ -135,12 +135,12 @@ bool test_ksetstop_1_run(void *test_context) { // first diable dev_ide and host_ide ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); ide_common_test_port_context_t* upper_port = &group_context->upper_port; ide_common_test_port_context_t* lower_port = &group_context->lower_port; diff --git a/teeio-validator/teeio_validator/test_case/test_case_ksetstop_2.c b/teeio-validator/teeio_validator/test_case/test_case_ksetstop_2.c index baa9ffa..3ac0c20 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_ksetstop_2.c +++ b/teeio-validator/teeio_validator/test_case/test_case_ksetstop_2.c @@ -7,7 +7,6 @@ #include #include -#include "assert.h" #include "hal/base.h" #include "hal/library/debuglib.h" #include "hal/library/platform_lib.h" @@ -41,12 +40,12 @@ bool test_pci_ide_km_key_set_stop(const void *pci_doe_context, bool test_ksetstop_2_setup(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); ide_common_test_port_context_t* upper_port = &group_context->upper_port; ide_common_test_port_context_t* lower_port = &group_context->lower_port; @@ -62,12 +61,12 @@ bool test_ksetstop_2_run(void *test_context) { // first diable dev_ide and host_ide ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); ide_common_test_port_context_t* upper_port = &group_context->upper_port; ide_common_test_port_context_t* lower_port = &group_context->lower_port; diff --git a/teeio-validator/teeio_validator/test_case/test_case_ksetstop_3.c b/teeio-validator/teeio_validator/test_case/test_case_ksetstop_3.c index 2030bf8..76dcdc8 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_ksetstop_3.c +++ b/teeio-validator/teeio_validator/test_case/test_case_ksetstop_3.c @@ -7,7 +7,6 @@ #include #include -#include "assert.h" #include "hal/base.h" #include "hal/library/debuglib.h" #include "hal/library/platform_lib.h" @@ -48,12 +47,12 @@ bool pre_alloc_slot_ids(uint8_t rp_stream_index, ide_key_set_t* k_set, uint8_t n bool test_ksetstop_3_setup(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); ide_common_test_port_context_t* upper_port = &group_context->upper_port; ide_common_test_port_context_t* lower_port = &group_context->lower_port; @@ -85,12 +84,12 @@ bool test_ksetstop_3_setup(void *test_context) bool test_ksetstop_3_run(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); ide_common_test_port_context_t* upper_port = &group_context->upper_port; ide_common_test_port_context_t* lower_port = &group_context->lower_port; diff --git a/teeio-validator/teeio_validator/test_case/test_case_ksetstop_4.c b/teeio-validator/teeio_validator/test_case/test_case_ksetstop_4.c index ff1b32e..cad1e4a 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_ksetstop_4.c +++ b/teeio-validator/teeio_validator/test_case/test_case_ksetstop_4.c @@ -7,7 +7,6 @@ #include #include -#include "assert.h" #include "hal/base.h" #include "hal/library/debuglib.h" #include "hal/library/platform_lib.h" @@ -48,12 +47,12 @@ bool pre_alloc_slot_ids(uint8_t rp_stream_index, ide_key_set_t* k_set, uint8_t n bool test_ksetstop_4_setup(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); ide_common_test_port_context_t* upper_port = &group_context->upper_port; ide_common_test_port_context_t* lower_port = &group_context->lower_port; @@ -87,12 +86,12 @@ bool test_ksetstop_4_setup(void *test_context) bool test_ksetstop_4_run(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); ide_common_test_port_context_t* upper_port = &group_context->upper_port; ide_common_test_port_context_t* lower_port = &group_context->lower_port; diff --git a/teeio-validator/teeio_validator/test_case/test_case_query.c b/teeio-validator/teeio_validator/test_case/test_case_query.c index 40371dd..1faf95c 100644 --- a/teeio-validator/teeio_validator/test_case/test_case_query.c +++ b/teeio-validator/teeio_validator/test_case/test_case_query.c @@ -7,7 +7,6 @@ #include #include -#include "assert.h" #include "hal/base.h" #include "hal/library/debuglib.h" #include "hal/library/platform_lib.h" @@ -174,14 +173,14 @@ bool test_query_1_setup(void *test_context) bool test_query_1_run(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); - assert(group_context->spdm_context); - assert(group_context->session_id); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context->spdm_context); + TEEIO_ASSERT(group_context->session_id); uint8_t port_index = 0; uint8_t dev_func = ((group_context->lower_port.port->device & 0x1f) << 3) | (group_context->lower_port.port->function & 0x7); @@ -212,14 +211,14 @@ bool test_query_1_teardown(void *test_context) bool test_query_2_setup(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); - assert(group_context->spdm_context); - assert(group_context->session_id); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context->spdm_context); + TEEIO_ASSERT(group_context->session_id); uint8_t port_index = 0; uint8_t dev_func = ((group_context->lower_port.port->device & 0x1f) << 3) | (group_context->lower_port.port->function & 0x7); @@ -254,14 +253,14 @@ bool test_query_2_setup(void *test_context) bool test_query_2_run(void *test_context) { ide_common_test_case_context_t *case_context = (ide_common_test_case_context_t *)test_context; - assert(case_context); - assert(case_context->signature == CASE_CONTEXT_SIGNATURE); + TEEIO_ASSERT(case_context); + TEEIO_ASSERT(case_context->signature == CASE_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = case_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); - assert(group_context->spdm_context); - assert(group_context->session_id); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context->spdm_context); + TEEIO_ASSERT(group_context->session_id); uint8_t port_index = mMaxPortIndex; uint8_t dev_func = ((group_context->lower_port.port->device & 0x1f) << 3) | (group_context->lower_port.port->function & 0x7); diff --git a/teeio-validator/teeio_validator/test_config/test_config_common.c b/teeio-validator/teeio_validator/test_config/test_config_common.c index d1cd027..9db6c72 100644 --- a/teeio-validator/teeio_validator/test_config/test_config_common.c +++ b/teeio-validator/teeio_validator/test_config/test_config_common.c @@ -9,7 +9,6 @@ #include #include -#include "assert.h" #include "hal/base.h" #include "hal/library/debuglib.h" #include "hal/library/platform_lib.h" @@ -46,11 +45,11 @@ typedef enum bool test_config_check_common(void *test_context, const char* assertion_msg) { ide_common_test_config_context_t *config_context = (ide_common_test_config_context_t *)test_context; - assert(config_context->signature == CONFIG_CONTEXT_SIGNATURE); + TEEIO_ASSERT(config_context->signature == CONFIG_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = (ide_common_test_group_context_t *)config_context->group_context; - assert(group_context); - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); ide_common_test_port_context_t *port = &group_context->upper_port; TEST_IDE_TYPE ide_type = TEST_IDE_TYPE_SEL_IDE; @@ -136,7 +135,7 @@ static bool test_config_reset_ide_registers(ide_common_test_group_context_t *gro true); if (!res) { - assert(false); + TEEIO_ASSERT(false); return false; } @@ -147,7 +146,7 @@ static bool test_config_reset_ide_registers(ide_common_test_group_context_t *gro false); if (!res) { - assert(false); + TEEIO_ASSERT(false); return false; } @@ -158,16 +157,16 @@ bool test_config_enable_common(void *test_context) { bool res = true; ide_common_test_config_context_t *config_context = (ide_common_test_config_context_t *)test_context; - assert(config_context->signature == CONFIG_CONTEXT_SIGNATURE); + TEEIO_ASSERT(config_context->signature == CONFIG_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = config_context->group_context; - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); // if connection is via switch or P2P, then we shall set ft_supported in the switch's port ide_common_test_switch_internal_conn_context_t* conn; if(group_context->top->connection == IDE_TEST_CONNECT_SWITCH || group_context->top->connection == IDE_TEST_CONNECT_P2P) { conn = group_context->sw_conn1; - assert(conn); + TEEIO_ASSERT(conn); res = true; @@ -182,7 +181,7 @@ bool test_config_enable_common(void *test_context) if(group_context->top->connection == IDE_TEST_CONNECT_P2P) { conn = group_context->sw_conn2; - assert(conn); + TEEIO_ASSERT(conn); res = true; while(res && conn) { res = set_ft_supported_in_switch(conn->dps.port->bdf) && set_ft_supported_in_switch(conn->ups.port->bdf); @@ -243,10 +242,10 @@ bool check_ft_supported_in_switch_port(char* bdf) bool test_config_support_common(void *test_context) { ide_common_test_config_context_t *config_context = (ide_common_test_config_context_t *)test_context; - assert(config_context->signature == CONFIG_CONTEXT_SIGNATURE); + TEEIO_ASSERT(config_context->signature == CONFIG_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = config_context->group_context; - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); PCIE_IDE_CAP *host_cap = &group_context->upper_port.ide_cap; PCIE_IDE_CAP *dev_cap = &group_context->lower_port.ide_cap; @@ -268,7 +267,7 @@ bool test_config_support_common(void *test_context) ide_common_test_switch_internal_conn_context_t* conn; if(group_context->top->connection == IDE_TEST_CONNECT_SWITCH || group_context->top->connection == IDE_TEST_CONNECT_P2P) { conn = group_context->sw_conn1; - assert(conn); + TEEIO_ASSERT(conn); supported = true; while(conn) { @@ -291,7 +290,7 @@ bool test_config_support_common(void *test_context) if(group_context->top->connection == IDE_TEST_CONNECT_P2P) { conn = group_context->sw_conn2;; - assert(conn); + TEEIO_ASSERT(conn); supported = true; while(conn) { diff --git a/teeio-validator/teeio_validator/test_config/test_config_default.c b/teeio-validator/teeio_validator/test_config/test_config_default.c index b5e396a..e634a64 100644 --- a/teeio-validator/teeio_validator/test_config/test_config_default.c +++ b/teeio-validator/teeio_validator/test_config/test_config_default.c @@ -7,7 +7,6 @@ #include #include -#include "assert.h" #include "hal/base.h" #include "hal/library/debuglib.h" #include "hal/library/platform_lib.h" diff --git a/teeio-validator/teeio_validator/test_config/test_config_pcrc.c b/teeio-validator/teeio_validator/test_config/test_config_pcrc.c index 097b02c..5a59772 100644 --- a/teeio-validator/teeio_validator/test_config/test_config_pcrc.c +++ b/teeio-validator/teeio_validator/test_config/test_config_pcrc.c @@ -7,7 +7,6 @@ #include #include -#include "assert.h" #include "hal/base.h" #include "hal/library/debuglib.h" #include "hal/library/platform_lib.h" @@ -28,10 +27,10 @@ bool test_config_support_common(void *test_context); static bool test_config_set_pcrc_common(void *test_context, bool enable) { ide_common_test_config_context_t *config_context = (ide_common_test_config_context_t *)test_context; - assert(config_context->signature == CONFIG_CONTEXT_SIGNATURE); + TEEIO_ASSERT(config_context->signature == CONFIG_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = config_context->group_context; - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); // enable pcrc bit in TEST_IDE_TYPE ide_type = TEST_IDE_TYPE_SEL_IDE; @@ -51,10 +50,10 @@ static bool test_config_set_pcrc_common(void *test_context, bool enable) static bool test_config_check_pcrc_support_common(void *test_context) { ide_common_test_config_context_t *config_context = (ide_common_test_config_context_t *)test_context; - assert(config_context->signature == CONFIG_CONTEXT_SIGNATURE); + TEEIO_ASSERT(config_context->signature == CONFIG_CONTEXT_SIGNATURE); ide_common_test_group_context_t *group_context = config_context->group_context; - assert(group_context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(group_context->signature == GROUP_CONTEXT_SIGNATURE); PCIE_IDE_CAP *host_cap = &group_context->upper_port.ide_cap; PCIE_IDE_CAP *dev_cap = &group_context->lower_port.ide_cap; diff --git a/teeio-validator/teeio_validator/test_group/test_group.c b/teeio-validator/teeio_validator/test_group/test_group.c index 3b2569a..ac81d9d 100644 --- a/teeio-validator/teeio_validator/test_group/test_group.c +++ b/teeio-validator/teeio_validator/test_group/test_group.c @@ -9,7 +9,6 @@ #include #include -#include "assert.h" #include "hal/base.h" #include "hal/library/debuglib.h" #include "hal/library/platform_lib.h" @@ -50,7 +49,7 @@ static bool common_test_group_setup(void *test_context) bool ret = false; ide_common_test_group_context_t *context = (ide_common_test_group_context_t *)test_context; - assert(context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(context->signature == GROUP_CONTEXT_SIGNATURE); // first scan devices if(!scan_devices(test_context)) { @@ -83,24 +82,24 @@ static bool common_test_group_setup(void *test_context) libspdm_sleep(1000000); if (is_doe_error_asserted()) { - assert(false); + TEEIO_ASSERT(false); } libspdm_return_t status = pci_doe_init_request(); if (LIBSPDM_STATUS_IS_ERROR(status)) { TEEIO_DEBUG((TEEIO_DEBUG_ERROR, "pci_doe_init_request - %x\n", (uint32_t)status)); - assert(false); + TEEIO_ASSERT(false); } context->doe_context = m_pci_doe_context; // init spdm_context void *spdm_context = spdm_client_init(); - assert(spdm_context != NULL); + TEEIO_ASSERT(spdm_context != NULL); uint32_t session_id = 0; ret = spdm_connect(spdm_context, &session_id); - assert(ret); + TEEIO_ASSERT(ret); context->spdm_context = spdm_context; context->session_id = session_id; @@ -111,7 +110,7 @@ static bool common_test_group_setup(void *test_context) static bool common_test_group_teardown(void *test_context) { ide_common_test_group_context_t *context = (ide_common_test_group_context_t *)test_context; - assert(context->signature == GROUP_CONTEXT_SIGNATURE); + TEEIO_ASSERT(context->signature == GROUP_CONTEXT_SIGNATURE); // close spdm_session and free spdm_context if(context->spdm_context != NULL) { diff --git a/teeio-validator/teeio_validator/tools/ide_common.c b/teeio-validator/teeio_validator/tools/ide_common.c index b10db9f..0151c82 100644 --- a/teeio-validator/teeio_validator/tools/ide_common.c +++ b/teeio-validator/teeio_validator/tools/ide_common.c @@ -4,7 +4,6 @@ * License: BSD 3-Clause License. **/ -#include #include #include #include @@ -25,14 +24,14 @@ ide_common_test_switch_internal_conn_context_t *alloc_switch_internal_conn_conte while (conn != NULL) { conn_context = (ide_common_test_switch_internal_conn_context_t *)malloc(sizeof(ide_common_test_switch_internal_conn_context_t)); - assert(conn_context); + TEEIO_ASSERT(conn_context); memset(conn_context, 0, sizeof(ide_common_test_switch_internal_conn_context_t)); IDE_SWITCH *sw = get_switch_by_id(test_config, conn->switch_id); - assert(sw); + TEEIO_ASSERT(sw); IDE_PORT *ups_port = get_port_from_switch_by_id(sw, conn->ups_port); IDE_PORT *dps_port = get_port_from_switch_by_id(sw, conn->dps_port); - assert(ups_port && dps_port); + TEEIO_ASSERT(ups_port && dps_port); conn_context->switch_id = conn->switch_id; conn_context->ups.port = ups_port; @@ -81,20 +80,20 @@ bool scan_open_devices_in_top(IDE_TEST_CONFIG *test_config, int top_id, DEVCIES_ if (top->connection == IDE_TEST_CONNECT_SWITCH) { // root_port and upper_port are the same - assert(root_port->id == upper_port->id); + TEEIO_ASSERT(root_port->id == upper_port->id); sw_conn1 = alloc_switch_internal_conn_context(test_config, top, top->sw_conn1); } else if (top->connection == IDE_TEST_CONNECT_P2P) { // root_port and upper_port are not the same - assert(root_port->id != upper_port->id); + TEEIO_ASSERT(root_port->id != upper_port->id); sw_conn1 = alloc_switch_internal_conn_context(test_config, top, top->sw_conn1); sw_conn2 = alloc_switch_internal_conn_context(test_config, top, top->sw_conn2); } else if (top->connection == IDE_TEST_CONNECT_DIRECT) { // root_port and upper_port are the same - assert(root_port->id == upper_port->id); + TEEIO_ASSERT(root_port->id == upper_port->id); } // now scan devices @@ -174,7 +173,7 @@ bool scan_open_devices_in_top(IDE_TEST_CONFIG *test_config, int top_id, DEVCIES_ bool read_ide_cap_ctrl_register(IDE_PORT* port, uint32_t *ide_cap, uint32_t *ide_ctrl) { - assert(port); + TEEIO_ASSERT(port); bool ret = false; int fd = open_configuration_space(port->bdf); diff --git a/teeio-validator/teeio_validator/tools/lside.c b/teeio-validator/teeio_validator/tools/lside.c index 9b2283d..cabc20d 100644 --- a/teeio-validator/teeio_validator/tools/lside.c +++ b/teeio-validator/teeio_validator/tools/lside.c @@ -4,7 +4,6 @@ * License: BSD 3-Clause License. **/ -#include #include #include #include diff --git a/teeio-validator/teeio_validator/tools/setide.c b/teeio-validator/teeio_validator/tools/setide.c index f3814e7..adbf17e 100644 --- a/teeio-validator/teeio_validator/tools/setide.c +++ b/teeio-validator/teeio_validator/tools/setide.c @@ -4,7 +4,6 @@ * License: BSD 3-Clause License. **/ -#include #include #include #include @@ -113,7 +112,7 @@ bool parse_cmdline_option(int argc, char *argv[], char *file_name, IDE_TEST_CONF bool clear_ft_supported_in_ide_ctrl(IDE_PORT* port) { - assert(port); + TEEIO_ASSERT(port); bool ret = false; int fd = open_configuration_space(port->bdf);