Fix make check.
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Fri, 15 Jul 2005 15:55:25 +0000 (15:55 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Fri, 15 Jul 2005 15:55:25 +0000 (15:55 +0000)
git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@760 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
test/test-simple.c

index 3f714b8..2badab7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-07-15  Bill Haneman <bill.haneman@sun.com>
+
+       * tests/test-simple.c: 
+       (key_listener_cb): Ensure that the keystring is dup'ed instead of
+       relying on the old string from the key event hanging around after
+       the event handler returns.  Fixes broken 'make check'.
+       
 2005-06-06  Swapnil Hajare  <dreamil@gmail.com>
 
        * Added Marathi (mr_IN) translations.
index b85e2a9..78527fd 100644 (file)
@@ -691,12 +691,13 @@ key_listener_cb (const AccessibleKeystroke *stroke,
        AccessibleKeystroke *s = user_data;
        
        *s = *stroke;
+       if (stroke->keystring) s->keystring = g_strdup (stroke->keystring);
        
        if (s->type == SPI_KEY_PRESSED)
                key_press_received = TRUE;
        else if (s->type == SPI_KEY_RELEASED)
                key_release_received = TRUE;
-       
+
        return TRUE;
 }
 
@@ -728,11 +729,11 @@ test_keylisteners (void)
                g_assert (SPI_generateKeyboardEvent ('=', NULL, SPI_KEY_SYM));
                while (!(key_press_received))
                        g_main_context_iteration (NULL, TRUE);
-               fprintf (stderr, "p");
+               fprintf (stderr, "p [%s]", stroke.keystring);
                g_assert (!strcmp (stroke.keystring, "="));
                while (!(key_release_received))
                        g_main_context_iteration (NULL, TRUE);
-               fprintf (stderr, "r ");
+               fprintf (stderr, "r [%s]", stroke.keystring);
                key_press_received = FALSE;
                key_release_received = FALSE;
        }