summaryrefslogtreecommitdiff
path: root/src/test/test-strxcpyx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test-strxcpyx.c')
-rw-r--r--src/test/test-strxcpyx.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/test/test-strxcpyx.c b/src/test/test-strxcpyx.c
index c68fe3c064..4e2118979f 100644
--- a/src/test/test-strxcpyx.c
+++ b/src/test/test-strxcpyx.c
@@ -4,9 +4,10 @@
#include "string-util.h"
#include "strxcpyx.h"
+#include "tests.h"
#include "util.h"
-static void test_strpcpy(void) {
+TEST(strpcpy) {
char target[25];
char *s = target;
size_t space_left;
@@ -23,7 +24,7 @@ static void test_strpcpy(void) {
assert_se(space_left == 0);
}
-static void test_strpcpyf(void) {
+TEST(strpcpyf) {
char target[25];
char *s = target;
size_t space_left;
@@ -43,7 +44,7 @@ static void test_strpcpyf(void) {
assert_se(target[12] == '2');
}
-static void test_strpcpyl(void) {
+TEST(strpcpyl) {
char target[25];
char *s = target;
size_t space_left;
@@ -56,7 +57,7 @@ static void test_strpcpyl(void) {
assert_se(space_left == 1);
}
-static void test_strscpy(void) {
+TEST(strscpy) {
char target[25];
size_t space_left;
@@ -67,7 +68,7 @@ static void test_strscpy(void) {
assert_se(space_left == 20);
}
-static void test_strscpyl(void) {
+TEST(strscpyl) {
char target[25];
size_t space_left;
@@ -78,7 +79,7 @@ static void test_strscpyl(void) {
assert_se(space_left == 10);
}
-static void test_sd_event_code_migration(void) {
+TEST(sd_event_code_migration) {
char b[100 * DECIMAL_STR_MAX(unsigned) + 1];
char c[100 * DECIMAL_STR_MAX(unsigned) + 1], *p;
unsigned i;
@@ -99,14 +100,4 @@ static void test_sd_event_code_migration(void) {
assert_se(streq(b, c));
}
-int main(int argc, char *argv[]) {
- test_strpcpy();
- test_strpcpyf();
- test_strpcpyl();
- test_strscpy();
- test_strscpyl();
-
- test_sd_event_code_migration();
-
- return 0;
-}
+DEFINE_TEST_MAIN(LOG_INFO);