Skip to content

Commit 1156dc7

Browse files
committed
ctests: fix implicit conversions
1 parent 9fb7dbe commit 1156dc7

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

tests/ctests/test_netplan_error.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ test_netplan_error_code(__unused void** state)
2626
{
2727
GError *gerror = g_error_new(1234, 5678, "%s: error message", "it failed");
2828
uint64_t error_code = netplan_error_code(gerror);
29-
GQuark domain = error_code >> 32;
29+
GQuark domain = (GQuark)(error_code >> 32);
3030
gint error = (gint) error_code;
3131

3232
assert_int_equal(domain, 1234);

tests/ctests/test_netplan_keyfile.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ test_load_keyfile_utf8_password(__unused void** state)
260260
{
261261
NetplanState *np_state = NULL;
262262
int fd;
263-
int size;
264-
int res;
263+
size_t size;
264+
ssize_t res;
265265
char* yaml;
266266

267267
const char* keyfile =
@@ -306,7 +306,7 @@ test_load_keyfile_utf8_password(__unused void** state)
306306

307307
netplan_state_dump_yaml(np_state, fd, NULL);
308308

309-
size = lseek(fd, 0, SEEK_CUR) + 1;
309+
size = (size_t)lseek(fd, 0, SEEK_CUR) + 1;
310310
yaml = malloc(size);
311311
memset(yaml, 0, size);
312312
lseek(fd, 0, SEEK_SET);

tests/ctests/test_netplan_parser.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@ test_parse_utf8_characters(__unused void** state)
389389
{
390390
NetplanState *np_state = NULL;
391391
int fd;
392-
int size;
393-
int res;
392+
size_t size;
393+
ssize_t res;
394394

395395
char* yaml =
396396
"network:\n"
@@ -418,7 +418,7 @@ test_parse_utf8_characters(__unused void** state)
418418

419419
netplan_state_dump_yaml(np_state, fd, NULL);
420420

421-
size = lseek(fd, 0, SEEK_CUR) + 1;
421+
size = (size_t)lseek(fd, 0, SEEK_CUR) + 1;
422422
yaml = malloc(size);
423423
memset(yaml, 0, size);
424424
lseek(fd, 0, SEEK_SET);

0 commit comments

Comments
 (0)