at_spi2_tool refactor
authorLukasz Wlazly <l.wlazly@partner.samsung.com>
Mon, 23 Jan 2017 15:14:17 +0000 (16:14 +0100)
committerShinwoo Kim <cinoo.kim@samsung.com>
Tue, 28 Mar 2017 06:58:00 +0000 (15:58 +0900)
Change-Id: I4140f479b95a1a5e91be3654f549ee845757db42

test/at_spi2_tool.c

index 594a7c8..743b90c 100644 (file)
@@ -340,7 +340,7 @@ static char *_get_info(AtspiAccessible *node, int length_limit)
                                                _get_object_in_relation(node, ATSPI_RELATION_FLOWS_FROM));
 
        if (ret >= SAFE_BUFFER_SIZE)
-               fprintf(stderr, "\n_get_info: generated string is too long. Buffer overflow\n");
+               fprintf(stderr, "\n%s, %s %s: generated string is too long. Buffer overflow\n", __FILE__, __FUNCTION__, __LINE__);
 
        free(node_name);
        free(node_role_name);
@@ -436,8 +436,10 @@ static void _atspi_tree_traverse(AtspiAccessible *desktop, const char *app_name,
        bool app_name_matched = false;
        for (int i = 0; i < count; i++) {
                AtspiAccessible *child = atspi_accessible_get_child_at_index(desktop, i, NULL);
-               if (child == NULL)
-                       break;
+               if (child == NULL) {
+                       fprintf(stderr, "\n%s, %s %s: Null child occured. Results may be misleading.\n", __FILE__, __FUNCTION__, __LINE__);
+                       continue;
+               }
 
                char *name = atspi_accessible_get_name(child, NULL);