Skip to content

Commit

Permalink
ctests: fix implicit conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloegea committed Aug 28, 2024
1 parent 40671db commit b56f5f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/ctests/test_netplan_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test_netplan_error_code(__unused void** state)
{
GError *gerror = g_error_new(1234, 5678, "%s: error message", "it failed");
uint64_t error_code = netplan_error_code(gerror);
GQuark domain = error_code >> 32;
GQuark domain = (GQuark)(error_code >> 32);
gint error = (gint) error_code;

assert_int_equal(domain, 1234);
Expand Down
6 changes: 3 additions & 3 deletions tests/ctests/test_netplan_keyfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ test_load_keyfile_utf8_password(__unused void** state)
{
NetplanState *np_state = NULL;
int fd;
int size;
int res;
size_t size;
ssize_t res;
char* yaml;

const char* keyfile =
Expand Down Expand Up @@ -306,7 +306,7 @@ test_load_keyfile_utf8_password(__unused void** state)

netplan_state_dump_yaml(np_state, fd, NULL);

size = lseek(fd, 0, SEEK_CUR) + 1;
size = (size_t)lseek(fd, 0, SEEK_CUR) + 1;
yaml = malloc(size);
memset(yaml, 0, size);
lseek(fd, 0, SEEK_SET);
Expand Down
6 changes: 3 additions & 3 deletions tests/ctests/test_netplan_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ test_parse_utf8_characters(__unused void** state)
{
NetplanState *np_state = NULL;
int fd;
int size;
int res;
size_t size;
ssize_t res;

char* yaml =
"network:\n"
Expand Down Expand Up @@ -418,7 +418,7 @@ test_parse_utf8_characters(__unused void** state)

netplan_state_dump_yaml(np_state, fd, NULL);

size = lseek(fd, 0, SEEK_CUR) + 1;
size = (size_t)lseek(fd, 0, SEEK_CUR) + 1;
yaml = malloc(size);
memset(yaml, 0, size);
lseek(fd, 0, SEEK_SET);
Expand Down

0 comments on commit b56f5f8

Please sign in to comment.