1 #ifndef USEFUL_FUNCTIONS_H
2 #define USEFUL_FUNCTIONS_H
4 * Functions and macros widely used in the tests.
7 //macro for creating objects in startup section
8 #define OBJECT_NEW(obj, type, type_str) obj = g_object_new(type,NULL);\
11 INIT_FAILED("Cannot create instance of type" type_str ".\n");\
13 //macro for destroying object
14 #define OBJECT_UNREF(obj) if(obj != NULL)\
16 g_object_unref((gpointer)obj);\
19 #define HANDLER_DISCONNECT(obj, h) if((h) != 0)\
21 g_signal_handler_disconnect(obj, h);\
24 gboolean my_strcmp(const gchar* str1, const gchar* str2);
26 gint my_strlen(const gchar* str);
28 gboolean my_strncmp(const gchar* str1, const gchar* str2, gint n);
30 #endif /*USEFUL_FUNCTIONS_H*/