summaryrefslogtreecommitdiff
path: root/src/test/test-prioq.c
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2021-11-24 12:00:02 +0100
committerJan Janssen <medhefgo@web.de>2021-11-25 15:03:06 +0100
commit4f7452a8eb7a946efea927fae017d4d661097833 (patch)
tree413778cc0fb08fbbed0890130b5ba66c90581e61 /src/test/test-prioq.c
parent4d5ad9d951299c905453ac8e3769dc82b0a09fb4 (diff)
downloadsystemd-4f7452a8eb7a946efea927fae017d4d661097833.tar.gz
test: Use TEST macro
This converts to TEST macro where it is trivial. Some additional notable changes: - simplify HAVE_LIBIDN #ifdef in test-dns-domain.c - use saved_argc/saved_argv in test-copy.c, test-path-util.c, test-tmpfiles.c and test-unit-file.c
Diffstat (limited to 'src/test/test-prioq.c')
-rw-r--r--src/test/test-prioq.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/test/test-prioq.c b/src/test/test-prioq.c
index de902ca427..540863c2ff 100644
--- a/src/test/test-prioq.c
+++ b/src/test/test-prioq.c
@@ -7,6 +7,7 @@
#include "set.h"
#include "siphash24.h"
#include "sort-util.h"
+#include "tests.h"
#define SET_SIZE 1024*4
@@ -14,7 +15,7 @@ static int unsigned_compare(const unsigned *a, const unsigned *b) {
return CMP(*a, *b);
}
-static void test_unsigned(void) {
+TEST(unsigned) {
_cleanup_(prioq_freep) Prioq *q = NULL;
unsigned buffer[SET_SIZE], i, u, n;
@@ -58,7 +59,7 @@ static void test_hash(const struct test *x, struct siphash *state) {
DEFINE_PRIVATE_HASH_OPS(test_hash_ops, struct test, test_hash, test_compare);
-static void test_struct(void) {
+TEST(struct) {
_cleanup_(prioq_freep) Prioq *q = NULL;
_cleanup_set_free_ Set *s = NULL;
unsigned previous = 0, i;
@@ -119,10 +120,4 @@ static void test_struct(void) {
assert_se(set_isempty(s));
}
-int main(int argc, char* argv[]) {
-
- test_unsigned();
- test_struct();
-
- return 0;
-}
+DEFINE_TEST_MAIN(LOG_INFO);