gstreamer_core/libs/gst/check/gstcheck.h
branchRCL_3
changeset 30 7e817e7e631c
parent 29 567bb019e3e3
--- a/gstreamer_core/libs/gst/check/gstcheck.h	Tue Aug 31 15:30:33 2010 +0300
+++ b/gstreamer_core/libs/gst/check/gstcheck.h	Wed Sep 01 12:16:41 2010 +0100
@@ -29,10 +29,10 @@
 #include <stdlib.h>
 #include <math.h>
 
-
+#include "check.h"
 
 #include "libgstreamer_wsd_solution.h" 
-#include <check.h>
+
 #include <gst/gst.h>
 
 G_BEGIN_DECLS
@@ -40,12 +40,6 @@
 GST_DEBUG_CATEGORY_EXTERN (check_debug);
 #define GST_CAT_DEFAULT check_debug
 
-#define __CHECK_VERSION_LATER_THAN(major,minor,micro) \
-    (CHECK_MAJOR_VERSION > major || \
-     (CHECK_MAJOR_VERSION == (major) && CHECK_MINOR_VERSION > (minor)) || \
-     (CHECK_MAJOR_VERSION == (major) && CHECK_MINOR_VERSION == (minor) && \
-      CHECK_MICRO_VERSION > (micro)))
-
 /* logging function for tests
  * a test uses g_message() to log a debug line
  * a gst unit test can be run with GST_TEST_DEBUG env var set to see the
@@ -155,23 +149,6 @@
 IMPORT_C
 #endif
 
-GstPad * gst_check_setup_src_pad_by_name (GstElement * element,
-          GstStaticPadTemplate * template, gchar *name);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-GstPad * gst_check_setup_sink_pad_by_name (GstElement * element, 
-          GstStaticPadTemplate * template, gchar *name);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-void gst_check_teardown_pad_by_name (GstElement * element, gchar *name);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
 void gst_check_teardown_src_pad (GstElement * element);
 #ifdef __SYMBIAN32__
 IMPORT_C
@@ -230,8 +207,11 @@
  *
  * wrapper for checks END_TEST
  */
+
 /*
-#if __CHECK_VERSION_LATER_THAN(0,9,3)
+#if CHECK_MAJOR_VERSION > 0 || \
+    (CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION > 9) || \
+    (CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION == 9 && CHECK_MICRO_VERSION > 3)
 #define GST_START_TEST(__testname) \
 static void __testname (int __i__)\
 {\
@@ -250,6 +230,7 @@
 //#define GST_END_TEST END_TEST
 //#endif
 
+//#define GST_END_TEST }
 
 /* additional fail macros */
 /**
@@ -386,11 +367,9 @@
 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 ();		\
-  }					\
+  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)	\
@@ -431,8 +410,6 @@
   /* 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;
 
@@ -534,12 +511,24 @@
 #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__);		\
+    int i, num_fun;                  \
+gst_check_init (NULL, NULL);                    \
+i = sizeof(args);                           \
+ num_fun = i/sizeof(int);                   \
+  for(i=0;i<num_fun;i++)                    \
+      if (!strcmp(args[i], argv[1]))                    \
+      {                                     \
+          fn[i]();                                  \
+          break;                                        \
+          }                     \
+  if(i == num_fun)                      \
+      std_log(LOG_FILENAME_LINE, "%s is invalid args", argv[1]);                      \
+  return 0;                                         \
 }
+
 */
+
+
 #define GST_CHECK_MAIN(name)                    \
     int main (int argc, char **argv)        \
     {                                   \
@@ -574,6 +563,9 @@
       return 0;                 \
     }
 
+
+
+
 /* Hack to allow run-time selection of unit tests to run via the
  * GST_CHECKS environment variable (test function names, comma-separated) */
 #ifdef __SYMBIAN32__
@@ -582,17 +574,11 @@
 
 
 gboolean _gst_check_run_test_func (const gchar * func_name);
+
 /*
-#if __CHECK_VERSION_LATER_THAN(0,9,6)
-static inline void
-__gst_tcase_add_test (TCase * tc, TFun tf, const char * fname, int signal,
-    int allowed_exit_value, int start, int end)
-{
-  if (_gst_check_run_test_func (fname)) {
-    _tcase_add_test (tc, tf, fname, signal, allowed_exit_value, start, end);
-  }
-}
-#elif __CHECK_VERSION_LATER_THAN(0,9,3)
+#if CHECK_MAJOR_VERSION > 0 || \
+    (CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION > 9) || \
+    (CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION == 9 && CHECK_MICRO_VERSION > 3)
 static inline void
 __gst_tcase_add_test (TCase * tc, TFun tf, const char * fname, int signal,
     int start, int end)
@@ -616,8 +602,6 @@
 
 //#define _tcase_add_test __gst_tcase_add_test
 
-//#undef __CHECK_VERSION_LATER_THAN
-
 G_END_DECLS
 
 #endif /* __GST_CHECK_H__ */