aboutsummaryrefslogtreecommitdiff
path: root/tests/fs-tests
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-06-22 14:00:04 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-06-28 11:43:03 +0200
commitf8bc7d94761f6153be606328183fac6766202914 (patch)
treead349b9c2f0f530b9d3f4734a7cf74a52db8bb31 /tests/fs-tests
parenta7c8cb36d1fb972082ef4f0039300d051ade2de9 (diff)
Add const modifier to read only strings and string constants
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests/fs-tests')
-rw-r--r--tests/fs-tests/lib/tests.c16
-rw-r--r--tests/fs-tests/lib/tests.h6
-rw-r--r--tests/fs-tests/simple/ftrunc.c2
-rw-r--r--tests/fs-tests/stress/atoms/stress_2.c2
-rw-r--r--tests/fs-tests/utils/free_space.c2
5 files changed, 14 insertions, 14 deletions
diff --git a/tests/fs-tests/lib/tests.c b/tests/fs-tests/lib/tests.c
index 8d4d83a..d1a2e0c 100644
--- a/tests/fs-tests/lib/tests.c
+++ b/tests/fs-tests/lib/tests.c
@@ -40,9 +40,9 @@
#include "tests.h"
-char *tests_file_system_mount_dir = TESTS_DEFAULT_FILE_SYSTEM_MOUNT_DIR;
+const char *tests_file_system_mount_dir = TESTS_DEFAULT_FILE_SYSTEM_MOUNT_DIR;
-char *tests_file_system_type = TESTS_DEFAULT_FILE_SYSTEM_TYPE;
+const char *tests_file_system_type = TESTS_DEFAULT_FILE_SYSTEM_TYPE;
int tests_ok_to_sync = 0; /* Whether to use fsync */
@@ -62,7 +62,7 @@ int64_t tests_repeat_parameter = 0;
int64_t tests_sleep_parameter = 0;
/* Program name from argv[0] */
-char *program_name = "unknown";
+const char *program_name = "unknown";
/* General purpose test parameter to specify a file should be unlinked.
May be used by different tests in different ways or not at all. */
@@ -1058,8 +1058,8 @@ void tests_remount(void)
{
int err;
struct mntent mount_info;
- char *source, *target, *filesystemtype, *data;
- char cwd[4096];
+ const char *source, *target, *filesystemtype;
+ char cwd[4096], *data;
unsigned long mountflags, flags;
unsigned int rorw1, um, um_ro, um_rorw, rorw2;
@@ -1152,9 +1152,9 @@ void tests_remount(void)
static void tests_mnt(int mnt)
{
static struct mntent mount_info;
- char *source;
- char *target;
- char *filesystemtype;
+ const char *source;
+ const char *target;
+ const char *filesystemtype;
unsigned long mountflags;
char *data;
static char cwd[4096];
diff --git a/tests/fs-tests/lib/tests.h b/tests/fs-tests/lib/tests.h
index 01849bc..6bcfd83 100644
--- a/tests/fs-tests/lib/tests.h
+++ b/tests/fs-tests/lib/tests.h
@@ -164,9 +164,9 @@ int tests_fs_is_currfs(void);
/* Concatenate a pid to a string in a signal safe way */
void tests_cat_pid(char *buf, const char *name, pid_t pid);
-extern char *tests_file_system_mount_dir;
+extern const char *tests_file_system_mount_dir;
-extern char *tests_file_system_type;
+extern const char *tests_file_system_type;
/* General purpose test parameter to specify some aspect of test size.
May be used by different tests in different ways.
@@ -200,7 +200,7 @@ extern int tests_delete_flag;
extern int tests_hole_flag;
/* Program name from argv[0] */
-extern char *program_name;
+extern const char *program_name;
/* Maximum file name length of test file system (from statfs) */
extern long tests_max_fname_len;
diff --git a/tests/fs-tests/simple/ftrunc.c b/tests/fs-tests/simple/ftrunc.c
index 2df404b..52b660b 100644
--- a/tests/fs-tests/simple/ftrunc.c
+++ b/tests/fs-tests/simple/ftrunc.c
@@ -39,7 +39,7 @@ static void ftrunc(void)
ssize_t written;
int64_t remains;
size_t block;
- char *file_name;
+ const char *file_name;
off_t actual;
char buf[WRITE_BUFFER_SIZE];
diff --git a/tests/fs-tests/stress/atoms/stress_2.c b/tests/fs-tests/stress/atoms/stress_2.c
index 5dea1b7..bd53ad3 100644
--- a/tests/fs-tests/stress/atoms/stress_2.c
+++ b/tests/fs-tests/stress/atoms/stress_2.c
@@ -40,7 +40,7 @@ static void stress_2(void)
int64_t remains;
int64_t repeat;
size_t block;
- char *file_name;
+ const char *file_name;
char buf[WRITE_BUFFER_SIZE];
file_name = "stress_2_test_file";
diff --git a/tests/fs-tests/utils/free_space.c b/tests/fs-tests/utils/free_space.c
index 88036aa..3421e7d 100644
--- a/tests/fs-tests/utils/free_space.c
+++ b/tests/fs-tests/utils/free_space.c
@@ -25,7 +25,7 @@
int main(int argc, char *argv[])
{
- char *dir_name = ".";
+ const char *dir_name = ".";
uint64_t free_space;
struct statvfs fs_info;