2009-27-09 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / tests / dummyatk / useful_functions.h
1 #ifndef USEFUL_FUNCTIONS_H
2 #define USEFUL_FUNCTIONS_H
3 /*
4  * Functions and macros widely used in the tests.
5  */
6  
7 //macro for creating objects in startup section
8 #define OBJECT_NEW(obj, type, type_str) obj = g_object_new(type,NULL);\
9     if(obj == NULL)\
10     {\
11         INIT_FAILED("Cannot create instance of type" type_str ".\n");\
12     }
13 //macro for destroying object 
14 #define OBJECT_UNREF(obj) if(obj != NULL)\
15     {\
16         g_object_unref((gpointer)obj);\
17     }
18 //for testing signals
19 #define HANDLER_DISCONNECT(obj, h) if((h) != 0)\
20         {\
21                 g_signal_handler_disconnect(obj, h);\
22         }
23
24 gboolean my_strcmp(const gchar* str1, const gchar* str2);
25
26 gint my_strlen(const gchar* str);
27
28 gboolean my_strncmp(const gchar* str1, const gchar* str2, gint n);
29
30 #endif /*USEFUL_FUNCTIONS_H*/