33 #include <glib/gprintf.h> |
33 #include <glib/gprintf.h> |
34 //#endif |
34 //#endif |
35 |
35 |
36 void create_xml(int result) |
36 void create_xml(int result) |
37 { |
37 { |
38 |
|
39 if(result) |
38 if(result) |
40 { |
|
41 assert_failed = 1; |
39 assert_failed = 1; |
42 } |
40 |
43 |
|
44 testResultXml(xmlfile); |
41 testResultXml(xmlfile); |
45 close_log_file(); |
42 close_log_file(); |
46 |
|
47 if(result) |
|
48 { |
|
49 exit (-1); |
|
50 } |
|
51 |
|
52 } |
43 } |
53 |
44 |
54 #define SPECIAL_POINTER(x) ((void*)(19283847+(x))) |
45 #define SPECIAL_POINTER(x) ((void*)(19283847+(x))) |
55 |
46 |
56 static int n_data_probes = 0; |
47 static int n_data_probes = 0; |
59 |
50 |
60 #if EMULATOR |
51 #if EMULATOR |
61 static GET_GLOBAL_VAR_FROM_TLS(raised_critical,gstcheck,gboolean) |
52 static GET_GLOBAL_VAR_FROM_TLS(raised_critical,gstcheck,gboolean) |
62 #define _gst_check_raised_critical (*GET_GSTREAMER_WSD_VAR_NAME(raised_critical,gstcheck,g)()) |
53 #define _gst_check_raised_critical (*GET_GSTREAMER_WSD_VAR_NAME(raised_critical,gstcheck,g)()) |
63 #else |
54 #else |
64 IMPORT_C extern gboolean _gst_check_raised_critical; |
55 extern gboolean _gst_check_raised_critical; |
65 #endif |
56 #endif |
66 //gboolean _gst_check_raised_warning = FALSE; |
57 //gboolean _gst_check_raised_warning = FALSE; |
67 #if EMULATOR |
58 #if EMULATOR |
68 static GET_GLOBAL_VAR_FROM_TLS(raised_warning,gstcheck,gboolean) |
59 static GET_GLOBAL_VAR_FROM_TLS(raised_warning,gstcheck,gboolean) |
69 #define _gst_check_raised_warning (*GET_GSTREAMER_WSD_VAR_NAME(raised_warning,gstcheck,g)()) |
60 #define _gst_check_raised_warning (*GET_GSTREAMER_WSD_VAR_NAME(raised_warning,gstcheck,g)()) |
70 #else |
61 #else |
71 IMPORT_C extern gboolean _gst_check_raised_warning; |
62 extern gboolean _gst_check_raised_warning; |
72 #endif |
63 #endif |
73 //gboolean _gst_check_expecting_log = FALSE; |
64 //gboolean _gst_check_expecting_log = FALSE; |
74 #if EMULATOR |
65 #if EMULATOR |
75 static GET_GLOBAL_VAR_FROM_TLS(expecting_log,gstcheck,gboolean) |
66 static GET_GLOBAL_VAR_FROM_TLS(expecting_log,gstcheck,gboolean) |
76 #define _gst_check_expecting_log (*GET_GSTREAMER_WSD_VAR_NAME(expecting_log,gstcheck,g)()) |
67 #define _gst_check_expecting_log (*GET_GSTREAMER_WSD_VAR_NAME(expecting_log,gstcheck,g)()) |
77 #else |
68 #else |
78 IMPORT_C extern gboolean _gst_check_expecting_log; |
69 extern gboolean _gst_check_expecting_log; |
79 #endif |
70 #endif |
80 |
71 |
81 |
72 |
82 static gboolean |
73 static gboolean |
83 data_probe (GstPad * pad, GstMiniObject * obj, gpointer data) |
74 data_probe (GstPad * pad, GstMiniObject * obj, gpointer data) |
139 message = gst_bus_poll (bus, GST_MESSAGE_EOS, -1); |
130 message = gst_bus_poll (bus, GST_MESSAGE_EOS, -1); |
140 gst_message_unref (message); |
131 gst_message_unref (message); |
141 gst_object_unref (bus); |
132 gst_object_unref (bus); |
142 |
133 |
143 g_assert (n_buffer_probes == 10); /* one for every buffer */ |
134 g_assert (n_buffer_probes == 10); /* one for every buffer */ |
144 g_assert (n_event_probes == 3); /* new segment, latency and eos */ |
135 g_assert (n_event_probes == 2); /* new segment and eos */ |
145 g_assert (n_data_probes == 13); /* duh */ |
136 g_assert (n_data_probes == 12); /* duh */ |
146 |
137 |
147 gst_element_set_state (pipeline, GST_STATE_NULL); |
138 gst_element_set_state (pipeline, GST_STATE_NULL); |
148 gst_object_unref (pipeline); |
139 gst_object_unref (pipeline); |
149 |
140 |
150 /* make sure nothing was sent in addition to the above when shutting down */ |
141 /* make sure nothing was sent in addition to the above when shutting down */ |
151 g_assert (n_buffer_probes == 10); /* one for every buffer */ |
142 g_assert (n_buffer_probes == 10); /* one for every buffer */ |
152 g_assert (n_event_probes == 3); /* new segment, latency and eos */ |
143 g_assert (n_event_probes == 2); /* new segment and eos */ |
153 g_assert (n_data_probes == 13); /* duh */ |
144 g_assert (n_data_probes == 12); /* duh */ |
154 |
145 |
155 std_log(LOG_FILENAME_LINE, "Test Successful"); |
146 std_log(LOG_FILENAME_LINE, "Test Successful"); |
156 create_xml(0); |
147 create_xml(0); |
157 } |
148 } |
158 |
149 |