Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor fixes for tests #12

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/test_utils.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#include <stdarg.h>
#include <stdio.h>
#include <sys/time.h>
Expand All @@ -10,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
Loading