ListNames and ListQueuedOwners updated to work with new kdbus
[platform/upstream/dbus.git] / dbus / dbus-test.c
index b8644de..b707ee2 100644 (file)
  */
 
 #include <config.h>
-#include "dbus-config.h"
 #include "dbus-test.h"
 #include "dbus-sysdeps.h"
 #include "dbus-internals.h"
 #include <stdio.h>
 #include <stdlib.h>
 
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
 static void
 die (const char *failure)
 {
@@ -64,9 +63,9 @@ run_test (const char             *test_name,
       printf ("%s: running %s tests\n", "dbus-test", test_name);
       if (!test ())
        die (test_name);
-    }
 
-  check_memleaks ();
+      check_memleaks ();
+    }
 }
 
 static void
@@ -80,12 +79,12 @@ run_data_test (const char             *test_name,
       printf ("%s: running %s tests\n", "dbus-test", test_name);
       if (!test (test_data_dir))
        die (test_name);
-    }
 
-  check_memleaks ();
+      check_memleaks ();
+    }
 }
 
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
 
 /**
  * An exported symbol to be run in order to execute
@@ -95,16 +94,17 @@ run_data_test (const char             *test_name,
  * (with --enable-tests=no)
  *
  * @param test_data_dir the directory with test data (test/data normally)
+ * @param specific_test run specific test or #NULL to run all tests
  */
 void
 dbus_internal_do_not_use_run_tests (const char *test_data_dir, const char *specific_test)
 {
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
   if (!_dbus_threads_init_debug ())
     die ("debug threads init");
   
   if (test_data_dir == NULL)
-    test_data_dir = _dbus_config_test_data ();
+    test_data_dir = _dbus_getenv ("DBUS_TEST_DATA");
 
   if (test_data_dir != NULL)
     printf ("Test data in %s\n", test_data_dir);
@@ -129,15 +129,7 @@ dbus_internal_do_not_use_run_tests (const char *test_data_dir, const char *speci
   
   run_test ("marshalling", specific_test, _dbus_marshal_test);
 
-#if 0
-  printf ("%s: running recursive marshalling tests\n", "dbus-test");
-  if (!_dbus_marshal_recursive_test ())
-    die ("recursive marshal");
-
-  check_memleaks ();
-#else
-  _dbus_warn ("recursive marshal tests disabled\n");
-#endif
+  run_test ("marshal-recursive", specific_test, _dbus_marshal_recursive_test);
 
   run_test ("byteswap", specific_test, _dbus_marshal_byteswap_test);
   
@@ -151,8 +143,6 @@ dbus_internal_do_not_use_run_tests (const char *test_data_dir, const char *speci
 
   run_test ("marshal-validate", specific_test, _dbus_marshal_validate_test);
 
-  run_test ("marshal-header", specific_test, _dbus_marshal_header_test);
-  
   run_data_test ("message", specific_test, _dbus_message_test, test_data_dir);
   
   run_test ("hash", specific_test, _dbus_hash_test);
@@ -165,24 +155,16 @@ dbus_internal_do_not_use_run_tests (const char *test_data_dir, const char *speci
 
 #ifdef DBUS_UNIX
   run_data_test ("userdb", specific_test, _dbus_userdb_test, test_data_dir);
+
+  run_test ("transport-unix", specific_test, _dbus_transport_unix_test);
 #endif
   
   run_test ("keyring", specific_test, _dbus_keyring_test);
-  
-#if 0
-  printf ("%s: running md5 tests\n", "dbus-test");
-  if (!_dbus_md5_test ())
-    die ("md5");
 
-  check_memleaks ();
-#endif
-  
   run_data_test ("sha", specific_test, _dbus_sha_test, test_data_dir);
   
   run_data_test ("auth", specific_test, _dbus_auth_test, test_data_dir);
 
-  run_data_test ("pending-call", specific_test, _dbus_pending_call_test, test_data_dir);
-  
   printf ("%s: completed successfully\n", "dbus-test");
 #else
   printf ("Not compiled with unit tests, not running any\n");