[LDTP-Dev] [PATCH] fix for bug #317594

Nagappan anagappan at novell.com
Mon Oct 3 22:41:47 PDT 2005


Hi Prem,
    Thinks looks okay. Please check in.

Thanks
Nagappan

jpremkumar wrote:
> Hi Nagappan,
>
> I have attached the modified patch for bug #317594 based on your review
> comments. Please review them.
>
> Thanks
> Premkumar
>
> Index: appmap.c
> ===================================================================
> RCS file: /cvs/pyldtp/appmap.c,v
> retrieving revision 1.12
> diff -u -p -r1.12 appmap.c
> --- appmap.c	23 Sep 2005 18:46:57 -0000	1.12
> +++ appmap.c	4 Oct 2005 12:07:25 -0000
> @@ -90,15 +90,14 @@ void add_child_attributes (char *cur_ent
>  	  key = strtok (strdup (all_attributes), "=");
>  	  while (key)
>  	    {
> -	      // Strip any white spaces
> -	      key = g_strdup (g_strstrip (key));
> +	      char *hash_key;
> +	      char *hash_value;
> +	      hash_key = g_strdup (key);
>  	      value = strtok (NULL, ",");
> -	      if (value)
> -		// Strip any white spaces
> -		value = g_strdup (g_strstrip (value));
> -	      g_print ("%s: %s\n", key, value);
> +	      hash_value = g_strdup (value);
> +	      g_print ("%s: %s\n", hash_key, hash_value);
>  	      if (hash_attributes)
> -		g_hash_table_insert (hash_attributes, key, value);
> +		g_hash_table_insert (hash_attributes, hash_key, hash_value);
>  	      key = strtok (NULL, "=");
>  	    }
>  	  if (component)
>
>
> Index: remap.c
> ===================================================================
> RCS file: /cvs/pyldtp/remap.c,v
> retrieving revision 1.2
> diff -u -p -r1.2 remap.c
> --- remap.c	1 Oct 2005 17:49:52 -0000	1.2
> +++ remap.c	4 Oct 2005 12:07:25 -0000
> @@ -116,8 +116,7 @@ char *strip_delim (char *data, char deli
>   */
>  int filter_appmap_data (Accessible *accessible, OBJECT_INFO *obj_info,
> char *label)
>  {
> -  if (g_strcasecmp (obj_info->object_type, "label") == 0 ||
> -      g_strcasecmp (obj_info->object_type, "separator") == 0 ||
> +  if (g_strcasecmp (obj_info->object_type, "separator") == 0 ||
>        g_strcasecmp (obj_info->object_type, "table_cell") == 0)
>      return 0;
>    if (g_strcasecmp (label, "ukngrip") == 0)
> @@ -235,6 +234,21 @@ char *add_appmap_data (Accessible *acces
>    g_free (label);
>    label = g_strdup (accessible_name);
>    SPI_freeString (accessible_name);
> +  /*
> +   * Following code is for limiting appmap from generating label
> +   * with value as string made of only space characters
> +   */
> +  if (strchr (label, ' '))
> +    {
> +      char *stripped_data = NULL;
> +      stripped_data = strip_white_space (label);
> +      if (g_ascii_strcasecmp (stripped_data, "") == 0)
> +        {
> +         g_free (label);
> +         label = g_strdup (stripped_data);
> +        }
> +      g_free (stripped_data);
> +    }
>  
>    if (filter_appmap_data (accessible, cur_obj_info, name))
>      {
> @@ -251,15 +265,6 @@ char *add_appmap_data (Accessible *acces
>  	    {
>  	      if (label_by)
>  		{
> -		  char *tmp;
> -		  if (strstr (label_by, ":"))
> -		    {
> -		      tmp = strip_delim (label_by, ':');
> -		      g_free (label_by);
> -		      label_by = g_strdup (tmp);
> -		      g_free (tmp);
> -		      tmp = NULL;
> -		    }
>  		  g_hash_table_insert (hash_attributes, g_strdup ("label_by"),
> g_strdup (label_by));
>  		  g_free (label_by);
>  		}
>
> Index: gui.c
> ===================================================================
> RCS file: /cvs/pyldtp/gui.c,v
> retrieving revision 1.50
> diff -u -p -r1.50 gui.c
> --- gui.c	27 Sep 2005 11:20:26 -0000	1.50
> +++ gui.c	4 Oct 2005 12:07:25 -0000
> @@ -444,7 +444,8 @@ int is_object_matching (Accessible *obje
>    char *accessible_label;
>    char *hash_label;
>    /*
> -   * NOTE: Checking if the obtained object is the required one with
> respect to label only
> +   * NOTE: Checking if the obtained object is the required one 
> +   * with respect to label/label_by only
>     */
>    hash_label = g_hash_table_lookup (comp_attributes, "label");
>    if (hash_label)
> @@ -468,18 +469,9 @@ int is_object_matching (Accessible *obje
>        hash_label = g_hash_table_lookup (comp_attributes, "label_by");
>        if (hash_label)
>  	{
> -	  char *tmp;
>  	  accessible_label = get_relation_name (object);
>  	  if (accessible_label)
>  	    {
> -	      if (strstr (accessible_label, ":"))
> -		{
> -		  tmp = strip_delim (accessible_label, ':');
> -		  g_free (accessible_label);
> -		  accessible_label = g_strdup (tmp);
> -		  g_free (tmp);
> -		  tmp = NULL;
> -		}
>  	      if (g_strcasecmp (accessible_label, hash_label) == 0)
>  		{
>  		  g_free (accessible_label);
>
> Index: appmap-gen.c
> ===================================================================
> RCS file: /cvs/appmap/appmap-gen.c,v
> retrieving revision 1.14
> diff -u -p -r1.14 appmap-gen.c
> --- appmap-gen.c	1 Oct 2005 17:26:22 -0000	1.14
> +++ appmap-gen.c	4 Oct 2005 12:06:34 -0000
> @@ -362,7 +362,11 @@ char *add_appmap_data (FILE *fp, Accessi
>    g_free (label);
>    label = g_strdup (accessible_name);
>    SPI_freeString (accessible_name);
> -  if (strstr (label, " "))
> +  /*
> +   * Following code is for limiting appmap from generating
> +   * label with value as string made of only space character
> +   */
> +  if (strchr (label, ' '))
>      {
>        char *stripped_data = NULL;
>        stripped_data = strip_white_space (label);
> @@ -370,9 +374,7 @@ char *add_appmap_data (FILE *fp, Accessi
>  	{
>  	  g_free (label);
>  	  label = g_strdup (stripped_data);
> -	  g_free (stripped_data);
>  	}
> -      else
>  	g_free (stripped_data);
>      }
>  
> @@ -385,15 +387,6 @@ char *add_appmap_data (FILE *fp, Accessi
>  					     cur_obj_info->object_type, parent_name, child_index);
>  	  else
>  	    {
> -	      char *tmp;
> -	      if (strstr (label_by, ":"))
> -		{
> -		  tmp = strip_delim (label_by, ':');
> -		  g_free (label_by);
> -		  label_by = g_strdup (tmp);
> -		  g_free (tmp);
> -		  value = NULL;
> -		}
>  	      object_record = g_strdup_printf ("%s={class=%s,parent=%
> s,child_index=%d,label_by=%s}\n", name, 
>  					       cur_obj_info->object_type, parent_name, child_index,
> label_by);
>  	      g_free (label_by);
>   
-- 
Nagappan A <anagappan at novell.com>
Novell Software Development (I) Pvt. Ltd.
Linux Desktop Testing Project - http://gnomebangalore.org/ldtp/index.php/Main_Page
http://nagappanal.blogspot.com/



More information about the Ldtp-dev mailing list