summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-06-20 11:58:53 +0200
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commit7cc655f99a364e6762a50ce25864979b3a52a73f (patch)
tree917d4bc83179e6ca1919a60019bc0cc7fd30a54e /src/test
parent3f4a243f747c3397900038d2ca2b7645614935a5 (diff)
tree-wide: drop copyright headers from frequent contributors
Fixes #9320. for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms' done
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-conf-parser.c3
-rw-r--r--src/test/test-copy.c23
-rw-r--r--src/test/test-ellipsize.c3
-rw-r--r--src/test/test-exec-util.c3
-rw-r--r--src/test/test-extract-word.c3
-rw-r--r--src/test/test-locale-util.c3
-rw-r--r--src/test/test-parse-util.c3
-rw-r--r--src/test/test-process-util.c3
-rw-r--r--src/test/test-siphash24.c3
-rw-r--r--src/test/test-unaligned.c3
-rw-r--r--src/test/test-util.c3
11 files changed, 20 insertions, 33 deletions
diff --git a/src/test/test-conf-parser.c b/src/test/test-conf-parser.c
index 9a9e7ab4d..a8df45941 100644
--- a/src/test/test-conf-parser.c
+++ b/src/test/test-conf-parser.c
@@ -1,7 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2015 Ronny Chevalier
-***/
#include "conf-parser.h"
#include "fd-util.h"
diff --git a/src/test/test-copy.c b/src/test/test-copy.c
index b893c4996..b3dfedd36 100644
--- a/src/test/test-copy.c
+++ b/src/test/test-copy.c
@@ -1,7 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2014 Ronny Chevalier
-***/
#include <unistd.h>
@@ -240,7 +237,26 @@ static void test_copy_bytes_regular_file(const char *src, bool try_reflink, uint
unlink(fn3);
}
+static void test_copy_atomic(void) {
+ _cleanup_(rm_rf_physical_and_freep) char *p = NULL;
+ const char *q;
+ int r;
+
+ assert_se(mkdtemp_malloc(NULL, &p) >= 0);
+
+ q = strjoina(p, "/fstab");
+
+ r = copy_file_atomic("/etc/fstab", q, 0644, 0, COPY_REFLINK);
+ if (r == -ENOENT)
+ return;
+
+ assert_se(copy_file_atomic("/etc/fstab", q, 0644, 0, COPY_REFLINK) == -EEXIST);
+
+ assert_se(copy_file_atomic("/etc/fstab", q, 0644, 0, COPY_REPLACE) >= 0);
+}
+
int main(int argc, char *argv[]) {
+ log_set_max_level(LOG_DEBUG);
#if 0 /// UNNEEDED by elogind
test_copy_file();
@@ -254,6 +270,7 @@ int main(int argc, char *argv[]) {
test_copy_bytes_regular_file(argv[0], true, 1000);
test_copy_bytes_regular_file(argv[0], false, 32000); /* larger than copy buffer size */
test_copy_bytes_regular_file(argv[0], true, 32000);
+ test_copy_atomic();
return 0;
}
diff --git a/src/test/test-ellipsize.c b/src/test/test-ellipsize.c
index 662d1e7cc..5e0c7577f 100644
--- a/src/test/test-ellipsize.c
+++ b/src/test/test-ellipsize.c
@@ -1,7 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2013 Shawn Landden
-***/
#include <stdio.h>
diff --git a/src/test/test-exec-util.c b/src/test/test-exec-util.c
index d0e20ee6d..030328391 100644
--- a/src/test/test-exec-util.c
+++ b/src/test/test-exec-util.c
@@ -1,7 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2013 Thomas H.P. Andersen
-***/
#include <errno.h>
#include <string.h>
diff --git a/src/test/test-extract-word.c b/src/test/test-extract-word.c
index 66f30304d..c347605a9 100644
--- a/src/test/test-extract-word.c
+++ b/src/test/test-extract-word.c
@@ -1,7 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2013 Thomas H.P. Andersen
-***/
#include <errno.h>
#include <stdlib.h>
diff --git a/src/test/test-locale-util.c b/src/test/test-locale-util.c
index 5b835566f..8ffae8ca0 100644
--- a/src/test/test-locale-util.c
+++ b/src/test/test-locale-util.c
@@ -1,7 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2014 Ronny Chevalier
-***/
#include "locale-util.h"
#include "macro.h"
diff --git a/src/test/test-parse-util.c b/src/test/test-parse-util.c
index 757ebd629..73688952f 100644
--- a/src/test/test-parse-util.c
+++ b/src/test/test-parse-util.c
@@ -1,7 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2013 Thomas H.P. Andersen
-***/
#include <errno.h>
#include <locale.h>
diff --git a/src/test/test-process-util.c b/src/test/test-process-util.c
index a57bd8c7f..bbaf3f925 100644
--- a/src/test/test-process-util.c
+++ b/src/test/test-process-util.c
@@ -1,7 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2013 Thomas H.P. Andersen
-***/
#include <sched.h>
#include <sys/mount.h>
diff --git a/src/test/test-siphash24.c b/src/test/test-siphash24.c
index e340388d8..218200e48 100644
--- a/src/test/test-siphash24.c
+++ b/src/test/test-siphash24.c
@@ -1,7 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2015 Tom Gundersen
-***/
#include "siphash24.h"
#include "util.h"
diff --git a/src/test/test-unaligned.c b/src/test/test-unaligned.c
index 853312e58..96d6b22be 100644
--- a/src/test/test-unaligned.c
+++ b/src/test/test-unaligned.c
@@ -1,7 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2014 Tom Gundersen
-***/
#include "sparse-endian.h"
#include "unaligned.h"
diff --git a/src/test/test-util.c b/src/test/test-util.c
index cf0fbc509..36dfeb5c3 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -1,7 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2013 Thomas H.P. Andersen
-***/
#include <errno.h>
#include <string.h>