{
AtspiStateSet *node_state_set = atspi_accessible_get_state_set(node);
GArray *states = atspi_state_set_get_states(node_state_set);
+ if (!states) return NULL;
g_array_sort(states, _int_sort_function);
AtspiStateType state_type;
char *state_string = NULL;
- for (int i = 0; states && (i < states->len); i++) {
+ for (int i = 0; i < states->len; i++) {
state_type = g_array_index(states, AtspiStateType, i);
char node_state_str[8];
Box_Size *box_size = _get_box_size(node);
char *states = _get_states(node, length_limit);
+ char *flows_to = _get_object_in_relation(node, ATSPI_RELATION_FLOWS_TO);
+ char *flows_from = _get_object_in_relation(node, ATSPI_RELATION_FLOWS_FROM);
+
char result[SAFE_BUFFER_SIZE];
int ret = snprintf(result, SAFE_BUFFER_SIZE, "[[%s],[%s],[%s],[%s,%s,%s,%s],[%s],[%s],[%s,%s]]",
path,
box_size->height,
node_name,
states,
- _get_object_in_relation(node, ATSPI_RELATION_FLOWS_TO),
- _get_object_in_relation(node, ATSPI_RELATION_FLOWS_FROM));
+ flows_to,
+ flows_from);
if (ret >= SAFE_BUFFER_SIZE)
fprintf(stderr, "\n%s, %s %s: generated string is too long. Buffer overflow\n", __FILE__, __FUNCTION__, __LINE__);
free(node_name);
free(node_role_name);
+ free(path);
free(attributes);
if (box_size) {
free(box_size->width);
free(box_size);
}
free(states);
+ free(flows_to);
+ free(flows_from);
return _strdup(result);
}
else
snprintf(parent_status, NUMBER_WIDTH, "%d", parent_index);
+ char *parent_path = atspi_accessible_get_path(parent, NULL);
+ char *parent_candidate_path = atspi_accessible_get_path(parent_candidate, NULL);
snprintf(output, CHECK_OUTPUT_WIDTH, "[FAIL<%d,%s><%s,%s>]", parent_candidate_index, parent_status,
- atspi_accessible_get_path(parent_candidate, NULL),
- atspi_accessible_get_path(parent, NULL));
+ parent_candidate_path, parent_path);
+ free(parent_path);
+ free(parent_candidate_path);
} else {
snprintf(output, CHECK_OUTPUT_WIDTH, "[OK]");