Skip to content

Commit

Permalink
tests: mark string constants as constants
Browse files Browse the repository at this point in the history
Three constants were declared as variables.

Signed-off-by: Aleksandr Golubev <[email protected]>
  • Loading branch information
Aleksandr Golubev committed Jun 17, 2024
1 parent 222ef23 commit a9d1a8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
#endif

/* Log function for tests */
static const char *log_level_str[] = {
static const char *const log_level_str[] = {
"ERROR",
"WARNING",
"INFO",
"DEBUG"
"DEBUG",
};

__attribute__((format(printf, 2, 3)))
Expand Down
12 changes: 6 additions & 6 deletions tests/vhost_user_blk_test_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,11 +854,11 @@ static int resize(struct disk *d, uint64_t new_size)
static bool monitor_serve_fd(FILE *f_in, FILE *f_out,
struct disks_context *ctx)
{
const char *help = "Commands:\n"
" help - print this message\n"
" stop - stop the server and quit\n"
" stat - print statistics\n"
" resize <new_size> - resize the disk\n";
const char *const help = "Commands:\n"
" help - print this message\n"
" stop - stop the server and quit\n"
" stat - print statistics\n"
" resize <new_size> - resize the disk\n";

bool interactive = (f_in == stdin && f_out == stdout);

Expand Down Expand Up @@ -1035,7 +1035,7 @@ static void monitor_serve_unix_socket(const char *path,

static void interactive_sigint(int sig)
{
const char *msg = "\nUse 'stop' command or Ctrl+D to exit\n";
const char *const msg = "\nUse 'stop' command or Ctrl+D to exit\n";
write(2, msg, strlen(msg));
}

Expand Down

0 comments on commit a9d1a8e

Please sign in to comment.