summaryrefslogtreecommitdiff
path: root/test/bus/dispatch-sha1.c
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-07-15 15:27:24 +0100
committerSimon McVittie <smcv@collabora.com>2022-07-18 11:15:54 +0000
commit11e6c92e9521ef55ceb0b421c5d077d5793c71d5 (patch)
tree737f48038518e68f79e16a93deac93ada11d0832 /test/bus/dispatch-sha1.c
parent2cdd0d0f30e61298f2ae93157baa9ad987788184 (diff)
downloaddbus-11e6c92e9521ef55ceb0b421c5d077d5793c71d5.tar.gz
test/bus: Factor out common setup/teardown code
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'test/bus/dispatch-sha1.c')
-rw-r--r--test/bus/dispatch-sha1.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/test/bus/dispatch-sha1.c b/test/bus/dispatch-sha1.c
index a32508bc..dc2dcb5d 100644
--- a/test/bus/dispatch-sha1.c
+++ b/test/bus/dispatch-sha1.c
@@ -22,41 +22,12 @@
*/
#include <config.h>
-
-#include "bus/test.h"
-
-#include <dbus/dbus-test-tap.h>
-
-#include "bus/audit.h"
-#include "bus/selinux.h"
-#include "test/test-utils.h"
-
-#ifndef DBUS_ENABLE_EMBEDDED_TESTS
-#error This file is only relevant for the embedded tests
-#endif
-
-static void
-test_pre_hook (void)
-{
-}
-
-static void
-test_post_hook (void)
-{
- if (_dbus_getenv ("DBUS_TEST_SELINUX"))
- bus_selinux_shutdown ();
-
- bus_audit_shutdown ();
-}
+#include "test/bus/common.h"
static DBusTestCase test = { "dispatch-sha1", bus_dispatch_sha1_test };
int
main (int argc, char **argv)
{
- return _dbus_test_main (argc, argv, 1, &test,
- (DBUS_TEST_FLAGS_CHECK_MEMORY_LEAKS |
- DBUS_TEST_FLAGS_CHECK_FD_LEAKS |
- DBUS_TEST_FLAGS_REQUIRE_DATA),
- test_pre_hook, test_post_hook);
+ return bus_test_main (argc, argv, 1, &test);
}