summaryrefslogtreecommitdiff
path: root/libs/gst/check
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2011-11-11 17:17:43 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2011-11-11 17:30:03 +0100
commit841ad590b9b0fbfdfa76bea81216a24e19480f66 (patch)
tree07844fc425956b43c9ad5564e466ec581cc2d803 /libs/gst/check
parent4a7c3b929add1c96b853c0c93676879345a77b8d (diff)
.h: fix header files
Ensure correct indentation and retab Make sure all structure have padding
Diffstat (limited to 'libs/gst/check')
-rw-r--r--libs/gst/check/gstbufferstraw.h6
-rw-r--r--libs/gst/check/gstcheck.h278
2 files changed, 142 insertions, 142 deletions
diff --git a/libs/gst/check/gstbufferstraw.h b/libs/gst/check/gstbufferstraw.h
index 9ec4a3184..ed497049e 100644
--- a/libs/gst/check/gstbufferstraw.h
+++ b/libs/gst/check/gstbufferstraw.h
@@ -26,9 +26,9 @@
G_BEGIN_DECLS
-void gst_buffer_straw_start_pipeline (GstElement * bin, GstPad * pad);
-GstBuffer *gst_buffer_straw_get_buffer (GstElement * bin, GstPad * pad);
-void gst_buffer_straw_stop_pipeline (GstElement * bin, GstPad * pad);
+void gst_buffer_straw_start_pipeline (GstElement * bin, GstPad * pad);
+GstBuffer * gst_buffer_straw_get_buffer (GstElement * bin, GstPad * pad);
+void gst_buffer_straw_stop_pipeline (GstElement * bin, GstPad * pad);
G_END_DECLS
diff --git a/libs/gst/check/gstcheck.h b/libs/gst/check/gstcheck.h
index 5b77a16b1..56d131afb 100644
--- a/libs/gst/check/gstcheck.h
+++ b/libs/gst/check/gstcheck.h
@@ -93,8 +93,8 @@ void gst_check_abi_list (GstCheckABIStruct list[], gboolean have_abi_sizes);
gint gst_check_run_suite (Suite * suite, const gchar * name,
const gchar * fname);
-#define fail_unless_message_error(msg, domain, code) \
-gst_check_message_error (msg, GST_MESSAGE_ERROR, \
+#define fail_unless_message_error(msg, domain, code) \
+gst_check_message_error (msg, GST_MESSAGE_ERROR, \
GST_ ## domain ## _ERROR, GST_ ## domain ## _ERROR_ ## code)
#define assert_message_error(m, d, c) fail_unless_message_error(m, d, c)
@@ -129,12 +129,12 @@ static void __testname (int __i__)\
* case, printing both expressions and the values they evaluated to. This
* macro is for use in unit tests.
*/
-#define fail_unless_equals_int(a, b) \
-G_STMT_START { \
- int first = a; \
- int second = b; \
- fail_unless(first == second, \
- "'" #a "' (%d) is not equal to '" #b"' (%d)", first, second); \
+#define fail_unless_equals_int(a, b) \
+G_STMT_START { \
+ int first = a; \
+ int second = b; \
+ fail_unless(first == second, \
+ "'" #a "' (%d) is not equal to '" #b"' (%d)", first, second); \
} G_STMT_END;
/**
* assert_equals_int:
@@ -156,13 +156,13 @@ G_STMT_START { \
* case, printing both expressions and the values they evaluated to. This
* macro is for use in unit tests.
*/
-#define fail_unless_equals_int64(a, b) \
-G_STMT_START { \
- gint64 first = a; \
- gint64 second = b; \
- fail_unless(first == second, \
- "'" #a "' (%" G_GINT64_FORMAT") is not equal to '" #b"' (%" \
- G_GINT64_FORMAT")", first, second); \
+#define fail_unless_equals_int64(a, b) \
+G_STMT_START { \
+ gint64 first = a; \
+ gint64 second = b; \
+ fail_unless(first == second, \
+ "'" #a "' (%" G_GINT64_FORMAT") is not equal to '" #b"' (%" \
+ G_GINT64_FORMAT")", first, second); \
} G_STMT_END;
/**
* assert_equals_int64:
@@ -184,13 +184,13 @@ G_STMT_START { \
* case, printing both expressions and the values they evaluated to. This
* macro is for use in unit tests.
*/
-#define fail_unless_equals_uint64(a, b) \
-G_STMT_START { \
- guint64 first = a; \
- guint64 second = b; \
- fail_unless(first == second, \
- "'" #a "' (%" G_GUINT64_FORMAT ") is not equal to '" #b"' (%" \
- G_GUINT64_FORMAT ")", first, second); \
+#define fail_unless_equals_uint64(a, b) \
+G_STMT_START { \
+ guint64 first = a; \
+ guint64 second = b; \
+ fail_unless(first == second, \
+ "'" #a "' (%" G_GUINT64_FORMAT ") is not equal to '" #b"' (%" \
+ G_GUINT64_FORMAT ")", first, second); \
} G_STMT_END;
/**
* assert_equals_uint64:
@@ -270,169 +270,169 @@ G_STMT_START { \
*/
extern GList *thread_list;
extern GMutex *mutex;
-extern GCond *start_cond; /* used to notify main thread of thread startups */
-extern GCond *sync_cond; /* used to synchronize all threads and main thread */
+extern GCond *start_cond; /* used to notify main thread of thread startups */
+extern GCond *sync_cond; /* used to synchronize all threads and main thread */
-#define MAIN_START_THREADS(count, function, data) \
-MAIN_INIT(); \
-MAIN_START_THREAD_FUNCTIONS(count, function, data); \
+#define MAIN_START_THREADS(count, function, data) \
+MAIN_INIT(); \
+MAIN_START_THREAD_FUNCTIONS(count, function, data); \
MAIN_SYNCHRONIZE();
-#define MAIN_INIT() \
-G_STMT_START { \
- _gst_check_threads_running = TRUE; \
- \
- if (mutex == NULL) { \
- mutex = g_mutex_new (); \
- start_cond = g_cond_new (); \
- sync_cond = g_cond_new (); \
- } \
+#define MAIN_INIT() \
+G_STMT_START { \
+ _gst_check_threads_running = TRUE; \
+ \
+ if (mutex == NULL) { \
+ mutex = g_mutex_new (); \
+ start_cond = g_cond_new (); \
+ sync_cond = g_cond_new (); \
+ } \
} G_STMT_END;
-#define MAIN_START_THREAD_FUNCTIONS(count, function, data) \
-G_STMT_START { \
- int i; \
- for (i = 0; i < count; ++i) { \
- MAIN_START_THREAD_FUNCTION (i, function, data); \
- } \
+#define MAIN_START_THREAD_FUNCTIONS(count, function, data) \
+G_STMT_START { \
+ int i; \
+ for (i = 0; i < count; ++i) { \
+ MAIN_START_THREAD_FUNCTION (i, function, data); \
+ } \
} G_STMT_END;
-#define MAIN_START_THREAD_FUNCTION(i, function, data) \
-G_STMT_START { \
- GThread *thread = NULL; \
- GST_DEBUG ("MAIN: creating thread %d", i); \
- g_mutex_lock (mutex); \
- thread = g_thread_create ((GThreadFunc) function, data, \
- TRUE, NULL); \
- /* wait for thread to signal us that it's ready */ \
- GST_DEBUG ("MAIN: waiting for thread %d", i); \
- g_cond_wait (start_cond, mutex); \
- g_mutex_unlock (mutex); \
- \
- thread_list = g_list_append (thread_list, thread); \
+#define MAIN_START_THREAD_FUNCTION(i, function, data) \
+G_STMT_START { \
+ GThread *thread = NULL; \
+ GST_DEBUG ("MAIN: creating thread %d", i); \
+ g_mutex_lock (mutex); \
+ thread = g_thread_create ((GThreadFunc) function, data, \
+ TRUE, NULL); \
+ /* wait for thread to signal us that it's ready */ \
+ GST_DEBUG ("MAIN: waiting for thread %d", i); \
+ g_cond_wait (start_cond, mutex); \
+ g_mutex_unlock (mutex); \
+ \
+ thread_list = g_list_append (thread_list, thread); \
} G_STMT_END;
-#define MAIN_SYNCHRONIZE() \
-G_STMT_START { \
- GST_DEBUG ("MAIN: synchronizing"); \
- g_cond_broadcast (sync_cond); \
- GST_DEBUG ("MAIN: synchronized"); \
+#define MAIN_SYNCHRONIZE() \
+G_STMT_START { \
+ GST_DEBUG ("MAIN: synchronizing"); \
+ g_cond_broadcast (sync_cond); \
+ GST_DEBUG ("MAIN: synchronized"); \
} G_STMT_END;
-#define MAIN_STOP_THREADS() \
-G_STMT_START { \
- _gst_check_threads_running = FALSE; \
- \
- /* join all threads */ \
- GST_DEBUG ("MAIN: joining"); \
- g_list_foreach (thread_list, (GFunc) g_thread_join, NULL); \
- g_list_free (thread_list); \
- thread_list = NULL; \
- GST_DEBUG ("MAIN: joined"); \
+#define MAIN_STOP_THREADS() \
+G_STMT_START { \
+ _gst_check_threads_running = FALSE; \
+ \
+ /* join all threads */ \
+ GST_DEBUG ("MAIN: joining"); \
+ g_list_foreach (thread_list, (GFunc) g_thread_join, NULL); \
+ g_list_free (thread_list); \
+ thread_list = NULL; \
+ GST_DEBUG ("MAIN: joined"); \
} G_STMT_END;
-#define THREAD_START() \
-THREAD_STARTED(); \
+#define THREAD_START() \
+THREAD_STARTED(); \
THREAD_SYNCHRONIZE();
-#define THREAD_STARTED() \
-G_STMT_START { \
- /* signal main thread that we started */ \
- GST_DEBUG ("THREAD %p: started", g_thread_self ()); \
- g_mutex_lock (mutex); \
- g_cond_signal (start_cond); \
+#define THREAD_STARTED() \
+G_STMT_START { \
+ /* signal main thread that we started */ \
+ GST_DEBUG ("THREAD %p: started", g_thread_self ()); \
+ g_mutex_lock (mutex); \
+ g_cond_signal (start_cond); \
} G_STMT_END;
-#define THREAD_SYNCHRONIZE() \
-G_STMT_START { \
- /* synchronize everyone */ \
- GST_DEBUG ("THREAD %p: syncing", g_thread_self ()); \
- g_cond_wait (sync_cond, mutex); \
- GST_DEBUG ("THREAD %p: synced", g_thread_self ()); \
- g_mutex_unlock (mutex); \
+#define THREAD_SYNCHRONIZE() \
+G_STMT_START { \
+ /* synchronize everyone */ \
+ GST_DEBUG ("THREAD %p: syncing", g_thread_self ()); \
+ g_cond_wait (sync_cond, mutex); \
+ GST_DEBUG ("THREAD %p: synced", g_thread_self ()); \
+ g_mutex_unlock (mutex); \
} G_STMT_END;
-#define THREAD_SWITCH() \
-G_STMT_START { \
- /* a minimal sleep is a context switch */ \
- g_usleep (1); \
+#define THREAD_SWITCH() \
+G_STMT_START { \
+ /* a minimal sleep is a context switch */ \
+ g_usleep (1); \
} G_STMT_END;
-#define THREAD_TEST_RUNNING() (_gst_check_threads_running == TRUE)
+#define THREAD_TEST_RUNNING() (_gst_check_threads_running == TRUE)
/* additional assertions */
-#define ASSERT_CRITICAL(code) \
-G_STMT_START { \
- _gst_check_expecting_log = TRUE; \
- _gst_check_raised_critical = FALSE; \
- code; \
+#define ASSERT_CRITICAL(code) \
+G_STMT_START { \
+ _gst_check_expecting_log = TRUE; \
+ _gst_check_raised_critical = FALSE; \
+ code; \
_fail_unless (_gst_check_raised_critical, __FILE__, __LINE__, \
"Expected g_critical, got nothing", NULL); \
- _gst_check_expecting_log = FALSE; \
+ _gst_check_expecting_log = FALSE; \
} G_STMT_END
-#define ASSERT_WARNING(code) \
-G_STMT_START { \
- _gst_check_expecting_log = TRUE; \
- _gst_check_raised_warning = FALSE; \
- code; \
+#define ASSERT_WARNING(code) \
+G_STMT_START { \
+ _gst_check_expecting_log = TRUE; \
+ _gst_check_raised_warning = FALSE; \
+ code; \
_fail_unless (_gst_check_raised_warning, __FILE__, __LINE__, \
"Expected g_warning, got nothing", NULL); \
- _gst_check_expecting_log = FALSE; \
+ _gst_check_expecting_log = FALSE; \
} G_STMT_END
-#define ASSERT_OBJECT_REFCOUNT(object, name, value) \
-G_STMT_START { \
- int rc; \
- rc = GST_OBJECT_REFCOUNT_VALUE (object); \
- fail_unless (rc == value, \
- "%s (%p) refcount is %d instead of %d", \
- name, object, rc, value); \
+#define ASSERT_OBJECT_REFCOUNT(object, name, value) \
+G_STMT_START { \
+ int rc; \
+ rc = GST_OBJECT_REFCOUNT_VALUE (object); \
+ fail_unless (rc == value, \
+ "%s (%p) refcount is %d instead of %d", \
+ name, object, rc, value); \
} G_STMT_END
-#define ASSERT_OBJECT_REFCOUNT_BETWEEN(object, name, lower, upper) \
-G_STMT_START { \
- int rc = GST_OBJECT_REFCOUNT_VALUE (object); \
- int lo = lower; \
- int hi = upper; \
- \
- fail_unless (rc >= lo, \
- "%s (%p) refcount %d is smaller than %d", \
- name, object, rc, lo); \
- fail_unless (rc <= hi, \
- "%s (%p) refcount %d is bigger than %d", \
- name, object, rc, hi); \
+#define ASSERT_OBJECT_REFCOUNT_BETWEEN(object, name, lower, upper) \
+G_STMT_START { \
+ int rc = GST_OBJECT_REFCOUNT_VALUE (object); \
+ int lo = lower; \
+ int hi = upper; \
+ \
+ fail_unless (rc >= lo, \
+ "%s (%p) refcount %d is smaller than %d", \
+ name, object, rc, lo); \
+ fail_unless (rc <= hi, \
+ "%s (%p) refcount %d is bigger than %d", \
+ name, object, rc, hi); \
} G_STMT_END
-#define ASSERT_CAPS_REFCOUNT(caps, name, value) \
- ASSERT_MINI_OBJECT_REFCOUNT(caps, name, value)
+#define ASSERT_CAPS_REFCOUNT(caps, name, value) \
+ ASSERT_MINI_OBJECT_REFCOUNT(caps, name, value)
-#define ASSERT_BUFFER_REFCOUNT(buffer, name, value) \
- ASSERT_MINI_OBJECT_REFCOUNT(buffer, name, value)
+#define ASSERT_BUFFER_REFCOUNT(buffer, name, value) \
+ ASSERT_MINI_OBJECT_REFCOUNT(buffer, name, value)
-#define ASSERT_MINI_OBJECT_REFCOUNT(miniobj, name, value) \
-G_STMT_START { \
- int rc; \
- rc = GST_MINI_OBJECT_REFCOUNT_VALUE (miniobj); \
- fail_unless (rc == value, \
+#define ASSERT_MINI_OBJECT_REFCOUNT(miniobj, name, value) \
+G_STMT_START { \
+ int rc; \
+ rc = GST_MINI_OBJECT_REFCOUNT_VALUE (miniobj); \
+ fail_unless (rc == value, \
name " (%p) refcount is %d instead of %d", miniobj, rc, value); \
} G_STMT_END
-#define ASSERT_SET_STATE(element, state, ret) \
-fail_unless (gst_element_set_state (element, \
- state) == ret, \
+#define ASSERT_SET_STATE(element, state, ret) \
+fail_unless (gst_element_set_state (element, \
+ state) == ret, \
"could not change state to " #state);
-#define GST_CHECK_MAIN(name) \
-int main (int argc, char **argv) \
-{ \
+#define GST_CHECK_MAIN(name) \
+int main (int argc, char **argv) \
+{ \
Suite *s; \
- gst_check_init (&argc, &argv); \
- s = name ## _suite (); \
- return gst_check_run_suite (s, # name, __FILE__); \
+ gst_check_init (&argc, &argv); \
+ s = name ## _suite (); \
+ return gst_check_run_suite (s, # name, __FILE__); \
}
/* Hack to allow run-time selection of unit tests to run via the