gstreamer_core/tsrc/check/libs/collectpads/src/collectpads.c
branchRCL_3
changeset 30 7e817e7e631c
parent 29 567bb019e3e3
equal deleted inserted replaced
29:567bb019e3e3 30:7e817e7e631c
    39 
    39 
    40 #if EMULATOR
    40 #if EMULATOR
    41 static GET_GLOBAL_VAR_FROM_TLS(raised_critical,gstcheck,gboolean)
    41 static GET_GLOBAL_VAR_FROM_TLS(raised_critical,gstcheck,gboolean)
    42 #define _gst_check_raised_critical (*GET_GSTREAMER_WSD_VAR_NAME(raised_critical,gstcheck,g)())
    42 #define _gst_check_raised_critical (*GET_GSTREAMER_WSD_VAR_NAME(raised_critical,gstcheck,g)())
    43 #else 
    43 #else 
    44 IMPORT_C extern gboolean _gst_check_raised_critical ;
    44 extern gboolean _gst_check_raised_critical ;
    45 #endif
    45 #endif
    46 //gboolean _gst_check_raised_warning = FALSE;
    46 //gboolean _gst_check_raised_warning = FALSE;
    47 #if EMULATOR
    47 #if EMULATOR
    48 static GET_GLOBAL_VAR_FROM_TLS(raised_warning,gstcheck,gboolean)
    48 static GET_GLOBAL_VAR_FROM_TLS(raised_warning,gstcheck,gboolean)
    49 #define _gst_check_raised_warning (*GET_GSTREAMER_WSD_VAR_NAME(raised_warning,gstcheck,g)())
    49 #define _gst_check_raised_warning (*GET_GSTREAMER_WSD_VAR_NAME(raised_warning,gstcheck,g)())
    50 #else 
    50 #else 
    51 IMPORT_C extern gboolean _gst_check_raised_warning ;
    51 extern gboolean _gst_check_raised_warning ;
    52 #endif
    52 #endif
    53 //gboolean _gst_check_expecting_log = FALSE;
    53 //gboolean _gst_check_expecting_log = FALSE;
    54 #if EMULATOR
    54 #if EMULATOR
    55 static GET_GLOBAL_VAR_FROM_TLS(expecting_log,gstcheck,gboolean)
    55 static GET_GLOBAL_VAR_FROM_TLS(expecting_log,gstcheck,gboolean)
    56 #define _gst_check_expecting_log (*GET_GSTREAMER_WSD_VAR_NAME(expecting_log,gstcheck,g)())
    56 #define _gst_check_expecting_log (*GET_GSTREAMER_WSD_VAR_NAME(expecting_log,gstcheck,g)())
    57 #else 
    57 #else 
    58 IMPORT_C extern gboolean _gst_check_expecting_log ;
    58 extern gboolean _gst_check_expecting_log ;
    59 #endif
    59 #endif
    60 
    60 
    61 //gboolean _gst_check_expecting_log = FALSE;
    61 //gboolean _gst_check_expecting_log = FALSE;
    62 #if EMULATOR
    62 #if EMULATOR
    63 static GET_GLOBAL_VAR_FROM_TLS(threads_running,gstcheck,gboolean)
    63 static GET_GLOBAL_VAR_FROM_TLS(threads_running,gstcheck,gboolean)
    64 #define _gst_check_threads_running (*GET_GSTREAMER_WSD_VAR_NAME(threads_running,gstcheck,g)())
    64 #define _gst_check_threads_running (*GET_GSTREAMER_WSD_VAR_NAME(threads_running,gstcheck,g)())
    65 #else 
    65 #else 
    66 IMPORT_C extern gboolean _gst_check_threads_running ;
    66 extern gboolean _gst_check_threads_running ;
    67 #endif
    67 #endif
    68 
    68 
    69 
    69 
    70 #if EMULATOR
    70 #if EMULATOR
    71 GET_GLOBAL_VAR_FROM_TLS(buffers,gstcheck,GList*)
    71 GET_GLOBAL_VAR_FROM_TLS(buffers,gstcheck,GList*)
    72 #define buffers (*GET_GSTREAMER_WSD_VAR_NAME(buffers,gstcheck,g)())
    72 #define buffers (*GET_GSTREAMER_WSD_VAR_NAME(buffers,gstcheck,g)())
    73 #else 
    73 #else 
    74 IMPORT_C extern GList *buffers;
    74 extern GList *buffers;
    75 #endif
    75 #endif
    76 
    76 
    77 
    77 
    78 #if EMULATOR
    78 #if EMULATOR
    79 GET_GLOBAL_VAR_FROM_TLS(thread_list,gstcheck,GList*)
    79 GET_GLOBAL_VAR_FROM_TLS(thread_list,gstcheck,GList*)
    80 #define thread_list (*GET_GSTREAMER_WSD_VAR_NAME(thread_list,gstcheck,g)())
    80 #define thread_list (*GET_GSTREAMER_WSD_VAR_NAME(thread_list,gstcheck,g)())
    81 #else 
    81 #else 
    82 IMPORT_C extern GList *thread_list;
    82 extern GList *thread_list;
    83 #endif
    83 #endif
    84 
    84 
    85 //GMutex *mutex;
    85 //GMutex *mutex;
    86 #if EMULATOR
    86 #if EMULATOR
    87 GET_GLOBAL_VAR_FROM_TLS(mutex,gstcheck,GMutex*)
    87 GET_GLOBAL_VAR_FROM_TLS(mutex,gstcheck,GMutex*)
    88 #define mutex (*GET_GSTREAMER_WSD_VAR_NAME(mutex,gstcheck,g)())
    88 #define mutex (*GET_GSTREAMER_WSD_VAR_NAME(mutex,gstcheck,g)())
    89 #else 
    89 #else 
    90 IMPORT_C extern GMutex *mutex;
    90 extern GMutex *mutex;
    91 #endif
    91 #endif
    92 
    92 
    93 //GCond *start_cond;              /* used to notify main thread of thread startups */
    93 //GCond *start_cond;              /* used to notify main thread of thread startups */
    94 #if EMULATOR
    94 #if EMULATOR
    95 GET_GLOBAL_VAR_FROM_TLS(start_cond,gstcheck,GCond*)
    95 GET_GLOBAL_VAR_FROM_TLS(start_cond,gstcheck,GCond*)
    96 #define start_cond (*GET_GSTREAMER_WSD_VAR_NAME(start_cond,gstcheck,g)())
    96 #define start_cond (*GET_GSTREAMER_WSD_VAR_NAME(start_cond,gstcheck,g)())
    97 #else 
    97 #else 
    98 IMPORT_C extern GCond *start_cond;
    98 extern GCond *start_cond;
    99 #endif
    99 #endif
   100 
   100 
   101 //GCond *sync_cond;               /* used to synchronize all threads and main thread */
   101 //GCond *sync_cond;               /* used to synchronize all threads and main thread */
   102 #if EMULATOR
   102 #if EMULATOR
   103 GET_GLOBAL_VAR_FROM_TLS(sync_cond,gstcheck,GCond*)
   103 GET_GLOBAL_VAR_FROM_TLS(sync_cond,gstcheck,GCond*)
   104 #define sync_cond (*GET_GSTREAMER_WSD_VAR_NAME(sync_cond,gstcheck,g)())
   104 #define sync_cond (*GET_GSTREAMER_WSD_VAR_NAME(sync_cond,gstcheck,g)())
   105 #else 
   105 #else 
   106 IMPORT_C extern GCond *sync_cond;
   106 extern GCond *sync_cond;
   107 #endif
   107 #endif
   108 
   108 
   109 //char* xmlfile = "collectpads";
   109 //char* xmlfile = "collectpads";
   110 
   110 
   111 void create_xml(int result)
   111 void create_xml(int result)
   112 {
   112 {
   113 
       
   114     if(result)
   113     if(result)
   115     {
       
   116         assert_failed = 1;
   114         assert_failed = 1;
   117     } 
   115     
   118 
       
   119     testResultXml(xmlfile);
   116     testResultXml(xmlfile);
   120     close_log_file();
   117     close_log_file();
   121 
       
   122     if(result)
       
   123     {
       
   124         exit (-1);
       
   125     }    
       
   126 
       
   127 }
   118 }
   128 
   119 
   129 #define fail_unless_collected(expected)           \
   120 #define fail_unless_collected(expected)           \
   130 G_STMT_START {                                    \
   121 G_STMT_START {                                    \
   131   g_mutex_lock (lock);                            \
   122   g_mutex_lock (lock);                            \